Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2893608pxb; Mon, 25 Jan 2021 01:10:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJzMSdKbV6Zhb4lfz0guYvpOyD6hpltdYgdFQVVnW9Z9s8W5Gd/ZMbwOMxbyIdRnGZaAnjuP X-Received: by 2002:a17:906:3792:: with SMTP id n18mr537634ejc.47.1611565821338; Mon, 25 Jan 2021 01:10:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611565821; cv=none; d=google.com; s=arc-20160816; b=tafjseiAO++fJKnbA45yHypXDtEtLrszXVlDqTf9JEquIme6Bz34EIlxeDSGv8uEJZ IzVuxTUDAVN2FPDlxooJ4OwsBeLlmqFoLTdQ9uPiYY4efkUYKF8KF45RSTkCpKWn5eVQ 2nLXTVR8LbUpLO+aoOJU7mRrpOnv8TNPPGCo8W6v1Lvdq1mMpKhsBflgN1/FoklYmjGk SeXlHDg9AbYnObM7mj/eWPmL2N7QEyPXLKtZjbnhRuhFRdAH61rLooBGCjpxaYdRwo6E tAKzOGDbIc4UJlu815nZc6W5xIoK1ukXJNt8eee/xc3gfcbgY+tkWpOSBeNd2SN+rRI2 nBiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1YTL3xi9CVuV+0Md7FSHan4RIDZ4NeHG0snB2En/L1k=; b=nmMx5T2dMZGcT2SdYb3Ddm7+YF99ALT7GOEIqXorq4QBAGL11aSreUwY7N5RgAPrkE YNyarvKdEZfQFsAWMFkimTpyCnau0OmxmtvypqhbJoAtpnZq/kXLHRVEi7biGRewvj6S yzOxAE6cmA4nfE2/1ljKTRhmPFQXxAY2WWkrA5Pm4j8X1Q3cLjONCY7c4Lx2kFXu3XPi zTAjq4lwV95o1VGKg45nqlXiSXjWvhnURN23Voozb/W2w+oqz6N1jXfby7h6N2dLPM43 rG9fGTSAHn8fHs/d7ugs9rNJ0FAQ0KgZr//nsQPQlkZTjwnE20ez47/p+lP82xeDacht uKIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=IKK3nq9r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f9si6735933edr.611.2021.01.25.01.09.57; Mon, 25 Jan 2021 01:10:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=IKK3nq9r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725984AbhAYJCg (ORCPT + 99 others); Mon, 25 Jan 2021 04:02:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725933AbhAYIlm (ORCPT ); Mon, 25 Jan 2021 03:41:42 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 280DEC061353; Mon, 25 Jan 2021 00:39:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=1YTL3xi9CVuV+0Md7FSHan4RIDZ4NeHG0snB2En/L1k=; b=IKK3nq9rkHme4slZau8I2LIOE/ 8aDher63l1E6jIGv4VbZ9GMYPJe8Z3F7SNHXKZ6mZQlZN/VcKAHx4Lz1WFAUAYzGSwDVH5w1N5yhW yUNvKvJPaf8oz3524BfMXCwlKhxBPiZI6/ixqVE5joxeb75fSZGt6KEHfFlj5WwhYCHfEA7T2dgQ6 7YF+CT9FTFGNeKL55fNyQD8vmarHlIcOoFQh9kCxspGJOpXiK07+oO+2xnNV0hxaPSGp3G0eEDFIK YNZd2wfAUcOZBC3ZcSQ41oMIaq7xpuV6Oz61w8UKIyYXteN3Wc/Y8+VAeCNwhBMu/EEkfF29DH9zy ZIh8ikXg==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1l3xOp-003yLT-Hk; Mon, 25 Jan 2021 08:39:06 +0000 Date: Mon, 25 Jan 2021 08:39:03 +0000 From: Christoph Hellwig To: Sebastian Andrzej Siewior Cc: Christoph Hellwig , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Jens Axboe , Thomas Gleixner , Peter Zijlstra , Ingo Molnar Subject: Re: [PATCH 3/3] blk-mq: Use llist_head for blk_cpu_done Message-ID: <20210125083903.GB945284@infradead.org> References: <20210123201027.3262800-1-bigeasy@linutronix.de> <20210123201027.3262800-4-bigeasy@linutronix.de> <20210125083012.GD942655@infradead.org> <20210125083204.ahddujk5m6njwbju@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210125083204.ahddujk5m6njwbju@linutronix.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 25, 2021 at 09:32:04AM +0100, Sebastian Andrzej Siewior wrote: > On 2021-01-25 08:30:12 [+0000], Christoph Hellwig wrote: > > > +static void blk_mq_complete_send_ipi(struct request *rq) > > > +{ > > > + struct llist_head *list; > > > + unsigned int cpu; > > > + > > > + cpu = rq->mq_ctx->cpu; > > > + list = &per_cpu(blk_cpu_done, cpu); > > > + if (llist_add(&rq->ipi_list, list)) { > > > + INIT_CSD(&rq->csd, __blk_mq_complete_request_remote, rq); > > > + smp_call_function_single_async(cpu, &rq->csd); > > > + } > > > +} > > > > Nit: it would be nice to initialize cpu and list in the declaration > > lines. > > Why? They get initialized later. Because: unsigned int cpu = rq->mq_ctx->cpu; struct llist_head *list = &per_cpu(blk_cpu_done, cpu); is a lot easier to follow than: struct llist_head *list; unsigned int cpu; cpu = rq->mq_ctx->cpu; list = &per_cpu(blk_cpu_done, cpu);