Received: by 10.223.185.116 with SMTP id b49csp4145558wrg; Tue, 6 Mar 2018 10:32:13 -0800 (PST) X-Google-Smtp-Source: AG47ELvn+qeUSm9z56x2d9DV/bu/NJpb+FXZTGpgh7Iza2kiQRVRxB6an0NZonphIvMPL40W4lXB X-Received: by 2002:a17:902:20e6:: with SMTP id v35-v6mr17528510plg.226.1520361133839; Tue, 06 Mar 2018 10:32:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520361133; cv=none; d=google.com; s=arc-20160816; b=01hrwkydABGkkW44wMTL1whJEehdCef4xuD5Gcmu+CYkGTHMrpMENVVUeZ6l4T/PSF qbZYilIknWR0bSIBP+LFgtSf4ox4JfEeUOMthm6SKVe+HXe9aMqksWGWM/7c2aPwRPG/ nTO5ZUDiqag6WmQsxlCVdA1Skxa46cab9Q3rCjMLDPlETHSnIT/KyaLpcOkOd1Pig8L9 eLLwmdnUna/hOdNHti5cGaqcPXXkOrhHNDnAji8h5tJOiiQLN7utNVrrnSc9UGYRhyVF iyTNNps1LNRJDLB4zuzk8q5rFj1O3bIPXeSK8i24VdS6ZpgpeML4nJNZ63zohohHM04m glTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=Sn/iHIDnBYJwPVFLyuob962lIzYVR37ZlZDcYJAczDo=; b=LGY+0jsLiHwY5QenwYwDH9d8kD3BZZYbzxo0Y6c+X0wm23+UF+9xd3LtYIXqDlUUH2 ntg41gKJDG4pEerrTicm3lkaCy/qUNv7m2wHCz6o84Z4t5i9thhXSiUDr3SR6sx8XqTH 1j+F/kE4emOQOxYOzstL43UsDww+h8nboINOkXIF5O1vbEuxz4wIkrAmtEPxrAMecJ7n qb56tiLyZIhhqMfD9tRQAlLCA21V/12sEjrR2NFljp+WYYaFpCvZPL8N3AHKHKrKEnPE IGd3mK1HDzI9iahcdNZXGmDzjq/obofSyrjG5CCXdpBdrDyYdihhDD2EhI0ifq6Vd1Xa ToZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=D/88R1Gg; dkim=fail header.i=@linux-foundation.org header.s=google header.b=Ynyd4ZAg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o1-v6si11357492plb.280.2018.03.06.10.31.58; Tue, 06 Mar 2018 10:32:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=D/88R1Gg; dkim=fail header.i=@linux-foundation.org header.s=google header.b=Ynyd4ZAg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754022AbeCFSac (ORCPT + 99 others); Tue, 6 Mar 2018 13:30:32 -0500 Received: from mail-io0-f179.google.com ([209.85.223.179]:47010 "EHLO mail-io0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753901AbeCFSab (ORCPT ); Tue, 6 Mar 2018 13:30:31 -0500 Received: by mail-io0-f179.google.com with SMTP id p78so7907iod.13 for ; Tue, 06 Mar 2018 10:30:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Sn/iHIDnBYJwPVFLyuob962lIzYVR37ZlZDcYJAczDo=; b=D/88R1GgiIuFLX5duLFHzjnvEAwM/2zDlOPdPVtYTMY5squY+s7qMsaJSOzl6MRU7M w/0gVMzMEhFlZlMJaL+vb9Zp4/KmmIWQrhY9rtvNKiqtG/t+YQgy039dWljfQ6/mplOl KJ7ev97ju9kmnAwYMrjc2vnbHGBJaC7jKvksZqL/wKUC61IYMXGfggdDAshyM/lOJzrK Ch0FIVxgnXwV+xTI4WTWseYaaUHDratT5T74GNIk8badoklo/27SIDLKmiterhtht++f 6eEFYP4e4vTNa4EDA2ZcYWJNLl1IkU8KN8uKfgqlaaqIbQieH0Gt93UEl5e8L5gu8kXC r9OQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Sn/iHIDnBYJwPVFLyuob962lIzYVR37ZlZDcYJAczDo=; b=Ynyd4ZAgoHEO3QBq4zfJcEog5xnYzfpG947bgdMcfljP332WYZ0DyaqWmKx2UK54MU W+8xj5txBVO4crGWg8y3ClKCQ7PNRiyyOl50CAmCxX8FSroutlxRpg1DhJvm2tHuoD9M 9rgaKegd7BKV1njwq2spB+2TRj18VgCbTBk8k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Sn/iHIDnBYJwPVFLyuob962lIzYVR37ZlZDcYJAczDo=; b=Vvf1MP+juq0VLzOiX9V0f9us9h+DFN9rgVBl5qvDAhWvkvCyZMCsMOFZcJ52ZmKB0U /MmlNqfN4e88JjFFKI/hcaWvPm7F4kLbDVJ0Wg8AdT4ZRRGNJn6+t9YofxxhsGg2VL3H aFaqI2nL0JfMg7Iq2VoJdxYAL2ZtE5cqd1kJ+iZn5YM8iLuR6kTNPbw1ZvDTSgzFIz3J dgB6cIQQ9X9EQYISTJCNGi4tIqs2rGWwwcf9nfxh36E5ky6p5oDf8ZrSozIzEIRejQtX bIWha1fwTD//mqnJqwc27ZBWiE4NYFaCnkcR9BgA8EKGv7FEN8A+5YzvrI7dOwUbak0q zQxg== X-Gm-Message-State: APf1xPDexPGGJbnz9NeclYUKv6lPWUOd9UDBftEkAmQZtdJaffe5Kdyv 66dh+0uLUseAWe0vtCLs7Rf2HF21aDUFBAg35OA= X-Received: by 10.107.10.155 with SMTP id 27mr23700454iok.259.1520361030478; Tue, 06 Mar 2018 10:30:30 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.135.221 with HTTP; Tue, 6 Mar 2018 10:30:29 -0800 (PST) In-Reply-To: <20180306173316.3088458-7-tj@kernel.org> References: <20180306172657.3060270-1-tj@kernel.org> <20180306173316.3088458-1-tj@kernel.org> <20180306173316.3088458-7-tj@kernel.org> From: Linus Torvalds Date: Tue, 6 Mar 2018 10:30:29 -0800 X-Google-Sender-Auth: rCh8__8UDevme8GKJwG4CA41NXo Message-ID: Subject: Re: [PATCH 7/7] RCU, workqueue: Implement rcu_work To: Tejun Heo Cc: Jann Horn , Paul McKenney , Benjamin LaHaise , Al Viro , Kent Overstreet , security@kernel.org, Linux Kernel Mailing List , kernel-team Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 6, 2018 at 9:33 AM, Tejun Heo wrote: > > This patch introduces rcu_work, a workqueue work variant which gets > executed after a RCU grace period, and converts the open coded > bouncing in fs/aio and kernel/cgroup. So I like the concept, but I have two comments: - can we split this patch up, so that if somebody bisects a problem to it, we'll see if it's cgroup or aio that triggers it? - this feels wrong: > +struct rcu_work { > + struct work_struct work; > + struct rcu_head rcu; > + > + /* target workqueue and CPU ->rcu uses to queue ->work */ > + struct workqueue_struct *wq; > + int cpu; > +}; That "int cpu" really doesn't feel like it makes sense for an rcu_work. The rcu_call() part fundamentally will happen on any CPU, and sure, it could then schedule the work on something else, but that doesn't sound like a particularly sound interface. So I'd like to either just make the thing always just use WORK_CPU_UNBOUND, or hear some kind of (handwaving ok) explanation for why something else would ever make sense. If the action is fundamentally delayed by RCU, why would it make a difference which CPU it runs on? One reason for that is that I get this feeling that the multiple stages of waiting *might* be unnecessary. Are there no situations where a "rcu_work" might just end up devolving to be just a regular work? Or maybe situations where the rcu callback is done in process context, and the work can just be done immediately? I'm a tiny bit worried about queueing artifacts, where we end up having tons of resources in flight. But this really is just a "this feels wrong". I have no real hard technical reason. Linus