Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp842868lqs; Tue, 5 Mar 2024 20:17:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXa5SlKSGffmgQtHD/XoRBGpp/KqBcyeoFYlEP6snuLytebZotgY9GibdDsVaiTMpnbkIzRCmzyQRL92isSDum0vzPWmz6ykNndWZE6qw== X-Google-Smtp-Source: AGHT+IFezhqPtBCSNlVgY0909cylzi4QWHE5yLdTxU5Jv5Tce6PatfX/GAS7G9YfZ3KFX6ju0ZRT X-Received: by 2002:a05:620a:5373:b0:788:332d:6f7e with SMTP id op51-20020a05620a537300b00788332d6f7emr3997655qkn.39.1709698637001; Tue, 05 Mar 2024 20:17:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709698636; cv=pass; d=google.com; s=arc-20160816; b=QC6w0WVZb+XabBrvKfNi3g5Tf3Pt/EXButiqET54dszDq72dTjzrG+XRYM5NmcFmxP VwK0c24XT+0luhPjaknBh2pveppEUGd+mrwXI/N+bK6eIrjKzwku4RB2QmZF3Ls2KT51 R5MXxMc02phHBKXd0dbjt/JWCDD52FLSlXZcXH87IWmW7KcngN0NjtgFCZkXrgN+ACa9 kaKW47Ps86Bz7OlJltGBfhqeuiAPzqHdVXC/ad+g2KLleRbMffHgj5Jeyg9bFh6UyA0L 0y7jmVY/eT+DZ6kQJOhjRg7bsI8rn9Y+rt3i9JPQuTgz8O8WuBLNPF94jMF5Znz+Fk7F 1AAA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=lMSYidS0AoPvbN6qA3im2YqpbK/tNkyrqR1A6eq5TWE=; fh=q0Q+QU6pliKDmwMtyjq1YYK9OBuWckRyc2khpb6v70A=; b=QviQVhTT0GUVJufd2GZKAp0lfeiP0B4/PTQC7CQ61+72wUipaLmbqzdKxmlZegmaAr U1BT95z2up8/kDJ9rARdOgL5In+4nuY3EBC5TXuTR9OujBSdhws9x8jnmnd9VCHmoIpd Ljz7iXWuuL1TVkRpRpLWMFM8hPb4bkH/aaOyjxtpJ1jZdg5hXDX1f/yHy2ekPgZAxt5R 8DhZomIl1zsM8EI+YHX+F3jhiA22NT50M/v2sO+eWpR50ErFG1J9taNeJN3NkuYYpNa3 nCqrVW7Mh0jHC5YxbomjjOcjLJ7v9r6jSoMQoD+A8d2oxk/cjuxznVFZaXJRlvNW3BXh L+NA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=osC0Pz2d; arc=pass (i=1 spf=pass spfdomain=cmpxchg.org dkim=pass dkdomain=cmpxchg-org.20230601.gappssmtp.com dmarc=pass fromdomain=cmpxchg.org); spf=pass (google.com: domain of linux-kernel+bounces-93316-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93316-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id x25-20020a05620a099900b0078841157549si38442qkx.214.2024.03.05.20.17.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 20:17:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93316-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=osC0Pz2d; arc=pass (i=1 spf=pass spfdomain=cmpxchg.org dkim=pass dkdomain=cmpxchg-org.20230601.gappssmtp.com dmarc=pass fromdomain=cmpxchg.org); spf=pass (google.com: domain of linux-kernel+bounces-93316-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93316-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B72EE1C21C4D for ; Wed, 6 Mar 2024 04:17:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C37C41BC58; Wed, 6 Mar 2024 04:16:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg-org.20230601.gappssmtp.com header.i=@cmpxchg-org.20230601.gappssmtp.com header.b="osC0Pz2d" Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A0611B7F4 for ; Wed, 6 Mar 2024 04:16:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709698589; cv=none; b=o2vddB81f9kAdvxTbvQPblaVFDeqwu65S2m5dgS2ByfoRJOYNjGGHjdLFevShWY5j3cStF4KyYTUvZpSr/dp5b5yFkMfU9JhzKlcmqsoTTcoaAPLdK0ufWW2hqIJyUA1UKdW8fhJeelnRJW7RpwArRRLH5aVQRzCNzL3qDEeT1g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709698589; c=relaxed/simple; bh=+JHXx6ynyL2ZO6AiZlsNsjrA8WaiDujGEqbRHEUnIHo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NqHobAh1XYldc7ifgrhE9kkpaoJ2UXCZUQ9clhcmO5/ivH+Q7pV3lAA3vZnmpKYC+DXp9/I+Wzb/7PtOo/HhtXVFzfhbf07mKz1vOALa9lCM7NGsQlAoErMopD9LJSId2j+IsF9GTrFQ9jsPehYzW97dYVWPqL8bDTumVprlHdc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org; spf=pass smtp.mailfrom=cmpxchg.org; dkim=pass (2048-bit key) header.d=cmpxchg-org.20230601.gappssmtp.com header.i=@cmpxchg-org.20230601.gappssmtp.com header.b=osC0Pz2d; arc=none smtp.client-ip=209.85.222.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmpxchg.org Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-781753f52afso447909485a.2 for ; Tue, 05 Mar 2024 20:16:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20230601.gappssmtp.com; s=20230601; t=1709698585; x=1710303385; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lMSYidS0AoPvbN6qA3im2YqpbK/tNkyrqR1A6eq5TWE=; b=osC0Pz2d5m9LFN+AfLgInEe6IN6RVaOvP1iZhP0UIDwEXGTpSeXmk8UJo5bvO0b+Vc SFAOoIcj1x503U6BKwjBo8tGNpHLHX6hiFmQ18NylIT7hhd4881ryVMgtQyBGz3m8Ll5 QEIQwWNlKQuakOfdInnOjlh5XKYuGWSe4pTyeSaSWBC5VfRH7A+FqgoAzdqcxK0b/O4J mc0ocauJNjq6MERG4wzORuZdUGNybXYSstw5fVrPmRZnaulYXBgIN2tWfKTr0niSdT/m VsCMzliQSe4h62P6xULpHvl+Czu7uaM8fD6kNyNm+cqyoop/wbKe5v2y7YGf9Ubh0ak8 J4xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709698585; x=1710303385; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lMSYidS0AoPvbN6qA3im2YqpbK/tNkyrqR1A6eq5TWE=; b=ZyNlu0nuGewq9WdC7BSc4m1noHrUaknPch0e9oN45q8oK/OqunmBjz03WFyipCgLvE e1C/RNCqto9mUb+Z33F1S5lmeN5b8vTmZagHZdOQ1v7eXdjxLwYVZGvdX0RSkk5dmMJT UUNiVMyBPLSt000fURZ2Kz4LrQU9DrEOEaEvfTrwfBqNoPeEAPBrQR4aI45DolqBpQR3 SpVwVDipHWFQasrSKaiS0hPK4U5x5BysUhScECRz2OLKp0gJ5xtfU3mwymAtFO+OA3kc ZQdWg2Dmr63S8ddlNwcp5lpbzyzlajjqF93NTU87BHVJ3q32V6Ng02//7AH9RavdHta0 AxeA== X-Forwarded-Encrypted: i=1; AJvYcCVU0yFG8aL76BUPa2WGpYF5WGWrGQEonsBAbgKJL3GKgZv1/r3BQ2/UC0zHYVEeHgLIpqG1tSFoazuUuWYjXdif/7CJ0PqdCR+mWzyU X-Gm-Message-State: AOJu0YxrYFPZljmWdxJnfJRb0s20CVLh8UHiJSvzrOikOnq2Rx2FI2O7 PdJpi7G9Wmtl9zk5wOv+3YfKWngDilP43Fa0xfy8KCqj8adgVXd6BgHEAttTKk8= X-Received: by 2002:a05:620a:389b:b0:788:1f51:5822 with SMTP id qp27-20020a05620a389b00b007881f515822mr3895540qkn.40.1709698585227; Tue, 05 Mar 2024 20:16:25 -0800 (PST) Received: from localhost (2603-7000-0c01-2716-da5e-d3ff-fee7-26e7.res6.spectrum.com. [2603:7000:c01:2716:da5e:d3ff:fee7:26e7]) by smtp.gmail.com with ESMTPSA id 19-20020a05620a04d300b0078838c7acbfsm984096qks.42.2024.03.05.20.16.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 20:16:24 -0800 (PST) From: Johannes Weiner To: Andrew Morton Cc: Vlastimil Babka , Mel Gorman , Zi Yan , Mike Kravetz , "Huang, Ying" , David Hildenbrand , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/10] mm: page_alloc: move free pages when converting block during isolation Date: Tue, 5 Mar 2024 23:08:35 -0500 Message-ID: <20240306041526.892167-5-hannes@cmpxchg.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240306041526.892167-1-hannes@cmpxchg.org> References: <20240306041526.892167-1-hannes@cmpxchg.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When claiming a block during compaction isolation, move any remaining free pages to the correct freelists as well, instead of stranding them on the wrong list. Otherwise, this encourages incompatible page mixing down the line, and thus long-term fragmentation. Reviewed-by: Zi Yan Reviewed-by: Vlastimil Babka Acked-by: Mel Gorman Tested-by: "Huang, Ying" Signed-off-by: Johannes Weiner --- mm/page_alloc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 3f9ea4c392d5..0f385531e130 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2666,9 +2666,12 @@ int __isolate_free_page(struct page *page, unsigned int order) * Only change normal pageblocks (i.e., they can merge * with others) */ - if (migratetype_is_mergeable(mt)) + if (migratetype_is_mergeable(mt)) { set_pageblock_migratetype(page, MIGRATE_MOVABLE); + move_freepages_block(zone, page, + MIGRATE_MOVABLE, NULL); + } } } -- 2.44.0