[PATCH] mm/mempolicy: do not duplicate policy if it is not applicable for set_mempolicy_home_node

From: Michal Hocko
Date: Thu Dec 15 2022 - 09:49:09 EST


On Thu 15-12-22 09:33:54, Mathieu Desnoyers wrote:
> On 2022-12-15 02:51, Michal Hocko wrote:
[...]
> > Btw. looking at the code again it seems rather pointless to duplicate
> > the policy just to throw it away anyway. A slightly bigger diff but this
> > looks more reasonable to me. What do you think? I can also send it as a
> > clean up on top of your fix.
>
> I think it would be best if this comes as a cleanup on top of my fix. The
> diff is larger than the minimal change needed to fix the leak in stable
> branches.
>
> Your approach looks fine, except for the vma_policy(vma) -> old change
> already spotted by Aneesh.

This shouldn't have any real effect on the functionality. Anyway, here
is a follow up cleanup:
---