Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2327493rwr; Fri, 21 Apr 2023 07:29:33 -0700 (PDT) X-Google-Smtp-Source: AKy350b9nAStsY4ZDWHcD1/9gdbJq4j7tQxL9C6GUHnFunEKdQfIFyz+esw3a+UivwIihuT0Nfwx X-Received: by 2002:a17:90a:1a01:b0:24b:5ebd:56c3 with SMTP id 1-20020a17090a1a0100b0024b5ebd56c3mr2979630pjk.2.1682087372659; Fri, 21 Apr 2023 07:29:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682087372; cv=none; d=google.com; s=arc-20160816; b=LSQog7v8rTsntZqX5d2I0H/XiNQBWZvExJUxiW84MEhA3Kx72EWfz8SoJx+CLcUJRi uoRryJjuKUYpncyqAIq486YEGDtCH3ppTfUqsMlxp/jjVte4+1cFkJ9Bt8kVdWCQhpxU f1dUkluPzpMArq6UkyKWv+7dJNvT+Cvnp9EyUFrMy50O4Fzi7boh5QpXPexR1ktR3bpC ttX3+OZrEdlUeU53LvJaxzaaLBWW/nqyF3uw2ThoncqkTUxDmmUPTSK6/yJA2TfB2tbf Hf6T9weEpG6nshs/THV0wDI70c18DBotjvalobmSgDQO53QZtgI4hBZm4Q7XPpW78wCe SXmw== 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=uJgmwi6CLy7OLgvss4fEbaV4lxael9UvdHnJqigVC1M=; b=hOJ9mEAhLpACjBc5MJEYUX4Z4WeZMJ8C770LAGkOe0x/E5p483/TrXDM+HuzADGPab v7ozDldfUEeaUniXYpdRpx4CXa8eQEXqnlgVs4qurrFu8Zxg1j2puFdrCto19kNKDLA5 3nQjLxOktc2diFP+U1rJ0kAj/KnsEF3HZq8SHMm9AVdY8dE70LlWAXgOgH2VwZ0x+I9H ztdszW+gUHWnD5Zp2veL2FDCeg4Ir9jyPACxWugTH1wrQkV3auKbeq8NK8WI+Yp+iAKq jlVNnHNdvYHWMRlpl1mhKDSJar2NlEs3GqtA3IIaGFMeQKu3futLsucih0diEo5N6DsS rTZQ== 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 oj17-20020a17090b4d9100b002372f2c4d9dsi1830146pjb.44.2023.04.21.07.29.19; Fri, 21 Apr 2023 07:29:32 -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 S232071AbjDUOZw (ORCPT + 99 others); Fri, 21 Apr 2023 10:25:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232411AbjDUOZr (ORCPT ); Fri, 21 Apr 2023 10:25:47 -0400 Received: from outbound-smtp17.blacknight.com (outbound-smtp17.blacknight.com [46.22.139.234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDCDD19B2 for ; Fri, 21 Apr 2023 07:25:37 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp17.blacknight.com (Postfix) with ESMTPS id 876811C3F8B for ; Fri, 21 Apr 2023 15:25:36 +0100 (IST) Received: (qmail 13269 invoked from network); 21 Apr 2023 14:25:36 -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); 21 Apr 2023 14:25:36 -0000 Date: Fri, 21 Apr 2023 15:25:33 +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 11/26] mm: page_alloc: introduce MIGRATE_FREE Message-ID: <20230421142533.nm44wkmh3wkudlqn@techsingularity.net> References: <20230418191313.268131-1-hannes@cmpxchg.org> <20230418191313.268131-12-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20230418191313.268131-12-hannes@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 18, 2023 at 03:12:58PM -0400, Johannes Weiner wrote: > To cut down on type mixing, put empty pageblocks on separate freelists > and make them the first fallback preference before stealing space from > incompatible blocks. > > The neutral block designation will also be handy in subsequent patches > that: simplify compaction; add per-mt freelist counts and make > compaction_suitable() more precise; and ultimately make pageblocks the > basis of free memory management. > This patch is a line in the sand for the series. Patches 1-10 can stand alone with supporting data because this is the first major change that has a material impact on fragmentation avoidance and its overhead. Maybe there is something in the later patches that makes the need for this patch more obvious but putting the empty pageblocks on separate freelists is not that helpful in itself. The main problem is that __rmqueue() starts with __rmqueue_smallest which for huge pages is probably fine because it searches first for free pageblocks, but it's not for SLUB high-order allocations because __rmqueue_smallest for orders < pageblock_order encourages mixing. Obviously it would also not be fine for contiguous page allocations for page cache or anything else that is planned. If nothing else, this patch highlights that fragmentation avoidance was originally focused on huge pages which was fine at the time, but not any longer. The need for MIGRATE_FREE type could potentially be avoided by having __rmqueue() start with __rmqueue_smallest(order == pageblock_order) to encourage full block usage first before mixing. -- Mel Gorman SUSE Labs