Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2982840rdb; Mon, 4 Dec 2023 13:04:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IFpmPtVBC/7TOXc55EuMvGNkYQ2CLk+fYG1z5vsTGnK68qcfhNej8/bwh5P2u5tU6MOlyAw X-Received: by 2002:a05:600c:3b83:b0:40b:5f03:b3a0 with SMTP id n3-20020a05600c3b8300b0040b5f03b3a0mr1196281wms.194.1701723892853; Mon, 04 Dec 2023 13:04:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701723892; cv=none; d=google.com; s=arc-20160816; b=evbBrQ1c3F22fGZwlQpzwrJIp3ovdtXG3TE8t3xfgb+Sv0v+PDz0gqy3u2Kh7lcFb/ mSMt5Fx5mfeTa6SLwZEWayyNLw0rgqNUnqA2/dhnAA24tFQq6XBaatu8MOCiiI1Wbb9T HSpKfaYJKDw5/ZMP+5doX2PnM0e1B4lkEnh7nTaXqmSkJQKCfZKA8DBeh+wnlmGGBVHm 8BQBE6XhqmhY22kWawz2NJxITy6S4iFMslq9Dmhj+m7ileebajdKuDsH96Rxwzxxsv15 trT+zvCo4tnm+Vbh/eTot6q8aZA4vmdV3ZFGpn7UrkYmA51znk6dpizhTdlqdw9x0/UD LGhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:references:in-reply-to:subject:cc:to:from :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:dkim-signature:dkim-signature; bh=MA+9B0D+52MjUh7aSnDqh3TDNcoFbEwOhL7jbOmZ0qQ=; fh=7T89BLBIDv1JywnERByurQ/2HG+wEzADnHrKmeLicuE=; b=YGMMpLKSfEJMW6uYk1vprvsGLrNZRzMpcugSXOW5aM9UBYbdTaIE9iYxqGA+7MWobl cCUPku1JcMhs3XBZqQRvy+YZaQUBazVxWs4mRzSNWEpRt2d1dWKk29X3xtCKEORyYODo rTXFOGgLSZMBSi7EGwN8BqxGa/u6pzIkb59PF/alXK56xA78bSqZHPhrQhY7wDAOGrLR LSRewixzDlAgbcMEb4kLtgfmf8EwqkNruB6Idx6uZSzEToUidCdmCOxfNtwrymzstOxU 3J7bPWV198/QH9+YPuW2MiqcGP08yYGP0izPERbOH9/qo8D8WaEUWxTII2ol5HU6qkN+ E9cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Y6DQ1jDw; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-nfs+bounces-314-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-314-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dk22-20020a170906f0d600b009e5cb7f8a61si4789303ejb.776.2023.12.04.13.04.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 13:04:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-314-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Y6DQ1jDw; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-nfs+bounces-314-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-314-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5FF311F21090 for ; Mon, 4 Dec 2023 21:04:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5350735EF5; Mon, 4 Dec 2023 21:04:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Y6DQ1jDw"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="/c/ZpK8V" X-Original-To: linux-nfs@vger.kernel.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E2EBB6; Mon, 4 Dec 2023 13:04:46 -0800 (PST) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id BC4231FE75; Mon, 4 Dec 2023 21:04:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1701723884; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MA+9B0D+52MjUh7aSnDqh3TDNcoFbEwOhL7jbOmZ0qQ=; b=Y6DQ1jDwHRUqtIW8jgbyUbVnCwxUH/vb6EMi3N3r8rI2bRqkFAyNEIqjAdwBsI6NPcFbrq q3yCBvuMfKVSsm6hjvfRTHPiU4tcmoYw+NMf2nxbyfAJh945rLAgp2zlRTjKXOUNSD/HtD FWA1zsbA9aU552eRvgRwm8VbZtPCRzU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1701723884; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MA+9B0D+52MjUh7aSnDqh3TDNcoFbEwOhL7jbOmZ0qQ=; b=/c/ZpK8Vzwx9mXvAX/fBreIkslJ/fJ+7VzdJZhI2a/PVZxj8kR6nZx3jd+wRycW02fT7X7 DKuD0CchDgMDyfAw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id EF44F1398A; Mon, 4 Dec 2023 21:04:39 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id jdCKJ+c+bmWMUgAAD6G6ig (envelope-from ); Mon, 04 Dec 2023 21:04:39 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "NeilBrown" To: "Matthew Wilcox" Cc: "Al Viro" , "Christian Brauner" , "Jens Axboe" , "Oleg Nesterov" , "Chuck Lever" , "Jeff Layton" , "Ingo Molnar" , "Peter Zijlstra" , "Juri Lelli" , "Vincent Guittot" , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org Subject: Re: [PATCH 1/2] Allow a kthread to declare that it calls task_work_run() In-reply-to: References: <20231204014042.6754-1-neilb@suse.de>, <20231204014042.6754-2-neilb@suse.de>, Date: Tue, 05 Dec 2023 08:04:36 +1100 Message-id: <170172387681.7109.15402426750268670177@noble.neil.brown.name> Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -1.18 X-Spamd-Result: default: False [-1.18 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_TWELVE(0.00)[14]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.08)[63.75%] On Mon, 04 Dec 2023, Matthew Wilcox wrote: > On Mon, Dec 04, 2023 at 12:36:41PM +1100, NeilBrown wrote: > > +++ b/fs/namespace.c > > @@ -1328,7 +1328,7 @@ static void mntput_no_expire(struct mount *mnt) > > =20 > > if (likely(!(mnt->mnt.mnt_flags & MNT_INTERNAL))) { > > struct task_struct *task =3D current; > > - if (likely(!(task->flags & PF_KTHREAD))) { > > + if (likely((task->flags & PF_RUNS_TASK_WORK))) { >=20 > You could lose one set of parens here ... >=20 > if (likely(task->flags & PF_RUNS_TASK_WORK)) { Done. >=20 > > #define PF_RANDOMIZE 0x00400000 /* Randomize virtual address space */ > > -#define PF__HOLE__00800000 0x00800000 > > +#define PF_RUNS_TASK_WORK 0x00800000 /* Will call task_work_run() period= ically */ >=20 > And you could lose "Will" here: >=20 > #define PF_RUNS_TASK_WORK 0x00800000 /* Calls task_work_run() perio= dically */ Better - thanks. >=20 > > diff --git a/kernel/task_work.c b/kernel/task_work.c > > index 95a7e1b7f1da..aec19876e121 100644 > > --- a/kernel/task_work.c > > +++ b/kernel/task_work.c > > @@ -183,3 +183,4 @@ void task_work_run(void) > > } while (work); > > } > > } > > +EXPORT_SYMBOL(task_work_run); >=20 > _GPL? Justification? Thanks, NeilBrown