From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752614AbcJJGkU (ORCPT ); Mon, 10 Oct 2016 02:40:20 -0400 Received: from mx2.suse.de ([195.135.220.15]:44940 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752377AbcJJGkT (ORCPT ); Mon, 10 Oct 2016 02:40:19 -0400 Subject: Re: [PATCH] mm: init gfp mask in kcompactd_do_work() To: Xishi Qiu , Andrew Morton , Mel Gorman , Joonsoo Kim , Michal Hocko , Minchan Kim , David Rientjes , Yisheng Xie References: <57FB0C89.3040304@huawei.com> Cc: Linux MM , LKML From: Vlastimil Babka Message-ID: <982e8902-18ac-eaa2-214a-87e68ce75732@suse.cz> Date: Mon, 10 Oct 2016 08:40:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <57FB0C89.3040304@huawei.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/10/2016 05:35 AM, Xishi Qiu wrote: > We will use gfp_mask in the following path, but it's not init. > > kcompactd_do_work > compact_zone > gfpflags_to_migratetype > > However if not init, gfp_mask is always 0, and the result of > gfpflags_to_migratetype(0) and gfpflags_to_migratetype(GFP_KERNEL) > are the same, but it's a little confusion, so init it first. Michal already did this as part of his patch, as it was needed to avoid wrongly restricting kcompactd to anonymous pages: http://lkml.kernel.org/r/<20161007065019.GA18439@dhcp22.suse.cz> > Signed-off-by: Xishi Qiu > --- > mm/compaction.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/compaction.c b/mm/compaction.c > index 9affb29..4b9a9d1 100644 > --- a/mm/compaction.c > +++ b/mm/compaction.c > @@ -1895,10 +1895,10 @@ static void kcompactd_do_work(pg_data_t *pgdat) > struct zone *zone; > struct compact_control cc = { > .order = pgdat->kcompactd_max_order, > + .gfp_mask = GFP_KERNEL, > .classzone_idx = pgdat->kcompactd_classzone_idx, > .mode = MIGRATE_SYNC_LIGHT, > .ignore_skip_hint = true, > - > }; > bool success = false; > >