* [PATCH] mm/memory_hotplug: Print the correct pfn in do_migrate_range()
@ 2024-09-24 10:15 Li Zhijian
2024-09-24 10:50 ` Anshuman Khandual
0 siblings, 1 reply; 4+ messages in thread
From: Li Zhijian @ 2024-09-24 10:15 UTC (permalink / raw)
To: linux-mm
Cc: David Hildenbrand, Oscar Salvador, Andrew Morton, linux-kernel,
Li Zhijian
The pfn value needs to be retrieved correctly when PageTransHuge(page)
is true. Fix it by replacing the usage of 'pfn' with 'page_to_pfn(page)'
to ensure the correct pfn is printed in warning messages when isolation
fails.
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
---
mm/memory_hotplug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 26790c8d5b43..000430406a9e 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1829,7 +1829,7 @@ static void do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)
} else {
if (__ratelimit(&migrate_rs)) {
- pr_warn("failed to isolate pfn %lx\n", pfn);
+ pr_warn("failed to isolate pfn %lx\n", page_to_pfn(page));
dump_page(page, "isolation failed");
}
}
--
2.29.2
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mm/memory_hotplug: Print the correct pfn in do_migrate_range()
2024-09-24 10:15 [PATCH] mm/memory_hotplug: Print the correct pfn in do_migrate_range() Li Zhijian
@ 2024-09-24 10:50 ` Anshuman Khandual
2024-09-25 8:01 ` Zhijian Li (Fujitsu)
0 siblings, 1 reply; 4+ messages in thread
From: Anshuman Khandual @ 2024-09-24 10:50 UTC (permalink / raw)
To: Li Zhijian, linux-mm
Cc: David Hildenbrand, Oscar Salvador, Andrew Morton, linux-kernel
On 9/24/24 15:45, Li Zhijian wrote:
> The pfn value needs to be retrieved correctly when PageTransHuge(page)
Where the pfn could have been modified with
pfn = page_to_pfn(head) + compound_nr(head) - 1
So retrieving from page will get the original pfn value ?
> is true. Fix it by replacing the usage of 'pfn' with 'page_to_pfn(page)'
> to ensure the correct pfn is printed in warning messages when isolation
> fails.
>
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
> ---
> mm/memory_hotplug.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 26790c8d5b43..000430406a9e 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -1829,7 +1829,7 @@ static void do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)
>
> } else {
> if (__ratelimit(&migrate_rs)) {
> - pr_warn("failed to isolate pfn %lx\n", pfn);
> + pr_warn("failed to isolate pfn %lx\n", page_to_pfn(page));
> dump_page(page, "isolation failed");
> }
> }
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mm/memory_hotplug: Print the correct pfn in do_migrate_range()
2024-09-24 10:50 ` Anshuman Khandual
@ 2024-09-25 8:01 ` Zhijian Li (Fujitsu)
2024-09-25 8:59 ` Zhijian Li (Fujitsu)
0 siblings, 1 reply; 4+ messages in thread
From: Zhijian Li (Fujitsu) @ 2024-09-25 8:01 UTC (permalink / raw)
To: anshuman.khandual
Cc: akpm, david, linux-kernel, linux-mm, Zhijian Li (Fujitsu), osalvador
Sorry for the late reply. (My company's mail server that enabling the
DRMAC, seems not to deliver some mails to my inbox, I have to check
mails in lore)
> On 9/24/24 15:45, Li Zhijian wrote:
> > The pfn value needs to be retrieved correctly when PageTransHuge(page)
> Where the pfn could have been modified with
> pfn = page_to_pfn(head) + compound_nr(head) - 1
> So retrieving from page will get the original pfn value ?
Yes, that's true.
it should print the actual pfn thatfailed to isolate,\\\ Thanks Zhijian
>
>
> > is true. Fix it by replacing the usage of 'pfn' with 'page_to_pfn(page)' > to ensure the correct pfn is printed in warning messages when
> isolation > fails. > > Signed-off-by: Li Zhijian
> <lizhijian@fujitsu.com> > --- > mm/memory_hotplug.c | 2 +- > 1 file
> changed, 1 insertion(+), 1 deletion(-) > > diff --git
> a/mm/memory_hotplug.c b/mm/memory_hotplug.c > index
> 26790c8d5b43..000430406a9e 100644 > --- a/mm/memory_hotplug.c > +++
> b/mm/memory_hotplug.c > @@ -1829,7 +1829,7 @@ static void
> do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) > > }
> else { > if (__ratelimit(&migrate_rs)) { > - pr_warn("failed to
> isolate pfn %lx\n", pfn); > + pr_warn("failed to isolate pfn %lx\n",
> page_to_pfn(page)); > dump_page(page, "isolation failed"); > } > }
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mm/memory_hotplug: Print the correct pfn in do_migrate_range()
2024-09-25 8:01 ` Zhijian Li (Fujitsu)
@ 2024-09-25 8:59 ` Zhijian Li (Fujitsu)
0 siblings, 0 replies; 4+ messages in thread
From: Zhijian Li (Fujitsu) @ 2024-09-25 8:59 UTC (permalink / raw)
To: anshuman.khandual; +Cc: akpm, david, linux-kernel, linux-mm, osalvador
Well, please ignore this patch, it has been fixed in 6.12 merged windows
On 25/09/2024 16:01, Li, Zhijian/李 智坚 wrote:
> Sorry for the late reply. (My company's mail server that enabling the
> DRMAC, seems not to deliver some mails to my inbox, I have to check
> mails in lore)
>
>> On 9/24/24 15:45, Li Zhijian wrote:
>>> The pfn value needs to be retrieved correctly when PageTransHuge(page)
>> Where the pfn could have been modified with
>> pfn = page_to_pfn(head) + compound_nr(head) - 1
>> So retrieving from page will get the original pfn value ?
>
> Yes, that's true.
> it should print the actual pfn thatfailed to isolate,\\\ Thanks Zhijian
>
>
>>
>>
>>> is true. Fix it by replacing the usage of 'pfn' with 'page_to_pfn(page)' > to ensure the correct pfn is printed in warning messages when
>> isolation > fails. > > Signed-off-by: Li Zhijian
>> <lizhijian@fujitsu.com> > --- > mm/memory_hotplug.c | 2 +- > 1 file
>> changed, 1 insertion(+), 1 deletion(-) > > diff --git
>> a/mm/memory_hotplug.c b/mm/memory_hotplug.c > index
>> 26790c8d5b43..000430406a9e 100644 > --- a/mm/memory_hotplug.c > +++
>> b/mm/memory_hotplug.c > @@ -1829,7 +1829,7 @@ static void
>> do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) > > }
>> else { > if (__ratelimit(&migrate_rs)) { > - pr_warn("failed to
>> isolate pfn %lx\n", pfn); > + pr_warn("failed to isolate pfn %lx\n",
>> page_to_pfn(page)); > dump_page(page, "isolation failed"); > } > }
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-09-25 9:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-24 10:15 [PATCH] mm/memory_hotplug: Print the correct pfn in do_migrate_range() Li Zhijian
2024-09-24 10:50 ` Anshuman Khandual
2024-09-25 8:01 ` Zhijian Li (Fujitsu)
2024-09-25 8:59 ` Zhijian Li (Fujitsu)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox