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