slab: use memcg_kmem_cache_wq for slab destruction operations
authorTejun Heo <[email protected]>
Wed, 22 Feb 2017 23:41:36 +0000 (15:41 -0800)
committerLinus Torvalds <[email protected]>
Thu, 23 Feb 2017 00:41:27 +0000 (16:41 -0800)
commit17cc4dfeda97636d67e83de8cd41940b65a93bc7
treef260f03ae6ec4feee0bd0e84d39d38f93158eb2b
parent50862ce711b3e9cf8511df7a356892e128b037d3
slab: use memcg_kmem_cache_wq for slab destruction operations

If there's contention on slab_mutex, queueing the per-cache destruction
work item on the system_wq can unnecessarily create and tie up a lot of
kworkers.

Rename memcg_kmem_cache_create_wq to memcg_kmem_cache_wq and make it
global and use that workqueue for the destruction work items too.  While
at it, convert the workqueue from an unbound workqueue to a per-cpu one
with concurrency limited to 1.  It's generally preferable to use per-cpu
workqueues and concurrency limit of 1 is safe enough.

This is suggested by Joonsoo Kim.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Tejun Heo <[email protected]>
Reported-by: Jay Vana <[email protected]>
Acked-by: Vladimir Davydov <[email protected]>
Cc: Christoph Lameter <[email protected]>
Cc: Pekka Enberg <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Joonsoo Kim <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/memcontrol.h
mm/memcontrol.c
mm/slab_common.c