lkml.org 
[lkml]   [2018]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/1] mm: page_alloc: skip over regions of invalid pfns on UMA

I like the patch. I think it could be better.

> +++ b/mm/page_alloc.c
> @@ -5344,7 +5344,7 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
> goto not_early;
>
> if (!early_pfn_valid(pfn)) {
> -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
> +#ifdef CONFIG_HAVE_MEMBLOCK
> /*
> * Skip to the pfn preceding the next valid one (or
> * end_pfn), such that we hit a valid pfn (or end_pfn)

This ifdef makes me sad. Here's more of the context:

if (!early_pfn_valid(pfn)) {
#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
/*
* Skip to the pfn preceding the next valid one (or
* end_pfn), such that we hit a valid pfn (or end_pfn)
* on our next iteration of the loop.
*/
pfn = memblock_next_valid_pfn(pfn, end_pfn) - 1;
#endif
continue;
}

This is crying out for:

#ifdef CONFIG_HAVE_MEMBLOCK
unsigned long memblock_next_valid_pfn(unsigned long pfn, unsigned long max_pfn);
#else
static inline unsigned long memblock_next_valid_pfn(unsigned long pfn,
unsigned long max_pfn)
{
return pfn + 1;
}
#endif

in a header file somewhere.

\
 
 \ /
  Last update: 2018-01-22 02:23    [W:0.042 / U:45.328 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site