Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1693102lqt; Wed, 20 Mar 2024 11:05:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX4v8fGES0+h6cHpjpWVNWTiVuKc3HlWL+m/IbXa4PBEuCib85GhUb1QK4tOADFHEazX8Y6ymuTkF2NBpRMA9N2ymDkLDhozICXnpz6iQ== X-Google-Smtp-Source: AGHT+IH4FzcnNcoiKM8DosJqhk6QqOpSaH6j9ncy5jsRfTE9TXb4RCfty3oGJeLkOliRbCz31oK8 X-Received: by 2002:a05:6a00:9383:b0:6e7:3ec3:ae33 with SMTP id ka3-20020a056a00938300b006e73ec3ae33mr6810692pfb.20.1710957935520; Wed, 20 Mar 2024 11:05:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710957935; cv=pass; d=google.com; s=arc-20160816; b=Y4mCCnOBBHZAz6i2/sCV2xl1UFDSyX6aB9m1QS5FTsCRDyPEM2+TWfagVxKrydcSzP Ue27jyjIs6AlbGA2A12/sL/lTPv1QENB3+eHwPU6srYdF0W5C3s56Its9jrLt3e6Eg2/ 8+0NrFo/d6RQY0kH65+hTy4/tASIQFUtpmCWddUBh3PfwQecOPMcQ9YRom5oUrXX0OeP g9i7k0EfNBw2JIjDwOJLFp+kkgLciTTKqf47BmT0KLAUr5FwEGRv0unp0e2W5Co0tu9k +1r4AVS3GddgmLsZHQq5HLN0LJuqdsgPeEErG11BHoFWts93Dq9kzQkEWUAO0FzjoJSH lrhg== 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=30OLZu1BB8NMv+SdqAZeeZ3/L8O0lM0O1+2bSt3RnLI=; fh=dYsafOlduHtAzDFrVIlw1kCkKuyoVNjJq5zdGbZqMEM=; b=LrVF9AMgr41yqbP0Gcg3rs/c+AtruCfDhQETgNT8TnRfVks8itaq8RySaIccDRMyis u0I3BnoP9A8ZBa34ZXHJgDQxSUW1bXCjurSp0ozeGFxE3gU0DGcQADBOfab67PeOGeYN coOR9h3doDIamhevyTEe8mSk99Q/BktM5ZNJ9U1gzR9fusc78OtK7R/+RGWf4KpZoUhj 9++v/Hng2Yys4933ATneDorMArapxnQipblxU663NF60D6QPIAdANKpMNL+Fj9dwSR15 cq9mkXe4cL9z/KR9JisZQjwSYYyiKESfPhU09HY3ftBIXzUyK6ZfduzF/VsjIPRi62M8 fTxA==; 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=oeqi0EEe; 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-109278-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109278-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 38-20020a631866000000b005e3cdf125easi12662585pgy.612.2024.03.20.11.05.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 11:05:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-109278-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=oeqi0EEe; 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-109278-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109278-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6185E281564 for ; Wed, 20 Mar 2024 18:05:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D922A6E5FB; Wed, 20 Mar 2024 18:05:00 +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="oeqi0EEe" Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) (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 F27016AFA9 for ; Wed, 20 Mar 2024 18:04:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710957899; cv=none; b=VsDaJteBYGh2Zw6xw6/nSWcl7bRMhot7F4Vexoo2MVPFvsYpnBwpO3IHpw1yZk2y348kdCRm+Vm9gdjfWhLuFQKECAbbj9tC+96Rk0u/xqmJI2w0EalnA6V10vzMjwJ1nqeL0sIW+1IMEgL8F92vAcej6pF2b4tK5Cc5ecrxsyA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710957899; c=relaxed/simple; bh=chh7+4ighc5NuwdQQeGKX+BZyp9DPW+3AXLyBTIdbs8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EOHZH5c4kEYVHDVKABOSfjsrK4UlhcStlwFPN9Y/ZaPlesQz18fefwy/2a9JUVnImqI5CgQQWlrcetJoiAYDq7Og5SlFVT9BOvbwHr6O9JtPxU3wbR6N407MsBUMS755JZN632qwmtvyjfutWpYR74gf9jehvF3Ai36LyMeDie4= 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=oeqi0EEe; arc=none smtp.client-ip=209.85.219.49 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-qv1-f49.google.com with SMTP id 6a1803df08f44-690e2d194f6so1278566d6.0 for ; Wed, 20 Mar 2024 11:04:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20230601.gappssmtp.com; s=20230601; t=1710957897; x=1711562697; 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=30OLZu1BB8NMv+SdqAZeeZ3/L8O0lM0O1+2bSt3RnLI=; b=oeqi0EEeNXlwr7O9CdaXhGXvicEBFrLJ2qUd4l+yYVn60ZHnatgfEiiNzyaJ6scfLp iSQA4u/ojU7tiU/+Pc6glzUNEH5MZk88NlOlZETF7ePKJZsX373t96wNAgvMpLjK/hZV 0byWrUiWwBukNX4lp1hmMlu5bX5dSkH94erSQV7pLSRz8akiizPJlqh5rfaxVKXSzwCC gNBWtcF69hK6A0IkwGszDa3MtHvgTVKdIFr2QJqdtjxP2A7GZboUcq2zN0cLyVzEfHvQ VibbzaJEPGsTcDikLQ9e2ucanAor/D37gujMb8inc0aFApCbHXHo0WeFiYPiIA1mId7j P1xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710957897; x=1711562697; 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=30OLZu1BB8NMv+SdqAZeeZ3/L8O0lM0O1+2bSt3RnLI=; b=gEbrtNJDF9eLk3cg5ZMijwrusQhfFOgGgxhG5VaW3rbYRopnlSj4aiBAdQl6fkOr7i yRKREyOlAvaaPU2e/DAHQfjWNp9KHYM8paonxpQ5o++mgCtAOWDP8HMPJ1S1JLI2lbjn d7Uwi0TGrhIZ0N0LC5MYMbTnyS3RKq51wQfkczRR3wAJ0HA5y4h9XhGpdCH4WEALtZfC EZhLfGT8CuK0JVC2QWcGlmZ5QI5XUlIyf5bnej7MuPz5bB/g0alixsna+Ola/+uXjbQt ENPA6b2t3zjDeVXOaCetk5ORNg/ODv0UfgPMlpoUBqcvphsD5D00TwdMEiEKn7QCEkzZ ZCOw== X-Forwarded-Encrypted: i=1; AJvYcCX+VLC33oejQ1ja5EYpzZQEGZJURTN7k1xd8jBzT4g44cIAK5EguQN6MQzx75+0qaksyPuNuW4VD3vOvrYPVCHXaw+VEGKctDTZNcDW X-Gm-Message-State: AOJu0Yz7SdZjoHCvYak9zo7aKvI7c556ufCYtyt3SUV/4U43CHwiO2a1 VWQWQWAZejTBIO67nqKw7slrwuHXiP7JPPZ0QZ6jDc2LolkojbNa50HCQuG2U8E= X-Received: by 2002:a0c:f64f:0:b0:696:442c:a659 with SMTP id s15-20020a0cf64f000000b00696442ca659mr3116723qvm.52.1710957896840; Wed, 20 Mar 2024 11:04:56 -0700 (PDT) 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 15-20020a0562140dcf00b00690cbd296fesm8183030qvt.121.2024.03.20.11.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 11:04:56 -0700 (PDT) From: Johannes Weiner To: Andrew Morton Cc: Vlastimil Babka , Mel Gorman , Zi Yan , "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: Wed, 20 Mar 2024 14:02:09 -0400 Message-ID: <20240320180429.678181-5-hannes@cmpxchg.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240320180429.678181-1-hannes@cmpxchg.org> References: <20240320180429.678181-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 4529893d9f04..a1376a6fe7e4 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2683,9 +2683,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