Linux NFS development
 help / color / mirror / Atom feed
From: Benjamin Coddington <bcodding@redhat.com>
To: Tejun Heo <tj@kernel.org>
Cc: Trond Myklebust <trondmy@kernel.org>,
	Anna Schumaker <anna@kernel.org>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	djeffery@redhat.com, loberman@redhat.com
Subject: Re: [PATCH 1/2] workqueue: Add a helper to identify current workqueue
Date: Tue, 08 Jul 2025 06:25:11 -0400	[thread overview]
Message-ID: <8732DDAB-026F-49F8-9B10-8D25C4732CA9@redhat.com> (raw)
In-Reply-To: <aGygp-3mtsLxtGT3@slm.duckdns.org>

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


  reply	other threads:[~2025-07-08 10:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-07 18:46 [PATCH 0/2] Fix loopback mounted filesystems on NFS Benjamin Coddington
2025-07-07 18:46 ` [PATCH 1/2] workqueue: Add a helper to identify current workqueue Benjamin Coddington
2025-07-08  4:37   ` Tejun Heo
2025-07-08 10:25     ` Benjamin Coddington [this message]
2025-07-07 18:46 ` [PATCH 2/2] NFS: Improve nfsiod workqueue detection for allocation flags Benjamin Coddington
2025-07-07 19:25   ` Trond Myklebust
2025-07-07 20:12     ` Benjamin Coddington
2025-07-07 20:42       ` Trond Myklebust
2025-07-07 20:28     ` Laurence Oberman
2025-07-08 16:50       ` Laurence Oberman
2025-07-08 17:03         ` Benjamin Coddington
2025-07-08 17:09           ` Laurence Oberman
     [not found]             ` <F889E706-9B2B-48CA-B30E-60FB5EFE2578@redhat.com>
2025-07-09 14:36               ` [PATCH] NFS: Fixup allocation flags for nfsiod's __GFP_NORETRY Laurence Oberman
2025-07-07 19:15 ` [PATCH 0/2] Fix loopback mounted filesystems on NFS Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8732DDAB-026F-49F8-9B10-8D25C4732CA9@redhat.com \
    --to=bcodding@redhat.com \
    --cc=anna@kernel.org \
    --cc=djeffery@redhat.com \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=loberman@redhat.com \
    --cc=tj@kernel.org \
    --cc=trondmy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox