public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: Zi Yan <ziy@nvidia.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
	linux-mm@kvack.org, David Hildenbrand <david@redhat.com>,
	Oscar Salvador <osalvador@suse.de>,
	Vlastimil Babka <vbabka@suse.cz>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Mel Gorman <mgorman@techsingularity.net>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>,
	Brendan Jackman <jackmanb@google.com>,
	Richard Chang <richardycc@google.com>,
	linux-kernel@vger.kernel.org, Zi Yan <ziy@nvidia.com>
Subject: Re: [PATCH v3 1/4] mm/page_isolation: make page isolation a standalone bit.
Date: Fri, 09 May 2025 09:57:42 -0400	[thread overview]
Message-ID: <E40B7150-70AA-4D51-B5F3-4FF22AD887FD@nvidia.com> (raw)
In-Reply-To: <50BB00FF-746E-4623-8F48-F74209EDBD0A@nvidia.com>

On 8 May 2025, at 16:22, Zi Yan wrote:

> On 7 May 2025, at 17:10, Zi Yan wrote:
>
>> During page isolation, the original migratetype is overwritten, since
>> MIGRATE_* are enums and stored in pageblock bitmaps. Change
>> MIGRATE_ISOLATE to be stored a standalone bit, PB_migrate_isolate, like
>> PB_migrate_skip, so that migratetype is not lost during pageblock
>> isolation. pageblock bits needs to be word aligned, so expand
>> the number of pageblock bits from 4 to 8 and make PB_migrate_isolate bit 7.
>>
>> Signed-off-by: Zi Yan <ziy@nvidia.com>
>> ---
>>  include/linux/mmzone.h          | 17 ++++++++++----
>>  include/linux/page-isolation.h  |  2 +-
>>  include/linux/pageblock-flags.h | 33 +++++++++++++++++++++++++-
>>  mm/page_alloc.c                 | 41 ++++++++++++++++++++++++++++++++-
>>  4 files changed, 86 insertions(+), 7 deletions(-)
>>
>
> Here is the fixup 1/3 to address Johannes’ comments.
>
> From 7eb1d9fa58fdab216862436181e5d2baf2958c54 Mon Sep 17 00:00:00 2001
> From: Zi Yan <ziy@nvidia.com>
> Date: Thu, 8 May 2025 12:05:59 -0400
> Subject: [PATCH] fixup for mm/page_isolation: make page isolation a standalone
>  bit
>
> 1. keep the original is_migrate_isolate_page()
> 2. move {get,set,clear}_pageblock_isolate() to mm/page_isolation.c
> 3. use a single version for get_pageblock_migratetype() and
>    get_pfnblock_migratetype().
>
> Signed-off-by: Zi Yan <ziy@nvidia.com>
> ---
>  include/linux/mmzone.h          |  6 ------
>  include/linux/page-isolation.h  |  2 +-
>  include/linux/pageblock-flags.h | 24 ------------------------
>  mm/page_alloc.c                 | 25 ++++++++++---------------
>  mm/page_isolation.c             | 17 +++++++++++++++++
>  5 files changed, 28 insertions(+), 46 deletions(-)
>

Hi Andrew,

This fixup gets rid of the unused function warning[1].

BTW, this series gets several fixups. Let me know if you think a V4
is necessary. Thanks.

[1] https://lore.kernel.org/linux-mm/202505092126.yRGhLhg1-lkp@intel.com/

From 126d116cb737bf3d8c475460b9b48edc6696e6dc Mon Sep 17 00:00:00 2001
From: Zi Yan <ziy@nvidia.com>
Date: Fri, 9 May 2025 09:29:09 -0400
Subject: [PATCH] fix unused function warnings

1. add __maybe_unused to get_pageblock_isolate(), which is used in
   VM_BUG_ON only.
2. remove unused set_pageblock_isolate().

Signed-off-by: Zi Yan <ziy@nvidia.com>
---
 mm/page_isolation.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/mm/page_isolation.c b/mm/page_isolation.c
index b0f83a7c508d..ce7e38c9f839 100644
--- a/mm/page_isolation.c
+++ b/mm/page_isolation.c
@@ -15,7 +15,7 @@
 #define CREATE_TRACE_POINTS
 #include <trace/events/page_isolation.h>

-static inline bool get_pageblock_isolate(struct page *page)
+static inline bool __maybe_unused get_pageblock_isolate(struct page *page)
 {
 	return get_pfnblock_flags_mask(page, page_to_pfn(page),
 			PB_migrate_isolate_bit);
@@ -25,12 +25,6 @@ static inline void clear_pageblock_isolate(struct page *page)
 	set_pfnblock_flags_mask(page, 0, page_to_pfn(page),
 			PB_migrate_isolate_bit);
 }
-static inline void set_pageblock_isolate(struct page *page)
-{
-	set_pfnblock_flags_mask(page, PB_migrate_isolate_bit,
-			page_to_pfn(page),
-			PB_migrate_isolate_bit);
-}

 /*
  * This function checks whether the range [start_pfn, end_pfn) includes
-- 
2.47.2



--
Best Regards,
Yan, Zi


  parent reply	other threads:[~2025-05-09 13:57 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-07 21:10 [PATCH v3 0/4] Make MIGRATE_ISOLATE a standalone bit Zi Yan
2025-05-07 21:10 ` [PATCH v3 1/4] mm/page_isolation: make page isolation " Zi Yan
2025-05-08  5:24   ` Johannes Weiner
2025-05-08 15:27     ` Zi Yan
2025-05-08 19:17       ` Zi Yan
2025-05-08 20:46         ` Johannes Weiner
2025-05-08 20:53           ` Zi Yan
2025-05-09  1:33             ` Zi Yan
2025-05-09 12:48               ` Zi Yan
2025-05-08 20:22   ` Zi Yan
2025-05-08 21:13     ` Johannes Weiner
2025-05-09 13:57     ` Zi Yan [this message]
2025-05-07 21:10 ` [PATCH v3 2/4] mm/page_isolation: remove migratetype from move_freepages_block_isolate() Zi Yan
2025-05-08 20:23   ` Zi Yan
2025-05-07 21:10 ` [PATCH v3 3/4] mm/page_isolation: remove migratetype from undo_isolate_page_range() Zi Yan
2025-05-08 21:12   ` Johannes Weiner
2025-05-07 21:10 ` [PATCH v3 4/4] mm/page_isolation: remove migratetype parameter from more functions Zi Yan
2025-05-08 20:25   ` Zi Yan
2025-05-09  1:56     ` Zi Yan
2025-05-09 16:01       ` Zi Yan
2025-05-08 21:11   ` Johannes Weiner
2025-05-08 22:15     ` Zi Yan
2025-05-08  4:38 ` [PATCH v3 0/4] Make MIGRATE_ISOLATE a standalone bit Johannes Weiner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E40B7150-70AA-4D51-B5F3-4FF22AD887FD@nvidia.com \
    --to=ziy@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=david@redhat.com \
    --cc=hannes@cmpxchg.org \
    --cc=jackmanb@google.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@suse.com \
    --cc=osalvador@suse.de \
    --cc=richardycc@google.com \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox