Re: [PATCH v3 4/4] mm/mempolicy: change cur_il_weight to atomic and carry the node with it

From: Gregory Price
Date: Tue Jan 30 2024 - 11:01:59 EST


On Tue, Jan 30, 2024 at 01:18:30PM +0800, Huang, Ying wrote:
> Gregory Price <gregory.price@xxxxxxxxxxxx> writes:
>
> > For normal interleave, this isn't an issue because it always proceeds to
> > the next node. The same is not true of weighted interleave, which may
> > have a hanging weight in task->il_weight.
>
> So, I added a check as follows,
>
> node_isset(current->il_prev, policy->nodes)
>
> If prev node is removed from nodemask, allocation will proceed to the
> next node. Otherwise, it's safe to use current->il_weight.
>

Funny enough I have this on one of my branches and dropped it, but after
digging through everything - this should be sufficient.

I'll just add il_weight next to il_prev and have a new set of patches
out today. Code is already there, just needs one last cleanup pass.

~Gregory