On Thu 08-11-18 09:12:04, Wei Yang wrote: > for_each_zone_zonelist() iterates the zonelist one by one, which means > it will iterate on zones on the same node. While get_partial_node() > checks available slab on node base instead of zone. > > This patch skip a node in case get_partial_node() fails to acquire slab > on that node. If this is an optimization then it should be accompanied by some numbers. > @@ -1882,6 +1882,9 @@ static void *get_any_partial(struct kmem_cache *s, gfp_t flags, > enum zone_type high_zoneidx = gfp_zone(flags); > void *object; > unsigned int cpuset_mems_cookie; > + nodemask_t nmask = node_states[N_MEMORY]; This will allocate a large bitmask on the stack and that is no-go for something that might be called from a potentially deep call stack already. Also are you sure that the micro-optimization offsets the copying overhead? -- Michal Hocko SUSE Labs