Re: [BUGFIX][PATCH] oom-kill: fix NUMA consraint check with nodemask v3

From: KOSAKI Motohiro
Date: Tue Nov 10 2009 - 21:37:17 EST


> From: KAMEZAWA Hiroyuki <kamezawa.hioryu@xxxxxxxxxxxxxx>
>
> Fixing node-oriented allocation handling in oom-kill.c
> I myself think this as bugfix not as ehnancement.
>
> In these days, things are changed as
> - alloc_pages() eats nodemask as its arguments, __alloc_pages_nodemask().
> - mempolicy don't maintain its own private zonelists.
> (And cpuset doesn't use nodemask for __alloc_pages_nodemask())
>
> But, current oom-killer's doesn't handle nodemask and it's wrong.
>
> This patch does
> - check nodemask, if nodemask && nodemask doesn't cover all
> node_states[N_HIGH_MEMORY], this is CONSTRAINT_MEMORY_POLICY.
> - Scan all zonelist under nodemask, if it hits cpuset's wall
> this faiulre is from cpuset.
> And
> - modifies the caller of out_of_memory not to call oom if __GFP_THISNODE.
> This doesn't change "current" behavior.
> If callers use __GFP_THISNODE, it should handle "page allocation failure"
> by itself.
>
> Changelog: 2009/11/11
> - fixed nodes_equal() calculation.
> - return CONSTRAINT_MEMPOLICY always if given nodemask is not enough big.
>
> Changelog: 2009/11/06
> - fixed lack of oom.h
>
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hioryu@xxxxxxxxxxxxxx>
> ---
> drivers/char/sysrq.c | 2 +-
> include/linux/oom.h | 4 +++-
> mm/oom_kill.c | 44 ++++++++++++++++++++++++++++++++------------
> mm/page_alloc.c | 10 ++++++++--
> 4 files changed, 44 insertions(+), 16 deletions(-)
>

Looks good to me.
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx>



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/