Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp840102ybk; Wed, 20 May 2020 13:22:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaqXnW0bexPSwnJ7X0Vq3dpd6KTWl32TncnYBPyikUttMc9rAlrEWcCXtDL+WGJh/e5zgs X-Received: by 2002:a17:906:6457:: with SMTP id l23mr740650ejn.188.1590006165174; Wed, 20 May 2020 13:22:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590006165; cv=none; d=google.com; s=arc-20160816; b=QtH21TqTSq5L39B44KgmU8DyBNgZjNwTEJu/Mw64a737P4BhqUwL4PoR/NQBicVst9 wZ5vaCX2m+5B4TtCegIvgoZiCZiqAEVZNWoOMdPifwvykrnEbOuwf2a2/JBafr7awlwk 4qDPyK75/12RjXWTTIo3jGv/yDI0omw1kCi7/pqPoNVOSIYRjm0/SzgIl7EfGrK+hcQ/ //GSN8MuOLis29sgHZ2JiuGtYzNUW8xIme0dsl3dX1K1m7RVl16/OBifVuTT/i5nlOj1 3s5MRIbnMEECSbqSG2e6B2a4pmFrNgXn7zXj6LFrMl12zsVfm3Dc/wOVcvBSkOseZqrU rz5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=GD7wbiQVI9rDR+L0sEdN/nHd36x0k4vATNQrzzfPzoU=; b=yZoZbro5Kxd1gy9nwkXCJys3yGU7/SIrWQdA2QSijS9Z5qPPR8cCMjBc7+ETgVjsHt K+ETuvKr+7dGyOg6/L2bFEGKJojuA9NjjNRs8KIRF7AtYuECbW3xIGZi9hidHkMv3G7F rQjrOsU5vdROonC6YuCZYoqJiEWSosczsuyoJarKe9MShKp9FcKaPLf+fqfVljEJ9FG5 cX2a8TtIQAzRzSnbPA9/zu5VogQV950Ul7HLt4FXwSxhNIiUey/Z5OFSvKd9dfaTJGNa 8y3NE6GKqPO2FWOLxb5BnJTjJm4/pUg2GpM11tETDEPQKKyVz+SM7RyaZD4hsdHBXZWQ DHBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=NZ05gz8s; 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 lu16si2313244ejb.600.2020.05.20.13.22.20; Wed, 20 May 2020 13:22:45 -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=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=NZ05gz8s; 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 S1727830AbgETUSk (ORCPT + 99 others); Wed, 20 May 2020 16:18:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727009AbgETUSj (ORCPT ); Wed, 20 May 2020 16:18:39 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8DC5C061A0F for ; Wed, 20 May 2020 13:18:38 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id cx22so1836131pjb.1 for ; Wed, 20 May 2020 13:18:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=GD7wbiQVI9rDR+L0sEdN/nHd36x0k4vATNQrzzfPzoU=; b=NZ05gz8s6GydpM6eOuzSznetqGRW9eW/02dAMxNfEUCAM4R+pMFoXINk7ro5zVCii9 jjfDfQggtDRPOnsgnmOwbScCf7gWYW18dSNk7I2YE2Ow/un4uL71VpEsOYWOQLlUU3lV xNwHfwD85yMZZpH43YizXLDKZaVzttOu0Yp4IXNdNVxaxk4eFnmWmSGXydslh/oebnfg QEb6xgcB518MMvYDug8FuRQ3JAh34QHBEGJizbuoY6Sj4A4nr/MGGkM0Skdw8iqTmD3K cxVwr/XsRe5yVRkEr0v1SQgB4XYpJQNJhqmCw1ya1EAFWgkHmuLkjhgU1mgssMgb/k9O 3wew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=GD7wbiQVI9rDR+L0sEdN/nHd36x0k4vATNQrzzfPzoU=; b=b6JcScbsWJI/uLkDKhPRVQ1yGunOKeAtis/GDg/3SUcprjXbj8tv88yeUQAJVnOgXf q9Z22HUMhNsVzSfIhSu8NR3dTzCNIeyI73xb4WDu+/pyLTIE6wpNocuSrpRMbs+OP6UK U+5f5+M1hL5I4bai6rQs3tAOi3/FmkFUIwZp/5balUPzU2BrUxgOXBC9KXmM/Qxcchak mMOePvVv7SJu3XAuspBDxhUy8SOZ3WAHnMgqHITnQZ2URbYgebEJu7QTpJTgMghm7epP ee4xHSerelZ+xyWLN079+eY/gHO3etqnVxxwHK1EM+gTBsQn6mSut57RADgFdP/aLtpp AzEA== X-Gm-Message-State: AOAM533V8YVCw7RPnlILGpnTtNh/cwi3M34f10pqTdqacOB2ekZJDlGb yR7ULYGFurzjEwtazNZJdF7IDA== X-Received: by 2002:a17:90a:648c:: with SMTP id h12mr7504923pjj.229.1590005918384; Wed, 20 May 2020 13:18:38 -0700 (PDT) Received: from [192.168.86.156] (cpe-75-85-219-51.dc.res.rr.com. [75.85.219.51]) by smtp.gmail.com with ESMTPSA id h4sm2675419pfo.3.2020.05.20.13.18.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 May 2020 13:18:37 -0700 (PDT) Subject: Re: 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 To: Thomas Gleixner , Christoph Hellwig , Ming Lei Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, John Garry , Bart Van Assche , Hannes Reinecke , io-uring@vger.kernel.org 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> <20200520080357.GA4197@lst.de> <8f893bb8-66a9-d311-ebd8-d5ccd8302a0d@kernel.dk> <448d3660-0d83-889b-001f-a09ea53fa117@kernel.dk> <87tv0av1gu.fsf@nanos.tec.linutronix.de> From: Jens Axboe Message-ID: <2a12a7aa-c339-1e51-de0d-9bc6ced14c64@kernel.dk> Date: Wed, 20 May 2020 14:18:36 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <87tv0av1gu.fsf@nanos.tec.linutronix.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/20/20 1:41 PM, Thomas Gleixner wrote: > Jens Axboe writes: >> On 5/20/20 8:45 AM, Jens Axboe wrote: >>> It just uses kthread_create_on_cpu(), nothing home grown. Pretty sure >>> they just break affinity if that CPU goes offline. >> >> Just checked, and it works fine for me. If I create an SQPOLL ring with >> SQ_AFF set and bound to CPU 3, if CPU 3 goes offline, then the kthread >> just appears unbound but runs just fine. When CPU 3 comes online again, >> the mask appears correct. > > When exactly during the unplug operation is it unbound? When the CPU has been fully offlined. I check the affinity mask, it reports 0. But it's still being scheduled, and it's processing work. Here's an example, PID 420 is the thread in question: [root@archlinux cpu3]# taskset -p 420 pid 420's current affinity mask: 8 [root@archlinux cpu3]# echo 0 > online [root@archlinux cpu3]# taskset -p 420 pid 420's current affinity mask: 0 [root@archlinux cpu3]# echo 1 > online [root@archlinux cpu3]# taskset -p 420 pid 420's current affinity mask: 8 So as far as I can tell, it's working fine for me with the goals I have for that kthread. -- Jens Axboe