The patch titled Subject: mm-mempolicy-dont-handle-mpol_local-like-a-fake-mpol_preferred-policy-v4-fix has been added to the -mm tree. Its filename is mm-mempolicy-dont-handle-mpol_local-like-a-fake-mpol_preferred-policy-v4-fix.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/mm-mempolicy-dont-handle-mpol_local-like-a-fake-mpol_preferred-policy-v4-fix.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/mm-mempolicy-dont-handle-mpol_local-like-a-fake-mpol_preferred-policy-v4-fix.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Feng Tang <feng.tang@xxxxxxxxx> Subject: mm-mempolicy-dont-handle-mpol_local-like-a-fake-mpol_preferred-policy-v4-fix refine code and comments of mpol_set_nodemask(), per Michal Link: https://lkml.kernel.org/r/20210603081807.GE56979@xxxxxxxxxxxxxxxxxxxxxxx Signed-off-by: Feng Tang <feng.tang@xxxxxxxxx> Suggested-by: Michal Hocko <mhocko@xxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/mempolicy.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) --- a/mm/mempolicy.c~mm-mempolicy-dont-handle-mpol_local-like-a-fake-mpol_preferred-policy-v4-fix +++ a/mm/mempolicy.c @@ -226,11 +226,12 @@ static int mpol_set_nodemask(struct memp { int ret; - /* if mode is MPOL_DEFAULT, pol is NULL. This is right. */ - if (pol == NULL) - return 0; - - if (pol->mode == MPOL_LOCAL) + /* + * Default (pol==NULL) resp. local memory policies are not a + * subject of any remapping. They also do not need any special + * constructor. + */ + if (!pol || pol->mode == MPOL_LOCAL) return 0; /* Check N_MEMORY */ _ Patches currently in -mm which might be from feng.tang@xxxxxxxxx are mm-mempolicy-cleanup-nodemask-intersection-check-for-oom.patch mm-mempolicy-dont-handle-mpol_local-like-a-fake-mpol_preferred-policy.patch mm-mempolicy-dont-handle-mpol_local-like-a-fake-mpol_preferred-policy-v4.patch mm-mempolicy-dont-handle-mpol_local-like-a-fake-mpol_preferred-policy-v4-fix.patch mm-mempolicy-unify-the-parameter-sanity-check-for-mbind-and-set_mempolicy.patch mm-mempolicy-unify-the-parameter-sanity-check-for-mbind-and-set_mempolicy-v4.patch