From nobody Sun Feb 8 00:55:36 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 E567821D5B8; Mon, 9 Jun 2025 20:00:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749499254; cv=none; b=n/1hHlK1tNIyjhYU1iNUce0N1RneaQQ/pFDO6+hzvJwt1RFb1Hnk8JQK8JxjPR8kd2e6ZGHkQOCXrjkTPwY+imXTGBj8se4ZHtVTD9zUJq3MNCFzOwyFOtbaejLro7vBJ6lgicT6xlqGPIZBxnm/7kR5PMctACsjCW+TtkfsWQE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749499254; c=relaxed/simple; bh=jnTsM17LtmINmtfyvAGM5i8zoPOwCcuXIDUVAUmB5ZQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YKihWtzuBS8GbPmqKenzImvFlLa5iADIrSU6ovGT3cVAUVPavbACIGJRKQ/mqwaj3EbpKHlTmHeoHuB9SgySD/OtBTfub3NTdcIKtMFJe1lzkRTryswES3mtJQkJnNEfY/gvAxMotU3F2cBiqH+A7bBP0FkhSSvUKpzN1czVQGs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Gh/HuXza; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Gh/HuXza" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45A30C4CEEB; Mon, 9 Jun 2025 20:00:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1749499253; bh=jnTsM17LtmINmtfyvAGM5i8zoPOwCcuXIDUVAUmB5ZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gh/HuXzaRqi7jyl+aFqpZ/vywENjstf6TEjhD4IR4/3I9UoEBAZxPm60h2xIIu8c+ drc2+NotsQfVnrpNYERtVUR7KhmCKfjF4NnDa7V8P4UzQ0wyAnyV91+70IhG0Lq1I9 wYMrC7bfo5X3P5W45C1cBEvu9ob/Y1D5+eCVbhGaXU+y8tzmQxdOMTq3DmK7JMCtrM LZoIATgG4OMR3nA+Tty7Hsh1vQ5A/xUnGnafQrtOZKLqlbm4HsqDB3WSFqh3PmSrSq JRwVpg1KDIOCeKrHSn9UQIVPvUGGk/Q5Ng4F716NX+qD3WUViqXz2BcykelbVi0uNh 1phnoWZuVh4OA== From: SeongJae Park To: Cc: SeongJae Park , Andrew Morton , Honggyu Kim , Simon Wang , damon@lists.linux.dev, kernel-team@meta.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 1/3] mm/damon/paddr: use alloc_migartion_target() with no migration fallback nodemask Date: Mon, 9 Jun 2025 13:00:46 -0700 Message-Id: <20250609200048.50914-2-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250609200048.50914-1-sj@kernel.org> References: <20250609200048.50914-1-sj@kernel.org> 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 Content-Type: text/plain; charset="utf-8" DAMOS_MIGRATE_{HOT,COLD} implementation resembles that for demote_folio_list(). Because those are not only for demotion but general folio migrations, it makes more sense to behave similarly to move_pages() system call. Make the behavior more similar to move_pages(), by using alloc_migration_target() instead of alloc_migrate_folio(), without fallback nodemask. Signed-off-by: SeongJae Park --- mm/damon/paddr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c index 4102a8c5f992..fcab148e6865 100644 --- a/mm/damon/paddr.c +++ b/mm/damon/paddr.c @@ -386,7 +386,6 @@ static unsigned int __damon_pa_migrate_folio_list( int target_nid) { unsigned int nr_succeeded =3D 0; - nodemask_t allowed_mask =3D NODE_MASK_NONE; struct migration_target_control mtc =3D { /* * Allocate from 'node', or fail quickly and quietly. @@ -396,7 +395,6 @@ static unsigned int __damon_pa_migrate_folio_list( .gfp_mask =3D (GFP_HIGHUSER_MOVABLE & ~__GFP_RECLAIM) | __GFP_NOWARN | __GFP_NOMEMALLOC | GFP_NOWAIT, .nid =3D target_nid, - .nmask =3D &allowed_mask }; =20 if (pgdat->node_id =3D=3D target_nid || target_nid =3D=3D NUMA_NO_NODE) @@ -406,7 +404,7 @@ static unsigned int __damon_pa_migrate_folio_list( return 0; =20 /* Migration ignores all cpuset and mempolicy settings */ - migrate_pages(migrate_folios, alloc_migrate_folio, NULL, + migrate_pages(migrate_folios, alloc_migration_target, NULL, (unsigned long)&mtc, MIGRATE_ASYNC, MR_DAMON, &nr_succeeded); =20 --=20 2.39.5 From nobody Sun Feb 8 00:55:36 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D24E0220F3F for ; Mon, 9 Jun 2025 20:00:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749499254; cv=none; b=F3C4b54tV4f0dt46k+9m2yGa+H126DW8cEbBh0fJ+ZYuzkanx79slqDQtwa2+MS1cXuG5uo38oqy2tbwun+srpmFd/pZ+y2kYpTzBqXT3InlfBCiQgwZUPCtw9PyjuX1bTiyNM0y40vtzN+TBp9c7gMVOR2JXvu38UmDTBM3i/o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749499254; c=relaxed/simple; bh=L6hbnI31264eoN57CA+wuQ9nzeSgAHueWnj1w5Hosxw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RNKBfHeYAkNUEaIJ/RxCLGkRNLRHL+yGaooVP0jZ0qRKfAICcE2O06OPiWF1cL+jGZT4X2OC3EoNx0N8o5aMT4hcXbduQg1v9cqDsf2XnkVMz4cGuGsYSQY2iXngDCvoO2VH3BT9IvQ5incw+jBjwdCxl6wCRA/MTA9otSt1unU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UVpBFWRg; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UVpBFWRg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4790CC4CEF0; Mon, 9 Jun 2025 20:00:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1749499254; bh=L6hbnI31264eoN57CA+wuQ9nzeSgAHueWnj1w5Hosxw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UVpBFWRgJj3ZYaTUXGGUODCbgXZHtDyo4JRY07CXgW7sJCiiqORGaAiL13Juv/HE1 ptbNcx5kDhFgNwloqTfG2gs7Klr701oqQd6UGYQgv450uBsriOZ3EsXDAkakbYYVUD 3QZymycC/375xe698z0NBWts7twIcZ1iDeViP4pidCcz00go8m6dT+VvEvl9SO/uhx ngs9+M+OLH+4FL3tWLyThmsXjGPQbnUmxoRT9+ZF3ruVaNXQzWwUEs4jIj6eTkdZfz zTyR6JxQy7zz/+QiR9dFhPTUK2zZ1ICtM3I6PCzrdxya/dXE8X3HorUba1jQ7v63DK rcLIPnKP1XtAg== From: SeongJae Park To: Cc: SeongJae Park , Andrew Morton , David Hildenbrand , Honggyu Kim , Johannes Weiner , Lorenzo Stoakes , Michal Hocko , Qi Zheng , Shakeel Butt , Simon Wang , kernel-team@meta.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 2/3] Revert "mm: rename alloc_demote_folio to alloc_migrate_folio" Date: Mon, 9 Jun 2025 13:00:47 -0700 Message-Id: <20250609200048.50914-3-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250609200048.50914-1-sj@kernel.org> References: <20250609200048.50914-1-sj@kernel.org> 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 Content-Type: text/plain; charset="utf-8" This reverts commit 8f75267d22bdf8e3baf70f2fa7092d8c2f58da71. Commit 8f75267d22bd ("mm: rename alloc_demote_folio to alloc_migrate_folio") was to reflect the fact the function is called for not only demotion, but also general migrations from DAMOS_MIGRATE_{HOT,COLD}. The previous commit made the DAMOS actions to not use alloc_migrate_folio(), though. So, demote_folio_list() is the only caller of alloc_migrate_folio(), and the name could now be rather confusing. Revert the renaming commit. Signed-off-by: SeongJae Park --- mm/internal.h | 2 +- mm/vmscan.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index 71eaea2db9b0..b76b5162314a 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1227,7 +1227,7 @@ extern unsigned long __must_check vm_mmap_pgoff(stru= ct file *, unsigned long, unsigned long, unsigned long); =20 extern void set_pageblock_order(void); -struct folio *alloc_migrate_folio(struct folio *src, unsigned long private= ); +struct folio *alloc_demote_folio(struct folio *src, unsigned long private); unsigned long reclaim_pages(struct list_head *folio_list); unsigned int reclaim_clean_pages_from_list(struct zone *zone, struct list_head *folio_list); diff --git a/mm/vmscan.c b/mm/vmscan.c index a93a1ba9009e..6bebc91cbf2f 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1006,7 +1006,7 @@ static void folio_check_dirty_writeback(struct folio = *folio, mapping->a_ops->is_dirty_writeback(folio, dirty, writeback); } =20 -struct folio *alloc_migrate_folio(struct folio *src, unsigned long private) +struct folio *alloc_demote_folio(struct folio *src, unsigned long private) { struct folio *dst; nodemask_t *allowed_mask; @@ -1069,7 +1069,7 @@ static unsigned int demote_folio_list(struct list_hea= d *demote_folios, node_get_allowed_targets(pgdat, &allowed_mask); =20 /* Demotion ignores all cpuset and mempolicy settings */ - migrate_pages(demote_folios, alloc_migrate_folio, NULL, + migrate_pages(demote_folios, alloc_demote_folio, NULL, (unsigned long)&mtc, MIGRATE_ASYNC, MR_DEMOTION, &nr_succeeded); =20 --=20 2.39.5 From nobody Sun Feb 8 00:55:36 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 ED7DA221281 for ; Mon, 9 Jun 2025 20:00:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749499256; cv=none; b=LdO/5d5OtIY74evqy9XZlOQ+y6VuUjHwCH/z2myhjbdbG16zWqtJJSzrkH6en/+oQvTRtmR9uSL44lbBl+JV3v/BM84yzt2Oy5DU0mp4Mo0RkmOERuWujIiuLEPpEJ5Js0ixt0B09XlE4S8wPy/96Hh68bWpTkRcFPOd9IAg5tM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749499256; c=relaxed/simple; bh=kXfXXQuZy3Q2a6PJsLDR0HH0HOWqYg4BhOnbE4nBfzg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YEqRiIcH9kwLqT2rxqs3+uov4AEr+qC6+GkDIcGYik8CXS42xXG27aCGwU21UqSCH6TmCgAi5YaU1OAIep182s6Q1newRVa3UfU8vgIaf/cr5pMVGtb5PJ1RvGOxgLmkGarntJsF4pI0AENWtGw6AbVToxJKLq1M5ddi5WLMZwg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dC/6i3Qd; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dC/6i3Qd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 575DBC4CEEF; Mon, 9 Jun 2025 20:00:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1749499255; bh=kXfXXQuZy3Q2a6PJsLDR0HH0HOWqYg4BhOnbE4nBfzg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dC/6i3QdlnobUADLR23jkzeDlz9A6Soy9CnntKUIo92Wq1Q+zZoR+o+JXyK48Zxdv Eh4WCJ56JfeHljelt19WAAJhIIyMKqSQaGys0GoGNhph2XufAuahIbzfmZMcmJxV04 4AZ06fGy/bDA73HNAbEm1gIEcIM0v45/uHQq4koCt0vea6c1EZPYnnImPwAX8FumLC 4jmlZ2RTPbyHHk51PIlkX6mfn0RQOB3NzQa1n+3+1XxGgS5ENUy6HFj0aP+msKK8Lg 8xmpnn1mDFxQMBwrK9Iq6XYT0fRMHeqoBjEE8myYXf1IKjtk4c5FwtrU0mRJ3wvuK9 o4fonEAjGs+UQ== From: SeongJae Park To: Cc: SeongJae Park , Andrew Morton , David Hildenbrand , Honggyu Kim , Johannes Weiner , Lorenzo Stoakes , Michal Hocko , Qi Zheng , Shakeel Butt , Simon Wang , kernel-team@meta.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 3/3] Revert "mm: make alloc_demote_folio externally invokable for migration" Date: Mon, 9 Jun 2025 13:00:48 -0700 Message-Id: <20250609200048.50914-4-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250609200048.50914-1-sj@kernel.org> References: <20250609200048.50914-1-sj@kernel.org> 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 Content-Type: text/plain; charset="utf-8" This reverts commit a00ce85af2a1be494d3b0c9457e8e81cdcce2a89. Commit a00ce85af2a1 ("mm: make alloc_demote_folio externally invokable for migration") was made to let DAMOS_MIGRATE_{HOT,COLD} call the function. But a previous commit made DAMOS_MIGRATE_{HOT,COLD} call alloc_migration_target() instead. Hence there are no more callers of the function outside of vmscan.c. Revert the commit to make the function static again. Signed-off-by: SeongJae Park --- mm/internal.h | 1 - mm/vmscan.c | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index b76b5162314a..12470ee5f05b 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1227,7 +1227,6 @@ extern unsigned long __must_check vm_mmap_pgoff(stru= ct file *, unsigned long, unsigned long, unsigned long); =20 extern void set_pageblock_order(void); -struct folio *alloc_demote_folio(struct folio *src, unsigned long private); unsigned long reclaim_pages(struct list_head *folio_list); unsigned int reclaim_clean_pages_from_list(struct zone *zone, struct list_head *folio_list); diff --git a/mm/vmscan.c b/mm/vmscan.c index 6bebc91cbf2f..620dce753b64 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1006,7 +1006,8 @@ static void folio_check_dirty_writeback(struct folio = *folio, mapping->a_ops->is_dirty_writeback(folio, dirty, writeback); } =20 -struct folio *alloc_demote_folio(struct folio *src, unsigned long private) +static struct folio *alloc_demote_folio(struct folio *src, + unsigned long private) { struct folio *dst; nodemask_t *allowed_mask; --=20 2.39.5