Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2590063pxb; Mon, 11 Jan 2021 13:54:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJx1MmkKhZSCkc5bShrljk1ldfQ/lQq39Q4OkwcTgVfZcqa305DSPXYOm39nrGwAgJzcxQM/ X-Received: by 2002:a17:906:4e50:: with SMTP id g16mr1040933ejw.191.1610402057130; Mon, 11 Jan 2021 13:54:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610402057; cv=none; d=google.com; s=arc-20160816; b=gFYDypSZetgGqpNHNicDnrvuJdxdSMsBc2qanYl+decRLqTypKOMhIfpZmG8c4hTWe LnYvt0mP7Zic16etlcbdeP94sMlQsqUmJQjs53CXdS9QemajU8SQhWu3aYLy4QNRXY+Q 9NAhAjutOfZOPOgD1F2Tjut+wiHydp5mMh8hjhGcPD6kYyzquuP5rmcPaucDmaRjy46J IFsjP65sHw7gs6Bdb6A2npHgFMchalpLeg84FIRdGbLGvSzXNxNIy0RvaJP3+kA0BikX hYE9qumsaJuPWBkX9Z9hXCAQK0NSCooWKmFjiFQ6hTq1buV5ZSFc8X/j15pm6nyt6ihu qS9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Anww0tBsi4r+fE370+w/3+OUfzWr8oZ03MeuWzPJ/p0=; b=Mbn65xutAZR0iySfswt2uy8LV3+K9TQ1LpUqgc+QfxLXuM3MHLi/8XidLfHHxls4YI ZkXVoAh/0HE7Q1nqLY3Za4ARnpAxv1M2WfmseRZB8zKtLb9h4qAwQzOeXTNJ1H4TTb+J nSxTfhl8yVLVCG4iYzqlb3qDRMkOUuw9IVRTtLSqvB0szIAuA1ovc+O+vZHoBtKSRUJv YEV8BN54hqOcaZMY4dGt9cvolEADXsme1+sBM6F+V0utUvruFFNLTMacZzmW2U/HoWWs i9K/9IePu0n/WhxtNIq1POLb/B2uZ3DubZO2XGyNyVRL1AWo7Z+KfpasZMXJN3u6B6ct uD4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=p9v7njyZ; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 12si397506edw.403.2021.01.11.13.53.52; Mon, 11 Jan 2021 13:54:17 -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=@kernel.org header.s=k20201202 header.b=p9v7njyZ; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731043AbhAKVvd (ORCPT + 99 others); Mon, 11 Jan 2021 16:51:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:50554 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726499AbhAKVvd (ORCPT ); Mon, 11 Jan 2021 16:51:33 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7A73A22CAF; Mon, 11 Jan 2021 21:50:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610401852; bh=sllTsw4+hrXQqGdh21Tld3kVSTGbU8J1qMWj+YcynXw=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=p9v7njyZ/8ErPcX1wGdtW1hqJH0wGQJs1j8k5cJSg8bg6iJIsuaO9RGXbgC/pAH5I n/X5p40MXYUTKeD9I7fGKLO/DRq3iWJte919kinnU6x/MyntdtWEF+/vGWGScNIPTy +mez/BlAwxrMFoHoilMKTGHXM+QMLcTProeqbAcyWhVnW13X5+qCoces7BG3varICT qkKfQJhqHl661o3ny1RnVVRUGUqzeSv//ZwuGbvk68IBtw1Iq1MlFXiaR3ZWmyv8xS tGg+q9AXwXBP1i7Q7+Btp94ploq7Px/W2zYNkPkQiYCm1iHCyYCARbgi6Q3yOhV1kY 2dYHtUbays3pw== Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 198823522A7B; Mon, 11 Jan 2021 13:50:52 -0800 (PST) Date: Mon, 11 Jan 2021 13:50:52 -0800 From: "Paul E. McKenney" To: Peter Zijlstra Cc: Thomas Gleixner , Lai Jiangshan , linux-kernel@vger.kernel.org, Valentin Schneider , Qian Cai , Vincent Donnefort , Dexuan Cui , Lai Jiangshan , Vincent Guittot , Steven Rostedt Subject: Re: [PATCH -tip V3 0/8] workqueue: break affinity initiatively Message-ID: <20210111215052.GA19589@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20201226025117.2770-1-jiangshanlai@gmail.com> <87o8hv7pnd.fsf@nanos.tec.linutronix.de> <20210111180907.GE2743@paulmck-ThinkPad-P72> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210111180907.GE2743@paulmck-ThinkPad-P72> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 11, 2021 at 10:09:07AM -0800, Paul E. McKenney wrote: > On Mon, Jan 11, 2021 at 06:16:39PM +0100, Peter Zijlstra wrote: > > > > While thinking more about this, I'm thinking a big part of the problem > > is that we're not dinstinguishing between geniuine per-cpu kthreads and > > kthreads that just happen to be per-cpu. > > > > Geniuine per-cpu kthreads are kthread_bind() and have PF_NO_SETAFFINITY, > > but sadly a lot of non-per-cpu kthreads, that might happen to still be > > per-cpu also have that -- again workqueue does that even to it's unbound > > workers :-( > > > > Now, anything created by smpboot, is created through > > kthread_create_on_cpu() and that additionally sets to_kthread(p)->flags > > KTHREAD_IS_PER_CPU. > > > > And I'm thinking that might be sufficient, if we modify > > is_per_cpu_kthread() to check that, then we only match smpboot threads > > (which include the hotplug and stopper threads, but notably not the idle > > thread) > > > > Sadly it appears like io_uring() uses kthread_create_on_cpu() without > > then having any hotplug crud on, so that needs additinoal frobbing. > > > > Also, init_task is PF_KTHREAD but doesn't have a struct kthread on.. and > > I suppose bound workqueues don't go through this either. > > > > Let me rummage around a bit... > > > > This seems to not insta-explode... opinions? > > It passes quick tests on -rcu both with and without the rcutorture fixes, > which is encouraging. I will start a more vigorous test in about an hour. And 672 ten-minute instances of RUDE01 passed with this patch applied and with my rcutorture patch reverted. So looking good, thank you!!! Thanx, Paul