Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Gregory Price <gourry@gourry.net>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: "Huang, Ying" <ying.huang@linux.alibaba.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@kernel.org>, Zi Yan <ziy@nvidia.com>,
	Matthew Brost <matthew.brost@intel.com>,
	Joshua Hahn <joshua.hahnjy@gmail.com>,
	Rakie Kim <rakie.kim@sk.com>, Byungchul Park <byungchul@sk.com>,
	Alistair Popple <apopple@nvidia.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Neha Gholkar <nehagholkar@gmail.com>
Subject: Re: [PATCH] mm: mempolicy: fix automatic numa balancing for shmem
Date: Wed, 1 Jul 2026 12:22:23 -0400	[thread overview]
Message-ID: <akU-v6w2uEZqxecY@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <akU2_Mt_JDCxmnc7@cmpxchg.org>

On Wed, Jul 01, 2026 at 11:49:16AM -0400, Johannes Weiner wrote:
> On Wed, Jul 01, 2026 at 11:33:38AM -0400, Gregory Price wrote:
> > 
> > I considered proposing MPOL_F_MOVABLE_ONLY to mean (roughly) "userland
> > memory only" - and then slowly trying to migrate numactl to make this
> > the default.
> 
> Hm. Kernel allocations that are totally incidental like the stackdepot
> example above should not follow task policy. But there are kernel
> allocations (kernel stack, inodes, pipes) that are directly allocated
> on behalf of a process, and so probably SHOULD follow task policy.
> 
> That's an annotation problem that I think we have solved already,
> because cgroups need the same distinction for what allocations to
> charge to the current task's cgroup context.
> 
> We could rename __GFP_ACCOUNT / SLAB_ACCOUNT to __GFP_TASKPOLICY /
> SLAB_TASKPOLICY or something, and have mempolicy follow it too.
> 
> There is still the whole "changing 20 year old behavior" aspect, but I
> think the polarity works in our favor: big important allocations have
> already been following the policy correctly. The behavior changes
> primarily for smaller, random allocations.

This seems like it would be a pretty trivial change.

something like:

static nodemask_t *policy_nodemask(gfp_t gfp, struct mempolicy *pol,
				   pgoff_t ilx, int *nid)
{
	nodemask_t *nodemask = NULL;
	
	if (!(gfp & __GFP_TASKPOLICY))
		/* don't do the task policy, numa_node_id()? */
... snip ...
}


  reply	other threads:[~2026-07-01 16:22 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-29 16:33 [PATCH] mm: mempolicy: fix automatic numa balancing for shmem Johannes Weiner
2026-06-29 17:59 ` Gregory Price
2026-06-29 18:22   ` Johannes Weiner
2026-06-30 11:20   ` Huang, Ying
2026-06-30 15:29     ` Gregory Price
2026-07-01 11:03       ` Huang, Ying
2026-07-01 15:33         ` Gregory Price
2026-07-01 15:49           ` Johannes Weiner
2026-07-01 16:22             ` Gregory Price [this message]
2026-07-06 11:27           ` Huang, Ying
2026-07-06 17:30             ` Gregory Price
2026-06-29 18:33 ` David Hildenbrand (Arm)
2026-06-29 18:47   ` Johannes Weiner
2026-06-30 11:26     ` David Hildenbrand (Arm)
2026-06-30 23:40 ` Balbir Singh
2026-07-23  5:39 ` Yan Zhao
2026-07-23 13:51   ` Sean Christopherson
2026-07-23 14:54     ` Johannes Weiner
2026-07-23 15:58       ` Gregory Price
2026-07-23 17:07         ` Johannes Weiner
2026-07-23 17:48           ` Gregory Price
2026-07-23 18:45             ` Gregory Price
2026-07-23 22:30               ` Yosry Ahmed
2026-07-23 22:56                 ` Gregory Price
2026-07-24  0:15       ` Andrew Morton
2026-07-24  3:55         ` Gregory Price
2026-07-27 16:37           ` Sean Christopherson

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=akU-v6w2uEZqxecY@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=hannes@cmpxchg.org \
    --cc=joshua.hahnjy@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=matthew.brost@intel.com \
    --cc=nehagholkar@gmail.com \
    --cc=rakie.kim@sk.com \
    --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