Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3808029rdb; Thu, 14 Sep 2023 03:23:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEcdzi8hMvT0Vx1Ql1K0y3qF7vap0glWwM+h05O8MDK/f5S5DGJjv7fRUNsCUkQeOZp21aP X-Received: by 2002:a17:902:ecc4:b0:1bd:c7e2:462 with SMTP id a4-20020a170902ecc400b001bdc7e20462mr6115186plh.11.1694686983116; Thu, 14 Sep 2023 03:23:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694686983; cv=none; d=google.com; s=arc-20160816; b=trK+8G4z15j6ZrN4zcgyPz76tgSU8cLwo1oXE2cHWzETIHBQr6BzUVn9LxmPWnx5sK SBNnofwZdtYZe/Qaj2Uk2Ws5DyNscccrX1CSL7+/8Md6s2ZfwhthZnc7DGlieVh2HaiN YkZNOW+5unhTq3L9+jp5iR+zSeJxvXHVw2jZCSPlMQ/+XcNTEqCVg8Y6NS8m6cH0rwPn kAbU4UKGVm6BY69gvZtY0puDvjp84WVeK0LcmqaA8vZMh/I67oRjWVFSVXpfABegh56G bN1mEU3Z+ZlGYLmj+aX5qeP6u4F+D1SIphUfS5VSpQzXxsVad6D2NYax9RhxJ28c038I 5pvw== 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=EAUkN1Pw+pq6Ko844kyig9SASvYWwohXQlPNofRWBVs=; fh=P2xRvT/3gU4jeRPimgVadHxT1tx11QhdMtS7UZmJd28=; b=KmEi4FnXO1mm8KyDp7cTaC4SLlI+UgI+z6VNwTF1xunMGuXS82eDhcF9gN+LHaNs2x LAe92KRanp54/vIBE0kL6gDRce4rtYiCcam98OLYkj97VO7xityAlKEM3bbdIl/7NcfO AD2aRNOTxxBTq+pThF5bl4whz9Ewa9jBtJdjNqMSTnNpHIJ2Y26nwvg80j+6hSOEeagj FwS4gLtmff2oqE0G1/5ogFcBA/0V7XY+iA0/5J8BxuPTinjMKjBS2smevFM/gEw7/zAP Ulj846Wn/7QFdJhML4YSnMQidLbDWmQNDF4lhX2qVJNI53cqtnczpcmave7P+e9cw4/3 vPsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id z8-20020a1709027e8800b001c4155c310csi650056pla.94.2023.09.14.03.23.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 03:23:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 5066680D6A13; Thu, 14 Sep 2023 03:00:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237501AbjINKAl (ORCPT + 99 others); Thu, 14 Sep 2023 06:00:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233151AbjINKAk (ORCPT ); Thu, 14 Sep 2023 06:00:40 -0400 Received: from outbound-smtp40.blacknight.com (outbound-smtp40.blacknight.com [46.22.139.223]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C9D8B3 for ; Thu, 14 Sep 2023 03:00:35 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp40.blacknight.com (Postfix) with ESMTPS id 3AAE91C3F00 for ; Thu, 14 Sep 2023 11:00:34 +0100 (IST) Received: (qmail 14551 invoked from network); 14 Sep 2023 10:00:34 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.197.19]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 14 Sep 2023 10:00:34 -0000 Date: Thu, 14 Sep 2023 11:00:29 +0100 From: Mel Gorman To: Johannes Weiner Cc: Andrew Morton , Vlastimil Babka , Miaohe Lin , Kefeng Wang , Zi Yan , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/6] mm: page_alloc: fix up block types when merging compatible blocks Message-ID: <20230914100029.eyb45y45jei2md3h@techsingularity.net> References: <20230911195023.247694-1-hannes@cmpxchg.org> <20230911195023.247694-3-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20230911195023.247694-3-hannes@cmpxchg.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 14 Sep 2023 03:00:42 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email On Mon, Sep 11, 2023 at 03:41:43PM -0400, Johannes Weiner wrote: > The buddy allocator coalesces compatible blocks during freeing, but it > doesn't update the types of the subblocks to match. When an allocation > later breaks the chunk down again, its pieces will be put on freelists > of the wrong type. This encourages incompatible page mixing (ask for > one type, get another), and thus long-term fragmentation. > > Update the subblocks when merging a larger chunk, such that a later > expand() will maintain freelist type hygiene. > > v2: > - remove spurious change_pageblock_range() move (Zi Yan) > > Signed-off-by: Johannes Weiner I'm not 100% convinced on the amount of harm this causes but given that it's a relatively rare condition, I didn't think about the consequences too deeply. The patch certainly has merit so; Acked-by: Mel Gorman -- Mel Gorman SUSE Labs