From: Gregory Price <gourry@gourry.net>
To: Lin Ruifeng <linruifeng4@huawei.com>
Cc: akpm@linux-foundation.org, david@kernel.org, ziy@nvidia.com,
matthew.brost@intel.com, joshua.hahnjy@gmail.com,
rakie.kim@sk.com, byungchul@sk.com, ying.huang@linux.alibaba.com,
apopple@nvidia.com, joro@8bytes.org, will@kernel.org,
robin.murphy@arm.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] mm/mempolicy: NUMA mempolicy mismatch during remote access
Date: Mon, 16 Mar 2026 10:07:23 -0400 [thread overview]
Message-ID: <abgOmx0kwvOnN_R_@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <20260316120424.1535575-1-linruifeng4@huawei.com>
On Mon, Mar 16, 2026 at 08:04:24PM +0800, Lin Ruifeng wrote:
> I'd like to report an issue in the SVA I/O Page Fault (IOPF) handling path:
> a NUMA memory policy mismatch caused by deferred workqueue processing.
>
> When hardware triggers a page fault via the IOMMU SVA mechanism, it's handled
> asynchronously by a kworker thread. Although the fault handler correctly uses
> the original process's mm_struct for address space mapping, the physical page
> allocation (e.g., in do_anonymous_page()) still depends on current->mempolicy.
>
> Since current here is the kworker, not the original user process, any
> task-level NUMA policy (e.g., set_mempolicy() or numactl --membind) is
> completely ignored. Instead, allocation follows the kworker's default policy,
> which may run on a different NUMA node.
>
> A similar issue was also discussed in [1]. I was wondering if you might have
> any suggestions on how to address this issue.
>
> Link: https://lore.kernel.org/linux-mm/e2d5f3a5-f6f1-4567-a162-a0e814292738@asahilina.net/
> Signed-off-by: Lin Ruifeng <linruifeng4@huawei.com>
> 2.43.0
>
I think the best we could do in this scenario is acquire the mm_struct
process's mempolicy and plumb it through - but this is not exactly
correct either as multiple threads within a process may have different
mempolicies.
I imagine this also applies to vma policies as well - so you'd need to
check both the vma and the task. Not eactly great since we're talking
multiple locks where there were none before.
~Gregory
prev parent reply other threads:[~2026-03-16 14:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-16 12:04 Lin Ruifeng
2026-03-16 14:07 ` Gregory Price [this message]
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=abgOmx0kwvOnN_R_@gourry-fedora-PF4VCD3F \
--to=gourry@gourry.net \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=byungchul@sk.com \
--cc=david@kernel.org \
--cc=joro@8bytes.org \
--cc=joshua.hahnjy@gmail.com \
--cc=linruifeng4@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=matthew.brost@intel.com \
--cc=rakie.kim@sk.com \
--cc=robin.murphy@arm.com \
--cc=will@kernel.org \
--cc=ying.huang@linux.alibaba.com \
--cc=ziy@nvidia.com \
/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