Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932358AbdIFRVR (ORCPT ); Wed, 6 Sep 2017 13:21:17 -0400 Received: from mx2.suse.de ([195.135.220.15]:53696 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932167AbdIFRVO (ORCPT ); Wed, 6 Sep 2017 13:21:14 -0400 Date: Wed, 6 Sep 2017 19:21:10 +0200 From: Michal Hocko To: Christopher Lameter Cc: js1304@gmail.com, Andrew Morton , Pekka Enberg , David Rientjes , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mel Gorman , Vlastimil Babka , Joonsoo Kim Subject: Re: [PATCH 1/2] mm/slub: wake up kswapd for initial high order allocation Message-ID: <20170906172110.m7ag4ox34fcscg4x@dhcp22.suse.cz> References: <1504672666-19682-1-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1124 Lines: 31 On Wed 06-09-17 10:59:09, Cristopher Lameter wrote: > On Wed, 6 Sep 2017, js1304@gmail.com wrote: > > > --- a/mm/slub.c > > +++ b/mm/slub.c > > @@ -1578,8 +1578,12 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) > > * so we fall-back to the minimum order allocation. > > */ > > alloc_gfp = (flags | __GFP_NOWARN | __GFP_NORETRY) & ~__GFP_NOFAIL; > > - if ((alloc_gfp & __GFP_DIRECT_RECLAIM) && oo_order(oo) > oo_order(s->min)) > > - alloc_gfp = (alloc_gfp | __GFP_NOMEMALLOC) & ~(__GFP_RECLAIM|__GFP_NOFAIL); > > + if (oo_order(oo) > oo_order(s->min)) { > > + if (alloc_gfp & __GFP_DIRECT_RECLAIM) { > > + alloc_gfp |= __GFP_NOMEMALLOC; > > + alloc_gfp &= ~__GFP_DIRECT_RECLAIM; > > + } > > + } > > > > Can we come up with another inline function in gfp.h for this as well? What do you mean? The oo_order thing? > Well and needing these functions to manipulate flags actually indicates > that we may need a cleanup of the GFP flags at some point. There is a buch > of flags that disable things and some that enable things. Good luck with that -- Michal Hocko SUSE Labs