Thread (4 messages) 4 messages, 2 authors, 2023-12-27

Re: [PATCH v5 02/11] mm/mempolicy: introduce MPOL_WEIGHTED_INTERLEAVE for weighted interleaving

From: Gregory Price <hidden>
Date: 2023-12-27 19:52:21
Also in: linux-doc, linux-fsdevel, linux-mm, lkml

On Tue, Dec 26, 2023 at 02:01:57AM -0500, Gregory Price wrote:
On Wed, Dec 27, 2023 at 04:32:37PM +0800, Huang, Ying wrote:
quoted
Gregory Price [off-list ref] writes:
Barrier is to stabilize nodemask on the stack, but yes i'll carry the
comment from interleave_nid into this barrier as well.
quoted
quoted
+
+	/* first ensure we have a valid nodemask */
+	nid = first_node(nodemask);
+	if (nid == MAX_NUMNODES)
+		return nid;
It appears that this isn't necessary, because we can check whether
weight_total == 0 after the next loop.
fair, will snip.
Follow up - this is only possible if the nodemask is invalid / has no
nodes, so it's better to check for this explicitly.  If nodemask is
valid, then it's not possible to have a weight_total of 0, because
weights cannot be 0.

~Gregory
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help