Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751543AbcDRTO1 (ORCPT ); Mon, 18 Apr 2016 15:14:27 -0400 Received: from mx2.suse.de ([195.135.220.15]:54057 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750717AbcDRTO0 (ORCPT ); Mon, 18 Apr 2016 15:14:26 -0400 Subject: Re: mmotm woes, mainly compaction To: Hugh Dickins , Michal Hocko References: <20160412121020.GC10771@dhcp22.suse.cz> <571026CA.6000708@suse.cz> Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org From: Vlastimil Babka Message-ID: <57153205.4050406@suse.cz> Date: Mon, 18 Apr 2016 15:14:13 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <571026CA.6000708@suse.cz> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 769 Lines: 18 On 04/14/2016 07:24 PM, Vlastimil Babka wrote: >> > @@ -1459,8 +1459,8 @@ static enum compact_result compact_zone( >> > zone->compact_cached_migrate_pfn[1] = cc->migrate_pfn; >> > } >> > >> > - if (cc->migrate_pfn == start_pfn) >> > - cc->whole_zone = true; >> > + cc->whole_zone = cc->migrate_pfn == start_pfn && >> > + cc->free_pfn == pageblock_start_pfn(end_pfn - 1); >> > >> > cc->last_migrated_pfn = 0; > This would be for Michal, but I agree. So there's an alternative here that wouldn't have the danger of missing cc->whole_zone multiple time due to races. When resetting either one scanner to zone boundary, reset the other as well (and set cc->whole_zone). I think the situations, where not doing that have any (performance) advantage, are rare.