mbox series

[0/1] arm64/sparsemem: reduce SECTION_SIZE_BITS

Message ID cover.1611206601.git.sudaraja@codeaurora.org (mailing list archive)
Headers show
Series arm64/sparsemem: reduce SECTION_SIZE_BITS | expand

Message

Sudarshan Rajagopalan Jan. 21, 2021, 5:29 a.m. UTC
This patch is the follow-up from the discussions in the thread [1].
Reducing the section size has the merit of reducing wastage of reserved memory
for vmmemmap mappings for sections with large memory holes. Also with smaller 
section size gives more grunularity and agility for memory hot(un)plugging.

But there are also constraints in reducing SECTION_SIZE_BIT:

- Should accommodate highest order page for a given config
- Should not break PMD mapping in vmemmap for 4K pages
- Should not consume too many page->flags bits reducing space for other info

This patch uses the suggestions from Anshuman Khandual and David Hildenbrand
in thread [1] to set the least possible section size to 128MB for 4K and 16K
base page size configs for simplicity, and to 512MB for 64K base page size config.

[1] https://lore.kernel.org/lkml/cover.1609895500.git.sudaraja@codeaurora.org/T/#m8ee60ae69db5e9eb06ca7999c43828d49ccb9626


Sudarshan Rajagopalan (1):
  arm64/sparsemem: reduce SECTION_SIZE_BITS

 arch/arm64/include/asm/sparsemem.h | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

Comments

Will Deacon Jan. 21, 2021, 6:26 p.m. UTC | #1
On Wed, 20 Jan 2021 21:29:12 -0800, Sudarshan Rajagopalan wrote:
> This patch is the follow-up from the discussions in the thread [1].
> Reducing the section size has the merit of reducing wastage of reserved memory
> for vmmemmap mappings for sections with large memory holes. Also with smaller
> section size gives more grunularity and agility for memory hot(un)plugging.
> 
> But there are also constraints in reducing SECTION_SIZE_BIT:
> 
> [...]

Applied to arm64 (for-next/misc), thanks!

[1/1] arm64/sparsemem: reduce SECTION_SIZE_BITS
      https://git.kernel.org/arm64/c/f0b13ee23241

Cheers,
Pasha Tatashin Jan. 29, 2021, 12:17 a.m. UTC | #2
On 1/21/21 1:26 PM, Will Deacon wrote:
> On Wed, 20 Jan 2021 21:29:12 -0800, Sudarshan Rajagopalan wrote:
>> This patch is the follow-up from the discussions in the thread [1].
>> Reducing the section size has the merit of reducing wastage of reserved memory
>> for vmmemmap mappings for sections with large memory holes. Also with smaller
>> section size gives more grunularity and agility for memory hot(un)plugging.
>>
>> But there are also constraints in reducing SECTION_SIZE_BIT:
>>
>> [...]
> 
> Applied to arm64 (for-next/misc), thanks!

We have been using 128M for 4K pages for a while, using patch [1] without issues.

One thing that needs to be also modified is makedumpfile [2]- line 76, must update it SECTIONS_SIZE_BITS based on the PAGESIZE.

[1] https://lore.kernel.org/lkml/20190423203843.2898-1-pasha.tatashin@soleen.com/
[2] https://sourceforge.net/p/makedumpfile/code/ci/master/tree/arch/arm64.c


> 
> [1/1] arm64/sparsemem: reduce SECTION_SIZE_BITS
>       https://git.kernel.org/arm64/c/f0b13ee23241
> 
> Cheers,
>