Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3890604imu; Tue, 18 Dec 2018 05:59:57 -0800 (PST) X-Google-Smtp-Source: AFSGD/VXz0tf13lwadkMtEYHPjKjMFdoBatrSv7rFb2pfTjQNWAp9eRnV0C/4QrIodSjutu67Gfp X-Received: by 2002:a63:3d1:: with SMTP id 200mr16041463pgd.68.1545141597607; Tue, 18 Dec 2018 05:59:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545141597; cv=none; d=google.com; s=arc-20160816; b=xkXILTlwBC+f4ZSnrmI17Hkz9VJ8Xctjws/4AmpYdft2u53iLw746QBwfGrVRzYnDx H3LL+hYENsNhL0byBMJI0xRPu5cvX/YY4LbNWmtjVzuvKdqaXLDoIeOhTTAKhyuub5kg DR4BPwXnOTpz+mw22R4RD1WSLN18TcNXjAPxM3Bir5UCgLhgOhqLg1mvg7URNbWOvlj4 hw0AV0tO4EHYGB7VkVk7NMbc0KsTioMj6aBzKMYm2nKNOlvE/D/I2I/Q/D62TgBe8XPe DYbfxfxjT9BxLpvDNktNiG+uYNPMXE5xPOhDeVGUbDdClxkLk9CIKNu9sGvgiE4DaQWr MPjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:openpgp:from:references:cc:to:subject; bh=qhTw/46goYbhY9rMJx6z2n2ZOZPn7vXy9AaY5VQO0cY=; b=kiij3Y7e+aCB8AUwhCL6RST3361hd4DI1SWew37V7h8OiqpLGqDdeHdWBjYYvcJsVX gB9xnsjXKrwua7JULJ9mk/Z1Hr5M69164yOj15sh9tKJVfIWjw/iGwVgaBt9djuEMXEy AhmOaFajXSCENLxPEINwlyjuu9E3HoPmh2tO51Ip87KsSOuJvuHxJgEH9zXwck4vvanA u6Q0veoMsqgcAi7NlSH3IMrV9TMhlg5WhTb6nqT4O1A1zo6+cBsLg09xqHQZSvbBD4e2 dUUpdrWV3Hq2AY3m5Mk7KBnU0kkdfOBX2y/3Snz+lKWex6Q7fnMwbRdkmAs3ElUN++Tm 2dFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4si13208673pfc.234.2018.12.18.05.59.42; Tue, 18 Dec 2018 05:59:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726818AbeLRN6g (ORCPT + 99 others); Tue, 18 Dec 2018 08:58:36 -0500 Received: from mx2.suse.de ([195.135.220.15]:47784 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726419AbeLRN6g (ORCPT ); Tue, 18 Dec 2018 08:58:36 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6BD05B104; Tue, 18 Dec 2018 13:58:34 +0000 (UTC) Subject: Re: [PATCH 09/14] mm, compaction: Ignore the fragmentation avoidance boost for isolation and compaction To: Mel Gorman Cc: Linux-MM , David Rientjes , Andrea Arcangeli , Linus Torvalds , Michal Hocko , ying.huang@intel.com, kirill@shutemov.name, Andrew Morton , Linux List Kernel Mailing References: <20181214230310.572-1-mgorman@techsingularity.net> <20181214230310.572-10-mgorman@techsingularity.net> <20181218135156.GK29005@techsingularity.net> From: Vlastimil Babka Openpgp: preference=signencrypt Message-ID: Date: Tue, 18 Dec 2018 14:58:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: <20181218135156.GK29005@techsingularity.net> Content-Type: text/plain; charset=iso-8859-15 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/18/18 2:51 PM, Mel Gorman wrote: > On Tue, Dec 18, 2018 at 01:36:42PM +0100, Vlastimil Babka wrote: >> On 12/15/18 12:03 AM, Mel Gorman wrote: >>> When pageblocks get fragmented, watermarks are artifically boosted to pages >>> are reclaimed to avoid further fragmentation events. However, compaction >>> is often either fragmentation-neutral or moving movable pages away from >>> unmovable/reclaimable pages. As the actual watermarks are preserved, >>> allow compaction to ignore the boost factor. >> >> Right, I should have realized that when reviewing the boost patch. I >> think it would be useful to do the same change in >> __compaction_suitable() as well. Compaction has its own "gap". >> > > That gap is somewhat static though so I'm a bit more wary of it. However, Well, watermark boost is dynamic, but based on allocations stealing from other migratetypes, not reflecting compaction chances of success. > the check in __isolate_free_page looks too agressive. We isolate in > units of COMPACT_CLUSTER_MAX yet the watermark check there is based on > the allocation request. That means for THP that we check if 512 pages > can be allocated when only somewhere between 1 and 32 is needed for that > compaction cycle to complete. Adjusting that might be more appropriate? AFAIU the code in __isolate_free_page() reflects that if there's less than 512 free pages gap, we might form a high-order page for THP but won't be able to allocate it afterwards due to watermark.