Skip to content

kmemcg shrinkers

Vladimir Davydov linux-mm lkml 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v15 Latest13 patches 8 repliesIn review
  2. v1418 patches 10 repliesSuperseded
  3. v1316 patches 19 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v1218 patches19 repliesSuperseded
v11 posting 2/215 patches10 repliesSuperseded
v11 posting 1/215 patches1 replySuperseded

Changes in v15 from the cover letter

- remove patches that have been merged to -mm;
- fix memory barrier usage in per-memcg list_lru implementation;
- fix list_lru_destroy(), which might sleep for per-memcg lrus, called from atomic context (__put_super()).

Patches in v15 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13memcg: make cache index determination more robustmm/memcontrol.c+3 -10 replies
2/13memcg: consolidate callers of memcg_cache_idmm/memcontrol.c+31 -170 replies
3/13memcg: move initialization to memcg creationmm/memcontrol.c+3 -20 replies
4/13memcg: make for_each_mem_cgroup macros publicinclude/linux/memcontrol.h mm/memcontrol.c+15 -150 replies
5/13list_lru, shrinkers: introduce list_lru_shrink_{count,walk}fs/dcache.c fs/gfs2/quota.c fs/inode.c +5 more+47 -390 replies
6/13fs: consolidate {nr,free}_cached_objects args in shrink_controlfs/super.c fs/xfs/xfs_super.c include/linux/fs.h+13 -120 replies
7/13fs: do not call destroy_super() in atomic contextfs/super.c include/linux/fs.h+11 -10 replies
8/13vmscan: shrink slab on memcg pressureinclude/linux/memcontrol.h include/linux/shrinker.h mm/memcontrol.c +1 more+141 -220 replies
9/13list_lru: add per-memcg listsinclude/linux/list_lru.h include/linux/memcontrol.h mm/list_lru.c +1 more+511 -710 replies
10/13fs: make shrinker memcg awarefs/super.c+3 -30 replies
11/13memcg: flush memcg items upon memcg destructionmm/memcontrol.c+28 -00 replies
12/13vmpressure: in-kernel notificationsinclude/linux/vmpressure.h mm/vmpressure.c+55 -30 replies
13/13memcg: reap dead memcgs upon global memory pressuremm/memcontrol.c+79 -30 replies

Reviews trailers per patch

1 of 13 patches has a Reviewed-by or Acked-by.

PatchAnton VorontsovPekka EnbergGreg Thelen
1/13
2/13
3/13
4/13
5/13
6/13
7/13
8/13
9/13
10/13
11/13
12/13A-b A-b R-b
13/13

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v15 thread

Cover letter [PATCH -mm v15 00/13] kmemcg shrinkers

Hi,

This is the 15th iteration of Glauber Costa's patch-set implementing slab shrinking on memcg pressure. The main idea is to make the list_lru structure used by most FS shrinkers per-memcg. When adding or removing an element from a list_lru, we use the page information to figure out which memcg it belongs to and relay it to the appropriate list. This allows scanning kmem objects accounted to different memcgs independently.

Please note that this patch-set implements slab shrinking only when we hit the user memory limit so that kmem allocations will still fail if we are below the user memory limit, but close to the kmem limit. I am going to fix this in a separate patch-set, but currently it is only worthwhile setting the kmem limit to be greater than the user mem limit just to enable per-memcg slab accounting and reclaim.

The patch-set is based on top of v3.14-rc1-mmots-2014-02-04-16-48 (there are some vmscan cleanups that I need committed there) and organized as follows:
- patches 1-4 introduce some minor changes to memcg needed for this set;
- patches 5-7 prepare fs for per-memcg list_lru;
- patch 8 implement kmemcg reclaim core;
- patch 9 make list_lru per-memcg and patch 10 marks sb shrinker memcg-aware;
- patch 10 is trivial - it issues shrinkers on memcg destruction;
- patches 12 and 13 introduce shrinking of dead kmem caches to facilitate memcg destruction.

Changes in v15:
- remove patches that have been merged to -mm;
- fix memory barrier usage in per-memcg list_lru implementation;
- fix list_lru_destroy(), which might sleep for per-memcg lrus, called from atomic context (__put_super()).

Previous iterations of this patch-set can be found here:
- https://lkml.org/lkml/2013/12/16/206 (v14)
- https://lkml.org/lkml/2013/12/9/103 (v13)
- https://lkml.org/lkml/2013/12/2/141 (v12)
- https://lkml.org/lkml/2013/11/25/214 (v11)

Comments are highly appreciated.

Thanks.

Glauber Costa (6):
memcg: make cache index determination more robust
memcg: consolidate callers of memcg_cache_id
memcg: move initialization to memcg creation
memcg: flush memcg items upon memcg destruction
vmpressure: in-kernel notifications
memcg: reap dead memcgs upon global memory pressure

Vladimir Davydov (7):
memcg: make for_each_mem_cgroup macros public list_lru, shrinkers: introduce list_lru_shrink_{count,walk}
fs: consolidate {nr,free}_cached_objects args in shrink_control
fs: do not call destroy_super() in atomic context
vmscan: shrink slab on memcg pressure
list_lru: add per-memcg lists
fs: make shrinker memcg aware

 fs/dcache.c                |   14 +-
 fs/gfs2/quota.c            |    6 +-
 fs/inode.c                 |    7 +-
 fs/internal.h              |    7 +-
 fs/super.c                 |   44 ++---
 fs/xfs/xfs_buf.c           |    7 +-
 fs/xfs/xfs_qm.c            |    7 +-
 fs/xfs/xfs_super.c         |    7 +-
 include/linux/fs.h         |    8 +-
 include/linux/list_lru.h   |  112 ++++++++++---
 include/linux/memcontrol.h |   50 ++++++
 include/linux/shrinker.h   |   10 +-
 include/linux/vmpressure.h |    5 +
 mm/list_lru.c              |  271 +++++++++++++++++++++++++++---
 mm/memcontrol.c            |  399 ++++++++++++++++++++++++++++++++++++++------
 mm/vmpressure.c            |   53 +++++-
 mm/vmscan.c                |   94 ++++++++---
 17 files changed, 926 insertions(+), 175 deletions(-)
Signature · 7 lines
1.7.10.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>