linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] mm, slab, slub: remove cpu and memory hotplug locks
@ 2021-01-13 13:16 Vlastimil Babka
  2021-01-13 13:16 ` [PATCH 1/3] mm, slub: stop freeing kmem_cache_node structures on node offline Vlastimil Babka
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Vlastimil Babka @ 2021-01-13 13:16 UTC (permalink / raw)
  To: Andrew Morton, linux-mm
  Cc: linux-kernel, Christoph Lameter, Pekka Enberg, David Rientjes,
	Joonsoo Kim, Vladimir Davydov, Qian Cai, David Hildenbrand,
	Michal Hocko, Vlastimil Babka

Changes since RFC:
- lockdep didn't like reintroducing slab_mutex in kmem_cache_shrink(), so
  instead explain why it's not needed after all (in Patch 2)
- the above is only safe with Patch 1 already in place, so order it first
  (current Patch 1 was Patch 3 in RFC)

Some related work caused me to look at how we use get/put_mems_online() and
get/put_online_cpus() during kmem cache creation/descruction/shrinking, and
realize that it should be actually safe to remove all of that with rather small
effort (as e.g. Michal Hocko suspected in some of the past discussions
already). This has the benefit to avoid rather heavy locks that have caused
locking order issues already in the past. So this is the result, Patches 2 and
3 remove memory hotplug and cpu hotplug locking, respectively. Patch 1 is due
to realization that in fact some races exist despite the locks (even if not
removed), but the most sane solution is not to introduce more of them, but
rather accept some wasted memory in scenarios that should be rare anyway (full
memory hot remove), as we do the same in other contexts already.

Vlastimil Babka (3):
  mm, slub: stop freeing kmem_cache_node structures on node offline
  mm, slab, slub: stop taking memory hotplug lock
  mm, slab, slub: stop taking cpu hotplug lock

 mm/slab_common.c | 18 ++--------------
 mm/slub.c        | 56 +++++++++++++++++++++++++++++++-----------------
 2 files changed, 38 insertions(+), 36 deletions(-)

-- 
2.29.2



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-13 13:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-13 13:16 [PATCH 0/3] mm, slab, slub: remove cpu and memory hotplug locks Vlastimil Babka
2021-01-13 13:16 ` [PATCH 1/3] mm, slub: stop freeing kmem_cache_node structures on node offline Vlastimil Babka
2021-01-13 13:16 ` [PATCH 2/3] mm, slab, slub: stop taking memory hotplug lock Vlastimil Babka
2021-01-13 13:16 ` [PATCH 3/3] mm, slab, slub: stop taking cpu " Vlastimil Babka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).