Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp353345ybk; Wed, 20 May 2020 01:05:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQWHgAxn6lLsSKe/Vg1x0QevEynDSzZCMPeYEkbqh30DatA7qTEJyYO1WNWgptKvQ5Cj0z X-Received: by 2002:a50:b961:: with SMTP id m88mr2352771ede.4.1589961948489; Wed, 20 May 2020 01:05:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589961948; cv=none; d=google.com; s=arc-20160816; b=NOKTV+N7sZKYKRkR7XBxT3xW3N/v7mjeFqATIDm7IPuLox1nx8M5OkUhnT0QxTvkY2 pMrUAopk8j/IP2FShoC1SsWi+wbrCVDlOhQoHdi4+KI0S9s5+G5tCQfq2vYDl9JNUq+/ SQKwVtMbgQ4VR3LuZhC6C5MusgOkTjhlZDP1UbN2pHt+Wz4PxCvtTJA1GMGNcFPdvOvj OV0s0LfYGiqzTpEPUpiPEWZtEPrdYtP0V88fd5SCdfXlpxt6kDBV3VaOvgphhxU062lj KqnYD2CTDs9FR7wbvSNIPoqhaa2K3ZSS0PQdWv3rn6mywDRbqSt8vwNFVQEat9ie5imi Y3Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=y3sCTdZfmz18AAXZ0SlvvKBC8R5e2o4Epvd71TjX6cI=; b=h7DaRPr+h4YWXjgm9zvTGa06uCN4KvaZmK/js0Eh1nxRwMLHrM6UFi5SEO0ha3iNPj Ax8kY89rXSw9jTwKUlhgaXPj7laQ6rRsWPRwwr6mEHvfZdg5BqFoYfgC22yITVjW5XuM 227EUg2sGE4UTIc7cG7yjLTdeTq+Af0/o8Ua9jemkEnlshRJyoFBHyZf3KGyG4MKfIkZ uLKKPf6WQYkwcyMxvpAIp0G/Q20ZJgxZ4c38ka0nEAqhib7y+ic2XGjnyPwhaM7Gk5b5 HwGnjaWifc1ZdfJ8Zo6O+daRSocQDzGaoSiYM5QZYv467BGv97DKemJnfAeoClhS8W1M cv6Q== 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 jp24si1342513ejb.184.2020.05.20.01.05.25; Wed, 20 May 2020 01:05:48 -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; 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 S1726785AbgETIED (ORCPT + 99 others); Wed, 20 May 2020 04:04:03 -0400 Received: from verein.lst.de ([213.95.11.211]:48303 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726224AbgETIED (ORCPT ); Wed, 20 May 2020 04:04:03 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id AE88368C65; Wed, 20 May 2020 10:03:58 +0200 (CEST) Date: Wed, 20 May 2020 10:03:57 +0200 From: Christoph Hellwig To: Jens Axboe , Ming Lei Cc: Christoph Hellwig , linux-kernel@vger.kernel.org, Thomas Gleixner , linux-block@vger.kernel.org, John Garry , Bart Van Assche , Hannes Reinecke , io-uring@vger.kernel.org Subject: io_uring vs CPU hotplug, was Re: [PATCH 5/9] blk-mq: don't set data->ctx and data->hctx in blk_mq_alloc_request_hctx Message-ID: <20200520080357.GA4197@lst.de> References: <20200518093155.GB35380@T590> <87imgty15d.fsf@nanos.tec.linutronix.de> <20200518115454.GA46364@T590> <20200518131634.GA645@lst.de> <20200518141107.GA50374@T590> <20200518165619.GA17465@lst.de> <20200519015420.GA70957@T590> <20200519153000.GB22286@lst.de> <20200520011823.GA415158@T590> <20200520030424.GI416136@T590> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200520030424.GI416136@T590> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 20, 2020 at 11:04:24AM +0800, Ming Lei wrote: > On Wed, May 20, 2020 at 09:18:23AM +0800, Ming Lei wrote: > > On Tue, May 19, 2020 at 05:30:00PM +0200, Christoph Hellwig wrote: > > > On Tue, May 19, 2020 at 09:54:20AM +0800, Ming Lei wrote: > > > > As Thomas clarified, workqueue hasn't such issue any more, and only other > > > > per CPU kthreads can run until the CPU clears the online bit. > > > > > > > > So the question is if IO can be submitted from such kernel context? > > > > > > What other per-CPU kthreads even exist? > > > > I don't know, so expose to wider audiences. > > One user is io uring with IORING_SETUP_SQPOLL & IORING_SETUP_SQ_AFF, see > io_sq_offload_start(), and it is a IO submission kthread. As far as I can tell that code is buggy, as it still needs to migrate the thread away when the cpu is offlined. This isn't a per-cpu kthread in the sene of having one for each CPU. Jens?