Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2923373imm; Fri, 19 Oct 2018 01:55:38 -0700 (PDT) X-Google-Smtp-Source: ACcGV63tI8qXzfnXzZ3h0Pxv8G34g9eRCGQmXyx77uahbN/PHBdvA6UEowc/V5QkvaQaIZtwHhEq X-Received: by 2002:a17:902:8690:: with SMTP id g16-v6mr31950608plo.302.1539939338632; Fri, 19 Oct 2018 01:55:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539939338; cv=none; d=google.com; s=arc-20160816; b=o7Uqk+1KVVbmfDT9T8nz7k/CC/ARutfjmSb5r/HacxngwGghgzalnVtuNEtdrd7j1o ZCd20Ko6HrnrCEpg8zbQqR1MXb2A26uQ+suh/UpczBZdbHHF2msCRlbrRfJ1lP2mt/7Z f+aIOaW/MOxEvFR5WjABb6gl/7/4M2n97dMVrBlL5O7Aeez9shiuEJST1FK5U9CbbMp0 H7C2b+rrtiJKAABrLNNVVL1fOUHB8B11MwoUagrsqMWoSxtw88vSpVBkr5bGxULqdv4F URnFygnf3ZFNaQELtpTSypYWXgsr8Cuz/KsiAh/Q/J2cp0ULYRhoIpVJB6WAut3YQPTV Ht8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=hUqVcmU9FGSmd3eQJILHQ73dMZVTXTpT9K71FLdlvpU=; b=NgIDmhXcNgdZ+B+cVIDALpYQvlRPkRzLAslIvQVJhtmoQzzyaKm5/OoMGKP9oBESPv anzYJq20JeTYoD/I6V/f1fVJ8VJP9hNF9oaO7WE5qh1NEScPzMmW7wDhsGbJPe1fUxOy YfXTFrAE+HKpcROjAagFP+S1nUWB1aZf049Hvc96tQN2UqJEOzXNjQJx5fvVD0SxVFQU 4R4fPji9NYaLjQ6KdFab6HQ5zqSvYDWaOmyygjdea46mNU+Pk3RFl3m8x1NhC7qN74T0 6u8TROfLv7npJYswAtITnZEFlCKpYGaMnlOd3S9Uf6FQGpx84WKc6/qhf2qBcju969Xk wv2w== 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 p186-v6si20477451pfb.200.2018.10.19.01.55.23; Fri, 19 Oct 2018 01:55:38 -0700 (PDT) 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 S1727246AbeJSQ7s (ORCPT + 99 others); Fri, 19 Oct 2018 12:59:48 -0400 Received: from outbound-smtp16.blacknight.com ([46.22.139.233]:51946 "EHLO outbound-smtp16.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726609AbeJSQ7s (ORCPT ); Fri, 19 Oct 2018 12:59:48 -0400 Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp16.blacknight.com (Postfix) with ESMTPS id 40C281C23BD for ; Fri, 19 Oct 2018 09:54:37 +0100 (IST) Received: (qmail 18509 invoked from network); 19 Oct 2018 08:54:37 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[37.228.229.142]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 19 Oct 2018 08:54:37 -0000 Date: Fri, 19 Oct 2018 09:54:35 +0100 From: Mel Gorman To: Aaron Lu Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Huang Ying , Dave Hansen , Kemi Wang , Tim Chen , Andi Kleen , Michal Hocko , Vlastimil Babka , Matthew Wilcox , Daniel Jordan , Tariq Toukan , Jesper Dangaard Brouer Subject: Re: [RFC v4 PATCH 2/5] mm/__free_one_page: skip merge for order-0 page unless compaction failed Message-ID: <20181019085435.GR5819@techsingularity.net> References: <20181017063330.15384-1-aaron.lu@intel.com> <20181017063330.15384-3-aaron.lu@intel.com> <20181017104427.GJ5819@techsingularity.net> <20181017131059.GA9167@intel.com> <20181017135807.GL5819@techsingularity.net> <20181017145904.GC9167@intel.com> <20181018111632.GM5819@techsingularity.net> <20181019055703.GA2401@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20181019055703.GA2401@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 19, 2018 at 01:57:03PM +0800, Aaron Lu wrote: > > > > I don't think this is the right way of thinking about it because it's > > possible to have the system split in such a way so that the migration > > scanner only encounters unmovable pages before it meets the free scanner > > where unmerged buddies were in the higher portion of the address space. > > Yes it is possible unmerged pages are in the higher portion. > > My understanding is, when the two scanners meet, all unmerged pages will > be either used by the free scanner as migrate targets or sent to merge > by the migration scanner. > It's not guaranteed if the lower portion of the address space consisted entirely of pages that cannot migrate (because they are unmovable or because migration failed due to pins). It's actually a fundamental limitation of compaction that it can miss migration and compaction opportunities due to how the scanners are implemented. It was designed that way to avoid pageblocks being migrated unnecessarily back and forth but the downside is missed opportunities. > > You either need to keep unmerged buddies on a separate list or search > > the order-0 free list for merge candidates prior to compaction. > > > > > > It's needed to form them efficiently but excessive reclaim or writing 3 > > > > to drop_caches can also do it. Be careful of tying lazy buddy too > > > > closely to compaction. > > > > > > That's the current design of this patchset, do you see any immediate > > > problem of this? Is it that you are worried about high-order allocation > > > success rate using this design? > > > > I've pointed out what I see are the design flaws but yes, in general, I'm > > worried about the high order allocation success rate using this design, > > the reliance on compaction and the fact that the primary motivation is > > when THP is disabled. > > When THP is in use, zone lock contention is pretty much nowhere :-) > > I'll see what I can get with 'address space range' lock first and will > come back to 'lazy buddy' if it doesn't work out. Thank you and > Vlastimil for all the suggestions. My pleasure. -- Mel Gorman SUSE Labs