Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2453381rdb; Sun, 3 Dec 2023 18:25:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IGKoNLA98JhwXIqvp50pnMkN/ubGm9Zh8f+XnUPsUP/Q+uN7nIbTY1glgxdr/kDhuVYuFtj X-Received: by 2002:a05:6808:2221:b0:3b8:b063:665d with SMTP id bd33-20020a056808222100b003b8b063665dmr3163790oib.84.1701656740226; Sun, 03 Dec 2023 18:25:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701656740; cv=none; d=google.com; s=arc-20160816; b=AQC1vJ6ZTftQ/oGj+44w97lWMKhABe+5X4DD1wQanRwiSk1897WeDCHRmvv+kXioD6 bT+LLSawje8h7TsmP+gE075YpY7mFw9yJ6+yQGQl7KinJpjNq63wMwl9qoAlDIpC5zny l8Wiks0eJkICQHnNVny8yH/rHb1/ewU4PbwQBTeG5KqOoIbwJtF/7KAmUMViBBnFA5An jmbBlR3+PgwsmeqK3VUIiVbmkCKcEoI6Vs5YMxgT0ZETiK/nlP4lwmqF5Oli/wpdgw14 aciJv12i4CRk83azKQJhsIP4w5A6rnuPN4rqOYUgbbR1CC0axmwqdV85NRwqoYTu8X+m 6TvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SsyO4lSpIna9nQlHkHCb+VcH3551LY+52acm9hFhGCc=; fh=+qd/FlBCtbnf4KHfSWBBrhG/QkDaUMKVTBYeffSRxpo=; b=X7xBnAcshpfD4la0Z2AVMTbR33Gqf07QLckARpdnzqlUVvXLg6ebLkFI4okwaFSGFQ KlrxnLPHxqDkWU5jWJpEfDF09yTKQqrmapKHvSAe/EjIWYCbvfgPygA5VzJdbe3mqrHU wfS4bXWRWpOM+mrpZ6EmZZmdOR2HxgoRsRbbcWwXaMd5r6ZthtKLIkpNoMax3olugBTi Di9tJIf2oqWCNXsBCfYMWBPfbISPcmQSnWsKPqfrKVUpQqvhCqURRudSoHFkGstuFW6e KvCKCsdHAmOs4H690YSOYYOsjLAc4AElAnjzXNQpXr9O+NFZpGFG9meYQkcdOZJ1n2SC WZ/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=CVVlyVrJ; spf=pass (google.com: domain of linux-nfs+bounces-269-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-269-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id dv8-20020ad44ee8000000b00670df30f618si9640900qvb.3.2023.12.03.18.25.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 18:25:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-269-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=CVVlyVrJ; spf=pass (google.com: domain of linux-nfs+bounces-269-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-269-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B29151C20850 for ; Mon, 4 Dec 2023 02:25:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E95015A7; Mon, 4 Dec 2023 02:25:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="CVVlyVrJ" X-Original-To: linux-nfs@vger.kernel.org Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1013101; Sun, 3 Dec 2023 18:25:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=SsyO4lSpIna9nQlHkHCb+VcH3551LY+52acm9hFhGCc=; b=CVVlyVrJxEBg2Dlyh4y8vfflT7 q2uxs8LdAfB6rw6+ZOUhBW5EvZn+htCaCeLPtnK64sYUfOf+boOrTzgABjSap5FtNXKTXTqs01pH+ TteMtKPJeELKRGpg42mJ1yP65XdMsC/4XIhEPKtku+cCgt/US+Bko0Xzrk4MZicvNpAMZywDWn/1J HnUOfGuX+rc/YAojLqIB/NX/oTh7cMZsT5t0u32JYN5OxAhBuzl4DxNfx2MfCbDJAUw0/jNoh1wp1 unuFQeip7ehpmpPjhFWgewImA3jCgKuYneeAcdfLvj+lg9OgbpWsxqSKiNnnv9d3Ol6YlcLB4TA4w 60Qae1vw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1r9ye0-000FhU-Fi; Mon, 04 Dec 2023 02:25:12 +0000 Date: Mon, 4 Dec 2023 02:25:12 +0000 From: Matthew Wilcox To: NeilBrown 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() Message-ID: References: <20231204014042.6754-1-neilb@suse.de> <20231204014042.6754-2-neilb@suse.de> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231204014042.6754-2-neilb@suse.de> 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) > > if (likely(!(mnt->mnt.mnt_flags & MNT_INTERNAL))) { > struct task_struct *task = current; > - if (likely(!(task->flags & PF_KTHREAD))) { > + if (likely((task->flags & PF_RUNS_TASK_WORK))) { You could lose one set of parens here ... if (likely(task->flags & PF_RUNS_TASK_WORK)) { > #define PF_RANDOMIZE 0x00400000 /* Randomize virtual address space */ > -#define PF__HOLE__00800000 0x00800000 > +#define PF_RUNS_TASK_WORK 0x00800000 /* Will call task_work_run() periodically */ And you could lose "Will" here: #define PF_RUNS_TASK_WORK 0x00800000 /* Calls task_work_run() periodically */ > 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); _GPL?