[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z0JUHBJ5MOKF1n-k@casper.infradead.org>
Date: Sat, 23 Nov 2024 22:15:56 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Junjie Fu <fujunjie1@...com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
akpm@...ux-foundation.org, dave.hansen@...el.com, mhocko@...nel.org
Subject: Re: [PATCH] mm/mempolicy: Fix decision-making issues for memory
migration during NUMA balancing
On Sun, Nov 24, 2024 at 03:09:35AM +0800, Junjie Fu wrote:
> Because the definition of MPOL_PREFERRED is as follows: "This mode sets the
> preferred node for allocation. The kernel will try to allocate pages from
> this node first and fall back to nearby nodes if the preferred node is low
> on free memory. If the nodemask specifies more than one node ID, the first
> node in the mask will be selected as the preferred node."
>
> Thus, if the node where the current page resides is not the first node in
> the nodemask, it is not the PREFERRED node, and memory migration can be
> attempted.
I think you've found poor documentation, not a kernel bug. If multiple
nodes are set in PREFERRED, then _new_ allocations should come from the
first node, but _existing_ allocations do not need to be moved to the
new node. At least IMO that was the original intent of allowing
multiple nodes to be set. Otherwise, what is the point?
Powered by blists - more mailing lists