lkml.org 
[lkml]   [2020]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH -next] mm/hotplug: silence a lockdep splat with printk()
From
Date


> On Jan 14, 2020, at 8:19 PM, Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Tue, 14 Jan 2020 20:02:31 -0500 Qian Cai <cai@lca.pw> wrote:
>
>>
>>
>>>> @@ -8290,8 +8290,10 @@ bool has_unmovable_pages(struct zone *zo
>>>> return false;
>>>> unmovable:
>>>> WARN_ON_ONCE(zone_idx(zone) == ZONE_MOVABLE);
>>>> - if (flags & REPORT_FAILURE)
>>>> - dump_page(pfn_to_page(pfn + iter), reason);
>>>> + if (flags & REPORT_FAILURE) {
>>>> + page = pfn_to_page(pfn + iter);
>>>
>>> This statement appears to be unnecessary.
>>
>> dump_page() in set_migratetype_isolate() needs that “page”.
>
> local var `page' is never used after this statement.
>

The goal is to reuse the parameter of has_unmovable_pages((…, page, …)
as a return value, so after it returns, dump_page(page, ...) could use it. I
don’t see where it was defined as a local variable.

This is probably a bit too hacky, so I’ll change has_unmovable_pages()
to either return "struct page *” or NULL which is easier to understand.
\
 
 \ /
  Last update: 2020-01-15 02:39    [W:0.030 / U:5.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site