lkml.org 
[lkml]   [2022]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] x86/mm: Fix marking of unused sub-pmd ranges
Date
On Thu, May 12 2022 at 11:04, David Hildenbrand wrote:
> On 09.05.22 11:06, Adrian-Ken Rueegsegger wrote:
>> static void __meminit vmemmap_use_new_sub_pmd(unsigned long start, unsigned long end)
>> {
>> + const unsigned long page = ALIGN_DOWN(start, PMD_SIZE);
>> +
>> vmemmap_flush_unused_pmd();
>>
>> /*
>> @@ -914,8 +916,7 @@ static void __meminit vmemmap_use_new_sub_pmd(unsigned long start, unsigned long
>> * Mark with PAGE_UNUSED the unused parts of the new memmap range
>> */
>> if (!IS_ALIGNED(start, PMD_SIZE))
>> - memset((void *)start, PAGE_UNUSED,
>> - start - ALIGN_DOWN(start, PMD_SIZE));
>> + memset((void *)page, PAGE_UNUSED, start - page);
>>
>> /*
>> * We want to avoid memset(PAGE_UNUSED) when populating the vmemmap of
>
> As the x86 code was based on my s390x code, I assume that this was
> accidentally introduced in the x86 variant.
>
> We'd be marking the wrong range PAGE_UNUSED.
>
> Your fix looks correct to me:
>
> Reviewed-by: David Hildenbrand <david@redhat.com>
>
> Do we want to cc stable?

Yes, we'll add it when picking it up.

I really have to ask why this duplicated code exists in the first
place. There is zero architecture specific code neither in the s390 nor
in the x86 version.

The x86 version is just copy & pasta & fatfinger, if I'm not missing
something here.

Thanks,

tglx

\
 
 \ /
  Last update: 2022-05-12 18:56    [W:0.059 / U:1.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site