Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1926073rwr; Fri, 28 Apr 2023 03:57:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6bgpCxfasKtfAvXMWPTP4CSt5wTycEbYmhzQhfs8ML6ZROZLKLLJvMEbm3HtmgD4U9VDmF X-Received: by 2002:a17:90a:9602:b0:234:ba34:71bf with SMTP id v2-20020a17090a960200b00234ba3471bfmr5067891pjo.1.1682679450149; Fri, 28 Apr 2023 03:57:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682679450; cv=none; d=google.com; s=arc-20160816; b=Wlq0mpVQPLmJqjybvMTGL+coE+iMvAhK1xmoUBv2Lu1scmwJlNHyq7sXAi4N8LZe6H CeWl61TU0Ni5uZr+4vXok9SlGd/Yhmex/h0tvZTDzuDxSF/poc9FlL08otScZZIllVsF oXPID8r+4REwT4jV7/IxK6YeRydyiMDsyiU18u5RYqPmr0nPW1jyzJcRoG47j2N03xhT 8vL8stOT9IR7TGoXLsq/s1HaBbjF4hGzU3Ff4BC4evPcAdXNQ7TvpEq99ixrDtItEtYA tlNRmt0i4izgMu9WcGM9F6+6vTNhzWLHdOhbReY0wbra2eBaiRuZt2eNr2ldVzSCVaYh CU1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=/JyNkif/SOknKBP5GvnwBgP2yE+8okMXm07sjMJqPXU=; b=difjyxG8Yeq0rQfVIH2HwUT8g/GYt9CyxdeBaCa+JyN9kuJOPhCVTCUJzpNpmZyxSM iyKiF9u2dvG23JRbvz2LL1XUW/oKpK9Xti9EnRJRaOfrj2TH7n5HZF/5XvTTjuxYLNKk jl96+jZ2k0NzTJM1OcDq2FecsoEpF9qW7OnaciDWMilckGmv/bisBqq4p43KYLSsuD7L s971/tWKtXkzYYDlByB7O6HU+Dz3Z4HQUGmLE4dzfQjv+DZA4fVFDSz9Ruyo1cACsHBv hAiyubrZfoOUVDjiUqYARMcQJFvBIFqqnbtas4SY+X0glLQ5gsR+FPeJJ3jXo4bEx8q8 EKqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ft5-20020a17090b0f8500b002478f3a1cbcsi1906156pjb.135.2023.04.28.03.57.15; Fri, 28 Apr 2023 03:57:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345458AbjD1Kl5 (ORCPT + 99 others); Fri, 28 Apr 2023 06:41:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230106AbjD1Kl4 (ORCPT ); Fri, 28 Apr 2023 06:41:56 -0400 Received: from outbound-smtp36.blacknight.com (outbound-smtp36.blacknight.com [46.22.139.219]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E10C3CD for ; Fri, 28 Apr 2023 03:41:54 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp36.blacknight.com (Postfix) with ESMTPS id 1E9B923E1 for ; Fri, 28 Apr 2023 11:41:53 +0100 (IST) Received: (qmail 32649 invoked from network); 28 Apr 2023 10:41:52 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.21.103]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 28 Apr 2023 10:41:52 -0000 Date: Fri, 28 Apr 2023 11:41:51 +0100 From: Mel Gorman To: Johannes Weiner Cc: linux-mm@kvack.org, Kaiyang Zhao , Vlastimil Babka , David Rientjes , linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [RFC PATCH 10/26] mm: page_alloc: allow compaction capturing from larger blocks Message-ID: <20230428104151.tau2mru65rdsisyg@techsingularity.net> References: <20230418191313.268131-1-hannes@cmpxchg.org> <20230418191313.268131-11-hannes@cmpxchg.org> <20230421141447.2cw5cfwibb7jxf6n@techsingularity.net> <20230425154026.GC17132@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20230425154026.GC17132@cmpxchg.org> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 25, 2023 at 11:40:26AM -0400, Johannes Weiner wrote: > On Fri, Apr 21, 2023 at 03:14:47PM +0100, Mel Gorman wrote: > > On Tue, Apr 18, 2023 at 03:12:57PM -0400, Johannes Weiner wrote: > > > Currently, capturing only works on matching orders and matching > > > migratetypes. However, if capturing is initially skipped on the > > > migratetype, it's possible that merging continues up to a full > > > pageblock, in which case the migratetype is up for grabs again. > > > > > > Allow capturing to grab smaller chunks from claimed pageblocks, and > > > expand the remainder of the block back onto the freelists. > > > > > > Signed-off-by: Johannes Weiner > > > > No objections other than we're still in the preparation phase and the > > series needs to be split. Out of curiousity, how often does this actually > > trigger in practice? I ask because superficially, I would expect capture to > > happen while pages are being merged and I'm not sure how much this actually > > helps. If anything the anomaly would be merging !MOVABLE types, capturing > > one pageblock and leaving the adjacent block eligible for splitting as > > UNMOVABLE/RECLAIMABLE which is not necessarily desirable. > > Looking at this patch independently, once merging continues to the > full block, a fallback would be allowed to claim it anyway > (can_steal_fallback() returns true). I don't quite see a downside > letting capture apply in this case. The plus is of course avoiding the > indirection through the freelist which risks an opportunist request of > a smaller order fragmenting the block and wasting the contiguity work. > > In the context of the full series, this becomes even more > important. Once watermarks are required to be met in MIGRATE_FREE > blocks, and reclaim/compaction recycle full blocks, merging up to > pageblock_order happens all the time - and needs to happen for > allocations to succeed. This applies to all types of direct reclaim: > unmovable request freeing reclaimable/movable blocks, reclaimable > freeing movable blocks, movable freeing reclaimable blocks. > > I see your point about smaller orders now always ending the merge at > the pageblock, even when there could be additional merging > opportunities beyond. However, I'm not sure these accidental larger > merges beyond what's needed to fulfill the request at hand are a > preferable aspect over reclaimer fairness, and thus ultimately the > reliability of orders up to the pageblock size. > > I'll try to get some numbers for this patch independently, though. > This should manifest in p99 allocation latencies and near-OOM > behavior. Is there anything else you'd want me to look for? > Any major change in the number of the mm_page_alloc_extfrag trace event triggering. Also put the patch at the end of the preparation series of possible or even do it as a separate follow-up patch after the bulk of the series has been handled. While I cannot 100% convince myself either way, I wonder if variable high-order allocation requests smaller than a pageblock could cause premature mixing due to capture. -- Mel Gorman SUSE Labs