Skip to content

RFC Per-container dcache management (and a bit more)

Pavel Emelyanov linux-fsdevel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest13 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13vfs: Lighten r/o rename_lock lockersfs/dcache.c include/linux/seqlock.h+29 -200 replies
2/13vfs: Factor out rename_lock lockingfs/dcache.c+6 -210 replies
3/13vfs: Make the rename_lock per-sbdrivers/staging/pohmelfs/path_entry.c fs/autofs4/waitq.c fs/dcache.c +5 more+44 -440 replies
4/13vfs: Factor out tree (of four) shrinkers codefs/dcache.c+130 -2350 replies
5/13vfs: Make dentry LRU list globalfs/dcache.c fs/super.c include/linux/fs.h+15 -1000 replies
6/13vfs: Turn the nr_dentry into percpu_counterfs/dcache.c include/linux/dcache.h+6 -130 replies
7/13vfs: Limit the number of dentries globallyfs/dcache.c+33 -80 replies
8/13vfs: Introduce the dentry mobsfs/dcache.c include/linux/dcache.h+33 -201 reply
9/13vfs: More than one mob managementfs/dcache.c include/linux/dcache.h+186 -10 replies
10/13vfs: Routnes for setting mob size and getting statsfs/dcache.c include/linux/dcache.h+37 -00 replies
11/13vfs: Make shrink_dcache_memory prune dcache from all mobsfs/dcache.c include/linux/dcache.h+35 -10 replies
12/13vfs: Mobs creation and mgmt APIfs/ioctl.c include/linux/fs.h+12 -00 replies
13/13vfs: Dentry mobs listing in procfs/dcache.c fs/proc/root.c include/linux/dcache.h+63 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC][PATCH 0/13] Per-container dcache management (and a bit more)

Hi.

According to the "release early, release often" strategy :) I'm glad to propose this scratch implementation of what I was talking about at the LSF - the way to limit the dcache grow for both containerized and not systems (the set applies to 2.6.38).

The first 5 patches are preparations for this, descriptive (I hope) comments are inside them.

The general idea of this set is -- make the dentries subtrees be limited in size and shrink them as they hit the configured limit.

Why subtrees? Because this lets having the [dentry -> group] reference without the reference count, letting the [dentry -> parent] one handle this.

Why limited? For containers the answer is simple -- a container should not be allowed to consume too much of the host memory. For non-containerized systems the answer is -- to protect the kernel from the non-privileged attacks on the dcache memory like the "while :; do mkdir x; cd x; done" one and similar.

What isn't in this patch yet, but should be done after the discussion

* API. I haven't managed to invent any perfect solution, and would really like to have it discussed. In order to be able to play with it the ioctls + proc for listing are proposed.

* New mounts management. Right now if you mount some new FS to a dentry which belongs to some managed set (I named it "mob" in this patchset), the new mount is managed with the system settings. This is not OK, the new mount should be managed with the settings of the mountpoint's mob.

* Elegant shrink_dcache_memory on global memory shortage. By now the code walks the mobs and shinks some equal amount of dentries from them. Better shrinking policy can and probably should be implemented.