[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8732DDAB-026F-49F8-9B10-8D25C4732CA9@redhat.com>
Date: Tue, 08 Jul 2025 06:25:11 -0400
From: Benjamin Coddington <bcodding@...hat.com>
To: Tejun Heo <tj@...nel.org>
Cc: Trond Myklebust <trondmy@...nel.org>, Anna Schumaker <anna@...nel.org>,
Lai Jiangshan <jiangshanlai@...il.com>, linux-nfs@...r.kernel.org,
linux-kernel@...r.kernel.org, djeffery@...hat.com, loberman@...hat.com
Subject: Re: [PATCH 1/2] workqueue: Add a helper to identify current workqueue
On 8 Jul 2025, at 0:37, Tejun Heo wrote:
> On Mon, Jul 07, 2025 at 02:46:03PM -0400, Benjamin Coddington wrote:
>> Introduce a new helper current_workqueue() which returns the current task's
>> workqueue pointer or NULL if not a workqueue worker.
>>
>> This will allow the NFS client to recognize the case where writeback occurs
>> within the nfsiod workqueue or is being submitted directly. NFS would like
>> to change the GFP_ flags for memory allocation to avoid stalls or cycles in
>> memory pools based on which context writeback is occurring. In a following
>> patch, this helper detects the case rather than checking the PF_WQ_WORKER
>> flag which can be passed along from another workqueue worker.
>
> There's already current_work(). Wouldn't that be enough for identifying
> whether the current work item?
NFS submits different work items to the same workqueue, so comparing the
workqueue instead of the work items made more sense.
After discussion on patch 2 yesterday, I think we're going to try to fix
this in NFS using a different approach that won't need this helper now.
Thanks for the look Tejun.
Ben
Powered by blists - more mailing lists