]> 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>
Fri, 17 Jan 2025 15:57:36 +0000 (16:57 +0100)
commitc50f6797af39c7b60c65b061a6a56c8eeb3c54b6
tree1e7cf1c04d96a1883cf861b2b80c3c6272208e4b
parent0de4dd47f35179de4d4dc516e8f57cde4314414c
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