9-11 September 2019
Europe/Lisbon timezone

Memory management bits in arch/*

10 Sep 2019, 10:00
45m
Floriana/room-III (Corinthia Hotel Lisbon)

Floriana/room-III

Corinthia Hotel Lisbon

100
Kernel Summit talk Kernel Summit Track

Speaker

Mike Rapoport (IBM)

Description

There is a lot of similar and duplicated code in architecture specific
bits of memory management.

For instance, most architectures have

#define PGALLOC_GFP (GFP_KERNEL | __GFP_ZERO)

for allocating page table pages and many of them use similar, if not
identical, implementation of pte_alloc_one*().

But that's only the tip of the iceberg.

There are several early_alloc() or similarily called routines that do

if (slab_is_available())
    return kzalloc();
else
    return memblock_alloc();

Some other trivial examples are free_initmem(), free_initrd_mem()
which were nearly identical accross many architectures until very
recently.

More complex cases are per-cpu initialization, passing of memory topology
to the generic MM, reservation of crash kernel, mmap of vdso etc. They
are not really duplicated, but still are very similar in at least
several architectures.

While factoring out the common code is an obvious step to take, I
believe there is also room for refining arch <-> mm interface to avoid
adding extra HAVE_ARCH_NO_BOOTMEM^w^wWHAT_NOT and then searching for the
ways to get rid of them.

I agree to abide by the anti-harassment policy Yes

Primary author

Presentation Materials