From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1945955AbcHRMXu (ORCPT ); Thu, 18 Aug 2016 08:23:50 -0400 Received: from mx2.suse.de ([195.135.220.15]:56480 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751627AbcHRMXt (ORCPT ); Thu, 18 Aug 2016 08:23:49 -0400 Subject: Re: [PATCH v6 05/11] mm, compaction: add the ultimate direct compaction priority To: Joonsoo Kim References: <20160810091226.6709-1-vbabka@suse.cz> <20160810091226.6709-6-vbabka@suse.cz> <20160816055857.GB17448@js1304-P5Q-DELUXE> Cc: Andrew Morton , Michal Hocko , Mel Gorman , David Rientjes , Rik van Riel , linux-mm@kvack.org, linux-kernel@vger.kernel.org From: Vlastimil Babka Message-ID: Date: Thu, 18 Aug 2016 14:23:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: <20160816055857.GB17448@js1304-P5Q-DELUXE> 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 08/16/2016 07:58 AM, Joonsoo Kim wrote: >> --- a/mm/compaction.c >> +++ b/mm/compaction.c >> @@ -1644,6 +1644,8 @@ static enum compact_result compact_zone_order(struct zone *zone, int order, >> .alloc_flags = alloc_flags, >> .classzone_idx = classzone_idx, >> .direct_compaction = true, >> + .whole_zone = (prio == COMPACT_PRIO_SYNC_FULL), >> + .ignore_skip_hint = (prio == COMPACT_PRIO_SYNC_FULL) >> }; >> INIT_LIST_HEAD(&cc.freepages); >> INIT_LIST_HEAD(&cc.migratepages); >> @@ -1689,7 +1691,8 @@ enum compact_result try_to_compact_pages(gfp_t gfp_mask, unsigned int order, >> ac->nodemask) { >> enum compact_result status; >> >> - if (compaction_deferred(zone, order)) { >> + if (prio > COMPACT_PRIO_SYNC_FULL >> + && compaction_deferred(zone, order)) { >> rc = max_t(enum compact_result, COMPACT_DEFERRED, rc); >> continue; > > Could we provide prio to compaction_deferred() and do the decision in > that that function? > > BTW, in kcompactd, compaction_deferred() is checked but > .ignore_skip_hint=true. Is there any reason? If we can remove > compaction_deferred() for kcompactd, we can check .ignore_skip_hint > to determine if defer is needed or not. I don't want to change kcompactd right now, as the current series seems to help against premature OOMs. But I'll revisit it later. Thanks.