Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753727AbbGXDjF (ORCPT ); Thu, 23 Jul 2015 23:39:05 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:36527 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752894AbbGXDjD (ORCPT ); Thu, 23 Jul 2015 23:39:03 -0400 Message-ID: <1437709139.3520.73.camel@gmail.com> Subject: Re: [patch] workqueue: schedule WORK_CPU_UNBOUND work on wq_unbound_cpumask CPUs From: Mike Galbraith To: Tejun Heo Cc: Lai Jiangshan , Frederic Weisbecker , Daniel Bristot de Oliveira , LKML , Rik van Riel , "Luis Claudio R. Goncalves" Date: Fri, 24 Jul 2015 05:38:59 +0200 In-Reply-To: <20150722152500.GN15934@mtj.duckdns.org> References: <1437107190.3438.23.camel@gmail.com> <20150717152720.GD15934@mtj.duckdns.org> <1437153348.5860.32.camel@gmail.com> <20150718133602.GA3041@lerouge> <1437292973.3505.83.camel@gmail.com> <1437468925.12755.57.camel@gmail.com> <1437542686.3106.55.camel@gmail.com> <20150722141148.GL15934@mtj.duckdns.org> <1437576912.3484.8.camel@gmail.com> <1437578340.3484.15.camel@gmail.com> <20150722152500.GN15934@mtj.duckdns.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2262 Lines: 54 On Wed, 2015-07-22 at 11:25 -0400, Tejun Heo wrote: > Hello, > > On Wed, Jul 22, 2015 at 05:19:00PM +0200, Mike Galbraith wrote: > > Ew, looking at the numbers, they may prefer to either a) pretend to not > > notice, or b) scurry off to HPC'R'US store if a) won't fly ;-) > > Yeah, there are a lot of them. The sad part is that only very few of > them would actually need local binding for correctness. :( I'm going to end this thread with an under my breath mutter. Before I do that, note that I went and beat up three different boxen over days before turning trivial little patchlet loose, ie I was quite paranoid despite the below, "No way Jose" was not entirely unexpected. Mutter: WORK_CPU_UNBOUND is about as far from a local execution guarantee as it gets, and not only is it prominently displayed for all to see... /** * queue_work - queue work on a workqueue * @wq: workqueue to use * @work: work to queue * * Returns %false if @work was already on a queue, %true otherwise. * * We queue the work to the CPU on which it was submitted, but if the CPU dies * it can be processed by another CPU. */ static inline bool queue_work(struct workqueue_struct *wq, struct work_struct *work) { return queue_work_on(WORK_CPU_UNBOUND, wq, work); } ...there's nothing ambiguous about that. While it states that we queue locally, it also clearly states that local execution is NOT guaranteed, making assumption thereof a BUG, which in turn makes it seem a bit odd to tie fixing up nohz_full a little to auditing and fixing every booboo ever made (unlikely to ever happen). It would appear that the only way anyone could ever have sanely assume local execution, WORK_CPU_UNBOUND aside, is to have called get_online_cpus() before queueing any work. Mutter expressed, it's not a big hairy deal, anyone using an SMP kernel with an expectation of zero perturbation is doomed to be disappointed anyway, patchlet just reduced noise a bit. -Mike (mutter mutter mutter;) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/