Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2883614pxb; Mon, 25 Jan 2021 00:49:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFkhEYB6U1CYKTkjdyGQRtCiJR9OIrAHHxMJ6aRZW4vzfaRln/iSOfUenQ7TpapgOiOzGd X-Received: by 2002:aa7:c34f:: with SMTP id j15mr726123edr.120.1611564551419; Mon, 25 Jan 2021 00:49:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611564551; cv=none; d=google.com; s=arc-20160816; b=NQ5csyp3Yg1mYH0wlaBLqNHZvdxfnpaxzih9g5nrgrb/7rmJf/RQBDm9W32AM/YkuX xrGR7XTi7yMTG8cd9LmO3dS7TGWWISduqb2NAaJdUtNuO9KH52iiuzk5tT3HfxyQPJ1X gqZtHk3eMAGfRXTUVZG3PLUPlW7U/Xsb30hgW1ZJ3R0LeDyd75fbY/Z56QFVQ6KGp/Y1 KdqoCBL8wVXj6hvvui376MpMK4+FKldWgLJm71X1Mz/x8C7rrYq/Z212AjAAMhtHD6y9 rwNAHuHgPtLwrh8ScTdjoapmMjxM8lPTv/bLKYerINakL5QVXNQ8Tcr9VWN3qlEjlOjn jziQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=Fxbokp2gfQ3Wx7oG1eoQ61rccvvhYTH9hD0it6vJK7w=; b=d20LkWuI8M1rG4qFjLZ9xefu7OCpViq4TjbbRkrgm07AWEPcYSYDo3Om3U5ypQw09G gijhZFmccjPHhZ34J5+vbbyzarsIdaEcg0M0GB9OzPfhOunvZteyr6GgUPAnnNf31Sxw y6bIu4DSz2H+UDfx1u1nqY0cXhkLM4ocqfxu2SippUY5NMYh02iGoBpRFX2EEAr9AnGp qbireiOaOi2aCaOb/ymoZrgdumFRuWKupQDcec3MwJk80lxe8OlwtZ+VYIh07BBPCiIJ KJckJUyCch7yXedPKgDw9zOD3nEBhJk6DmAZeASMh02nSRoA140CCoOZF8IqmRh4coej 71ZQ== ARC-Authentication-Results: i=1; mx.google.com; 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 hs7si6415636ejc.82.2021.01.25.00.48.33; Mon, 25 Jan 2021 00:49:11 -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; 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 S1725974AbhAYIgw (ORCPT + 99 others); Mon, 25 Jan 2021 03:36:52 -0500 Received: from mx2.suse.de ([195.135.220.15]:49962 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727201AbhAYHM3 (ORCPT ); Mon, 25 Jan 2021 02:12:29 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 3AD6DAD62; Mon, 25 Jan 2021 07:10:17 +0000 (UTC) Subject: Re: [PATCH 2/3] blk-mq: Always complete remote completions requests in softirq To: Sebastian Andrzej Siewior , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jens Axboe , Thomas Gleixner , Peter Zijlstra , Ingo Molnar References: <20210123201027.3262800-1-bigeasy@linutronix.de> <20210123201027.3262800-3-bigeasy@linutronix.de> From: Hannes Reinecke Message-ID: <30ce5ce2-8b9a-8873-4b37-c8720300942b@suse.de> Date: Mon, 25 Jan 2021 08:10:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210123201027.3262800-3-bigeasy@linutronix.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/23/21 9:10 PM, Sebastian Andrzej Siewior wrote: > Controllers with multiple queues have their IRQ-handelers pinned to a > CPU. The core shouldn't need to complete the request on a remote CPU. > > Remove this case and always raise the softirq to complete the request. > > Signed-off-by: Sebastian Andrzej Siewior > --- > block/blk-mq.c | 14 +------------- > 1 file changed, 1 insertion(+), 13 deletions(-) > > diff --git a/block/blk-mq.c b/block/blk-mq.c > index f285a9123a8b0..90348ae518461 100644 > --- a/block/blk-mq.c > +++ b/block/blk-mq.c > @@ -628,19 +628,7 @@ static void __blk_mq_complete_request_remote(void *data) > { > struct request *rq = data; > > - /* > - * For most of single queue controllers, there is only one irq vector > - * for handling I/O completion, and the only irq's affinity is set > - * to all possible CPUs. On most of ARCHs, this affinity means the irq > - * is handled on one specific CPU. > - * > - * So complete I/O requests in softirq context in case of single queue > - * devices to avoid degrading I/O performance due to irqsoff latency. > - */ > - if (rq->q->nr_hw_queues == 1) > - blk_mq_trigger_softirq(rq); > - else > - rq->q->mq_ops->complete(rq); > + blk_mq_trigger_softirq(rq); > } > > static inline bool blk_mq_complete_need_ipi(struct request *rq) > I don't get this. This code is about _avoiding_ having to raise a softirq if the driver exports more than one hardware queue. So where exactly does the remote CPU case come in here? Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer