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: Sean Christopherson <seanjc@google.com>,
	 Yan Zhao <yan.y.zhao@intel.com>,
	pbonzini@redhat.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>,
	 Ying Huang <ying.huang@linux.alibaba.com>,
	Alistair Popple <apopple@nvidia.com>,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org,
	Neha Gholkar <nehagholkar@gmail.com>,
	kvm@vger.kernel.org,  rick.p.edgecombe@intel.com,
	vishal.l.verma@intel.com
Subject: Re: [PATCH] mm: mempolicy: fix automatic numa balancing for shmem
Date: Thu, 23 Jul 2026 14:45:40 -0400	[thread overview]
Message-ID: <amJgdSXxFk24e94p@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <amJQAs3Bm99ZR_sF@gourry-fedora-PF4VCD3F>

On Thu, Jul 23, 2026 at 01:48:27PM -0400, Gregory Price wrote:
> On Thu, Jul 23, 2026 at 01:07:04PM -0400, Johannes Weiner wrote:
> 
> So the default global mempolicy is effectively:
> 
>     (MPOL_PREFERRED | (MPOL_F_MOF | MPOL_F_MORON)
> 
> which is just MPOL_F_NUMA_BALANCING without MPOL_F_NUMA_BALANCING.
> 
> The user can't actually see that - because the MOF/MORON flags get
> stripped out when it's queried (because they're internal only).
> 
> Maybe we should just set MPOL_F_NUMA_BALANCING in the default/preferred
> policies and document that the global preferred policy default-enables
> MPOL_F_NUMA_BALANCING - and that if a user (KVM) doesn't want to be
> affected by numa balancing it needs to set a policy to disable it.
> 

Walking this all back:

  - MPOL_DEFAULT is the default policy
  - numa_balancing=on means enable NUMA_BALANCING on the defaul policy
  - shmem was broken and did not respect this

Johannes' fix is correct, and there are no additional changes required.

Users enabling numa balancing while running KVM with shared regions are
not getting what they're asking for presently - that is a bug.

They should get the performance hit they're asking for (and then either
turn off numa balancing or set an explicit mempolicy for those tasks /
memfd's).

~Gregory


      reply	other threads:[~2026-07-23 18:45 UTC|newest]

Thread overview: 22+ 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
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 [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=amJgdSXxFk24e94p@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=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=matthew.brost@intel.com \
    --cc=nehagholkar@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=rakie.kim@sk.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=seanjc@google.com \
    --cc=vishal.l.verma@intel.com \
    --cc=yan.y.zhao@intel.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