lkml.org 
[lkml]   [2022]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 12/16] mm/page_alloc: use helper macro SZ_1{K,M}
On Fri, Sep 09, 2022 at 01:34:52PM +0200, David Hildenbrand wrote:
> On 09.09.22 11:24, Miaohe Lin wrote:
> > @@ -9055,7 +9055,7 @@ void *__init alloc_large_system_hash(const char *tablename,
> > /* It isn't necessary when PAGE_SIZE >= 1MB */
>
> Huh, how could we ever have that. Smells like dead code.
>
> > if (PAGE_SHIFT < 20)
>
> What about adjusting that as well? The it exactly matches the comment
>
> if (PAGE_SIZE >= SZ_1M)
>
> > - numentries = round_up(numentries, (1<<20)/PAGE_SIZE);
> > + numentries = round_up(numentries, SZ_1M / PAGE_SIZE);

The git history provides some clues here. See a7e833182a92.
But we do have an architecture which has ...

#ifdef CONFIG_PAGE_SIZE_1MB
#define PAGE_SHIFT 20
#define HEXAGON_L1_PTE_SIZE __HVM_PDE_S_1MB
#endif

I don't think it's an especially common config.

\
 
 \ /
  Last update: 2022-09-09 21:48    [W:0.102 / U:2.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site