From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2622C7618E for ; Fri, 21 Apr 2023 14:25:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232415AbjDUOZy (ORCPT ); Fri, 21 Apr 2023 10:25:54 -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> 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