From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752792AbbJNIUe (ORCPT ); Wed, 14 Oct 2015 04:20:34 -0400 Received: from mga09.intel.com ([134.134.136.24]:53078 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751930AbbJNIU1 (ORCPT ); Wed, 14 Oct 2015 04:20:27 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,681,1437462000"; d="scan'208";a="826308502" Message-ID: <561E0F9B.6090305@intel.com> Date: Wed, 14 Oct 2015 16:17:31 +0800 From: Pan Xinhui User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Michal Hocko CC: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , vbabka@suse.cz, rientjes@google.com, hannes@cmpxchg.org, nasa4836@gmail.com, mgorman@suse.de, alexander.h.duyck@redhat.com, aneesh.kumar@linux.vnet.ibm.com, "yanmin_zhang@linux.intel.com" Subject: Re: [PATCH] gfp: GFP_RECLAIM_MASK should include __GFP_NO_KSWAPD References: <561DE9F3.504@intel.com> <20151014073428.GC28333@dhcp22.suse.cz> In-Reply-To: <20151014073428.GC28333@dhcp22.suse.cz> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hi, Michal thanks for your reply :) On 2015年10月14日 15:34, Michal Hocko wrote: > On Wed 14-10-15 13:36:51, Pan Xinhui wrote: >> From: Pan Xinhui >> >> GFP_RECLAIM_MASK was introduced in commit 6cb062296f73 ("Categorize GFP >> flags"). In slub subsystem, this macro controls slub's allocation >> behavior. In particular, some flags which are not in GFP_RECLAIM_MASK >> will be cleared. So when slub pass this new gfp_flag into page >> allocator, we might lost some very important flags. >> >> There are some mistakes when we introduce __GFP_NO_KSWAPD. This flag is >> used to avoid any scheduler-related codes recursive. But it seems like >> patch author forgot to add it into GFP_RECLAIM_MASK. So lets add it now. > > This is no longer needed because GFP_RECLAIM_MASK contains __GFP_RECLAIM > now - have a look at > http://lkml.kernel.org/r/1442832762-7247-7-git-send-email-mgorman%40techsingularity.net > which is sitting in the mmotm tree. > I have a look at Mel's patchset. yes, it can help fix my kswapd issue. :) So I just need change my kmalloc's gfp_flag to GFP_ATOMIC &~ __GFP_KSWAPD_RECLAIM, then slub will not wakeup kswpad. thanks xinhui >> Signed-off-by: Pan Xinhui >> --- >> include/linux/gfp.h | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/include/linux/gfp.h b/include/linux/gfp.h >> index f92cbd2..9ebad4d 100644 >> --- a/include/linux/gfp.h >> +++ b/include/linux/gfp.h >> @@ -130,7 +130,8 @@ struct vm_area_struct; >> /* Control page allocator reclaim behavior */ >> #define GFP_RECLAIM_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|\ >> __GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|\ >> - __GFP_NORETRY|__GFP_MEMALLOC|__GFP_NOMEMALLOC) >> + __GFP_NORETRY|__GFP_MEMALLOC|__GFP_NOMEMALLOC|\ >> + __GFP_NO_KSWAPD) >> >> /* Control slab gfp mask during early boot */ >> #define GFP_BOOT_MASK (__GFP_BITS_MASK & ~(__GFP_WAIT|__GFP_IO|__GFP_FS)) >> -- >> 1.9.1 >