Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp768072pxx; Thu, 29 Oct 2020 14:05:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPMD7AnX94ZPjrczAoAhMxe3ugVX2flIeGFNvH69LRfoFGza3yGGgJQfRN6eZs0pb56Wgq X-Received: by 2002:a05:6402:754:: with SMTP id p20mr6076154edy.109.1604005520644; Thu, 29 Oct 2020 14:05:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604005520; cv=none; d=google.com; s=arc-20160816; b=ht/234Ur/D9NNf8hx7pWCbcDuf8To/l/wlVbd3TCn9xR8XsMv1n92Q0bc4t+Zol/s2 MXjYNU8z9OwSEvla0moWjAJcRxTS4Di4WQeOnrymfRetSglmZ+N7ujM9/q4f4P+ptxC9 673hjNBRGZZP4imeLydPqHJXIyku6YaL8P1PqFQ9JdUOiaVtb0+LZHrsGVVf1ODbtETY gEd7XoJOv37vaC3Fx5/1rM8H5sTd6YLK8zf0vnlPXgZ9bY3rbjL812LU/RumyKxulAwi fPbWeFQp0xWfP9D3D7n+l0oJo43hGL8f3JYUN2ArsngfontUBIw3N4NJJB8WnUgl8S8/ i+Ww== 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:dkim-signature :dkim-signature:date; bh=LLhFKWrP71TSoqyox5MkYbhaAh59bKLUqUOd82QKXAs=; b=iFQTHPIBY3tyYsqeRjYt9vZ7N4OeERF4LqlQAM3UZYU5rYtYIv1l9KbFoxBUQj1Nz0 EGwxCDVVZ4xAVBs49Ur6jgWWmF8PZa5LqCO1OAClp7/16IBvgrn/+2JgoiiKrnW5+O7u d3ZYvKOgNPTF+R9sh5n/lcWkmUwdHqkuEW06kLL36T1VVsLvS7B2tYoKFzxkXqHMgWNp sJdcPM4DCq/csM+kZO5P5/FRxSdueOny8+B7tGNGIxYNNw+9TtM+l8kaVE44piFWeKH8 EH6M+hTpt5zwuprsJUOkO1iC3p5NvGaSoVUhaV2ug99Va+koFKR21un5JrHm/LvcgLnP xoxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="D4lF/kN1"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=TRDH596v; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h10si2614138eji.627.2020.10.29.14.04.57; Thu, 29 Oct 2020 14:05:20 -0700 (PDT) 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=@linutronix.de header.s=2020 header.b="D4lF/kN1"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=TRDH596v; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726391AbgJ2VBH (ORCPT + 99 others); Thu, 29 Oct 2020 17:01:07 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:36144 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725862AbgJ2VBH (ORCPT ); Thu, 29 Oct 2020 17:01:07 -0400 Date: Thu, 29 Oct 2020 22:01:03 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1604005265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LLhFKWrP71TSoqyox5MkYbhaAh59bKLUqUOd82QKXAs=; b=D4lF/kN1PPw4zXahRgV8TWgh2/O+4kKwqCDBsk4FF9SQLj5kmpsluGR6PHXF/9kuL8CWwY cKxEjs3wm1u2hlPyuoKMrZ3moO5zwWH2pIpYuMb/ekpfPlem/Qx+dxXKszu+z5FmuQSGaR V7ux94Zily2gcYQj4tQI5Sc+PFwRfoCgha4NN/FX5Ab6vxudB2X28MWBnWnqGq2w7I0dXc PFzfuKRSGYKADBEX9+4lGT1kuBzoAIzIZ1rsp5b8sn1lqRviTAAgTthnluBTp+0o5taEYJ F4omNmlt+BWCnDlsAdaLo7hke+Q0RYmmnwEki9VgK5CB/9AyXWs59iFIMgFAxA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1604005265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LLhFKWrP71TSoqyox5MkYbhaAh59bKLUqUOd82QKXAs=; b=TRDH596v5OSrQOQ89Fp2cgLGkwri4vV0bPcBU0OyTi4LeX5cGry7QzgtDji2ET8jVdRcpQ EooMF7OECrAaCYDw== From: Sebastian Andrzej Siewior To: Sagi Grimberg Cc: Christoph Hellwig , linux-block@vger.kernel.org, Thomas Gleixner , David Runge , linux-rt-users@vger.kernel.org, Jens Axboe , linux-kernel@vger.kernel.org, Peter Zijlstra , Daniel Wagner , Mike Galbraith Subject: Re: [PATCH 3/3] blk-mq: Use llist_head for blk_cpu_done Message-ID: <20201029210103.ocufuvj6i4idf5hj@linutronix.de> References: <20201028065616.GA24449@infradead.org> <20201028141251.3608598-1-bigeasy@linutronix.de> <20201028141251.3608598-3-bigeasy@linutronix.de> <20201029131212.dsulzvsb6pahahbs@linutronix.de> <20201029140536.GA6376@infradead.org> <20201029145623.3zry7o6nh6ks5tjj@linutronix.de> <20201029145743.GA19379@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-10-29 13:03:26 [-0700], Sagi Grimberg wrote: > > > > > Well, usb-storage obviously seems to do it, and the block layer > > > > does not prohibit it. > > > > > > Also loop, nvme-tcp and then I stopped looking. > > > Any objections about adding local_bh_disable() around it? > > > > To me it seems like the whole IPI plus potentially softirq dance is > > a little pointless when completing from process context. > > I agree. > > > Sagi, any opinion on that from the nvme-tcp POV? > > nvme-tcp should (almost) always complete from the context that matches > the rq->mq_ctx->cpu as the thread that processes incoming > completions (per hctx) should be affinitized to match it (unless cpus > come and go). in which context? But this is probably nr_hw_queues > 1? > So for nvme-tcp I don't expect blk_mq_complete_need_ipi to return true > in normal operation. That leaves the teardowns+aborts, which aren't very > interesting here. The process context invocation is nvme_tcp_complete_timed_out(). > I would note that nvme-tcp does not go to sleep after completing every > I/O like how sebastian indicated usb does. > > Having said that, today the network stack is calling nvme_tcp_data_ready > in napi context (softirq) which in turn triggers the queue thread to > handle network rx (and complete the I/O). It's been measured recently > that running the rx context directly in softirq will save some > latency (possible because nvme-tcp rx context is non-blocking). > > So I'd think that patch #2 is unnecessary and just add overhead for > nvme-tcp.. do note that the napi softirq cpu mapping depends on the RSS > steering, which is unlikely to match rq->mq_ctx->cpu, hence if completed > from napi context, nvme-tcp will probably always go to the IPI path. but running it in softirq on the remote CPU would still allow of other packets to come on the remote CPU (which would block BLOCK sofirq if NET_RX is already running). Sebastian