Re: [PATCH v4 3/3] x86/vmemmap: Handle unpopulated sub-pmd ranges

2021-03-09 Thread Oscar Salvador
On Tue, Mar 09, 2021 at 02:39:02PM -0500, Zi Yan wrote: > Hi Oscar, > > vmemmap_use_new_sub_pmd and vmemmap_use_sub_pmd are not defined when > CONFIG_SPARSEMEM_VMEMMAP > and !CONFIG_MEMORY_HOTPLUG. It leads to compilation errors. Meh, yeah, that's right. I fixed that up, I will send a v6.

Re: [PATCH v4 3/3] x86/vmemmap: Handle unpopulated sub-pmd ranges

2021-03-09 Thread Zi Yan
On 1 Mar 2021, at 3:32, Oscar Salvador wrote: > When the size of a struct page is not multiple of 2MB, sections do > not span a PMD anymore and so when populating them some parts of the > PMD will remain unused. > Because of this, PMDs will be left behind when depopulating sections > since

Re: [PATCH v4 3/3] x86/vmemmap: Handle unpopulated sub-pmd ranges

2021-03-09 Thread Dave Hansen
On 3/9/21 12:25 AM, Oscar Salvador wrote: > > I think the confusion comes from the name. > "vmemmap_pmd_is_unused" might be a better fit? > > What do you think? Do you feel strong about moving the log in there > regardless of the name? No, not really. The name is probably worth adjusting, but

Re: [PATCH v4 3/3] x86/vmemmap: Handle unpopulated sub-pmd ranges

2021-03-09 Thread Oscar Salvador
On Mon, Mar 08, 2021 at 07:43:30PM +0100, Oscar Salvador wrote: > On Thu, Mar 04, 2021 at 09:02:36AM -0800, Dave Hansen wrote: > > Also, logically, it would make a lot of sense if you can move the actual > > PMD freeing logic in here. That way, the caller is just saying, "unuse > > this PMD

Re: [PATCH v4 3/3] x86/vmemmap: Handle unpopulated sub-pmd ranges

2021-03-08 Thread Oscar Salvador
On Thu, Mar 04, 2021 at 09:02:36AM -0800, Dave Hansen wrote: > On 3/1/21 12:32 AM, Oscar Salvador wrote: > > When the size of a struct page is not multiple of 2MB, sections do > > not span a PMD anymore and so when populating them some parts of the > > PMD will remain unused. > > Multiples of 2MB

Re: [PATCH v4 3/3] x86/vmemmap: Handle unpopulated sub-pmd ranges

2021-03-05 Thread David Hildenbrand
On 04.03.21 18:08, Dave Hansen wrote: On 3/4/21 9:02 AM, Dave Hansen wrote: +#define PAGE_UNUSED 0xFD +/* + * The unused vmemmap range, which was not yet memset(PAGE_UNUSED) ranges + * from unused_pmd_start to next PMD_SIZE boundary. + */ +static unsigned long unused_pmd_start __meminitdata;

Re: [PATCH v4 3/3] x86/vmemmap: Handle unpopulated sub-pmd ranges

2021-03-05 Thread Dave Hansen
On 3/4/21 9:02 AM, Dave Hansen wrote: >> +#define PAGE_UNUSED 0xFD >> +/* >> + * The unused vmemmap range, which was not yet memset(PAGE_UNUSED) ranges >> + * from unused_pmd_start to next PMD_SIZE boundary. >> + */ >> +static unsigned long unused_pmd_start __meminitdata; > This whole

Re: [PATCH v4 3/3] x86/vmemmap: Handle unpopulated sub-pmd ranges

2021-03-05 Thread Dave Hansen
On 3/1/21 12:32 AM, Oscar Salvador wrote: > When the size of a struct page is not multiple of 2MB, sections do > not span a PMD anymore and so when populating them some parts of the > PMD will remain unused. Multiples of 2MB are 2MB, 4MB, 6MB, etc... I think you meant here that 2MB must be a

[PATCH v4 3/3] x86/vmemmap: Handle unpopulated sub-pmd ranges

2021-03-01 Thread Oscar Salvador
When the size of a struct page is not multiple of 2MB, sections do not span a PMD anymore and so when populating them some parts of the PMD will remain unused. Because of this, PMDs will be left behind when depopulating sections since remove_pmd_table() thinks that those unused parts are still in