From nobody Thu Apr 9 17:30:56 2026 Received: from out-180.mta0.migadu.com (out-180.mta0.migadu.com [91.218.175.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B54853054C7 for ; Fri, 6 Mar 2026 13:36:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772804167; cv=none; b=GiYeU3VndAxuft4mznlVqRZVN581qqkgj0zJ9da7YCyDPp0Hs022qCV5DV1LhKBUNe9bzCZzRqq1DiMc1VP/C6V+7aKNLc9/jMbbNZXfLVVDWOFhoFM0VWFSX+sAdmRQ1VrH3tsBxDdJUwD2FEosffisGZtgIbLpszHwidWmhlA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772804167; c=relaxed/simple; bh=ZAVV91+IOpehiZ4UYVMjKFDHm81SEq6dpZIMZeLYYqo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=G9e+NFPGsealxxnLpkbmOJX09ufOQGL9OeehJuh+BvVbxcIOcc7oqBRy1sk28V4fMcnTieoHoGl6jlhF1SkY60LAYmVARWKJjPZsxjKAi0ue6YUWDVrxOa4xIemHhgJ4nQ80zjHWsQPjiI78zR4JrNQUjj5vIefJeMl+Vz/XCzI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=UAl4alQM; arc=none smtp.client-ip=91.218.175.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="UAl4alQM" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1772804162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=IjfwJVkjFCkurXfXgkdOOF1hpoMOxoLVQDtfObgZD/0=; b=UAl4alQMAOg0EZQY/V24xC6fW1H9N94cbihAUUK5qjEw0JXQy8U5Vg6rTtPyL3ZYXx3o9a 8RIRQ1Y3KECz+R3V+SoxG2rCSZ4i9LDkC+YqUYUl4nbjOe47xBUsHTZCghLoEailLYQPbZ tbE85dNIhzmg4dNGEB/Cq+lzgPTI8P0= From: Usama Arif To: Andrew Morton , npache@redhat.com, david@kernel.org, ziy@nvidia.com, linux-mm@kvack.org Cc: matthew.brost@intel.com, joshua.hahnjy@gmail.com, hannes@cmpxchg.org, rakie.kim@sk.com, byungchul@sk.com, gourry@gourry.net, ying.huang@linux.alibaba.com, apopple@nvidia.com, linux-kernel@vger.kernel.org, kernel-team@meta.com, Usama Arif Subject: [PATCH] mm: migrate: requeue destination folio on deferred split queue Date: Fri, 6 Mar 2026 05:35:56 -0800 Message-ID: <20260306133556.2051251-1-usama.arif@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" During folio migration, __folio_migrate_mapping() removes the source folio from the deferred split queue, but the destination folio is never re-queued. This causes underutilized THPs to escape the shrinker after NUMA migration, since they silently drop off the deferred split list. Fix this by calling deferred_split_folio() on the destination folio after a successful migration, for large rmappable folios. Reported-by: Johannes Weiner Fixes: dafff3f4c850 ("mm: split underused THPs") Signed-off-by: Usama Arif --- mm/migrate.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mm/migrate.c b/mm/migrate.c index ece77ccb2ec0..98d0a594f7b7 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1393,6 +1393,17 @@ static int migrate_folio_move(free_folio_t put_new_f= olio, unsigned long private, if (old_page_state & PAGE_WAS_MAPPED) remove_migration_ptes(src, dst, 0); =20 + /* + * Requeue the destination folio on the deferred split queue if + * the source was a large folio that was on the queue. Without + * this, NUMA migration causes underutilized THPs to escape + * the shrinker since the source is unqueued in + * __folio_migrate_mapping() and the destination is never + * re-queued. + */ + if (folio_test_large(dst) && folio_test_large_rmappable(dst)) + deferred_split_folio(dst, false); + out_unlock_both: folio_unlock(dst); folio_set_owner_migrate_reason(dst, reason); --=20 2.47.3