]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm, vma: use sheaves for vm_area_struct cache
authorVlastimil Babka <vbabka@suse.cz>
Wed, 10 Jul 2024 14:13:19 +0000 (16:13 +0200)
committerVlastimil Babka <vbabka@suse.cz>
Tue, 12 Nov 2024 16:19:14 +0000 (17:19 +0100)
commitb38c6352b599efab37659ee725290b5417086cb7
tree77543e8874a40b17f4f9e5c24bec20e6188b21cb
parent71e9a5e25b918e73eec6a2ebf9c8cb7d017956de
mm, vma: use sheaves for vm_area_struct cache

Create the vm_area_struct cache with percpu sheaves of size 32 to
hopefully improve its performance. For CONFIG_PER_VMA_LOCK, change the
vma freeing from custom call_rcu() callback to kfree_rcu() which
will perform rcu_free sheaf batching. Since there may be additional
structures attached and they are freed only after the grace period,
create a __vma_area_rcu_free_dtor() to do that.

Note I have not investigated whether vma_numab_state_free() or
free_anon_vma_name() must really need to wait for the grace period. For
vma_lock_free() ideally we wouldn't free it at all when freeing the vma
to the sheaf (or even slab page), but that would require using also a
ctor for vmas to allocate the vma lock, and reintroducing dtor support
for deallocating the lock when freeing slab pages containing the vmas.

The plan is to move vma_lock into vma itself anyway, so if the rest can
be freed immediately, the whole destructor support won't be needed
anymore.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
kernel/fork.c