mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [merged] fs-mm-account-filp-cache-to-kmemcg.patch removed from -mm tree
@ 2017-11-16 20:02 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2017-11-16 20:02 UTC (permalink / raw)
  To: gthelen, hannes, mhocko, mm-commits, shakeelb, vdavydov.dev, viro


The patch titled
     Subject: fs, mm: account filp cache to kmemcg
has been removed from the -mm tree.  Its filename was
     fs-mm-account-filp-cache-to-kmemcg.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Shakeel Butt <shakeelb@google.com>
Subject: fs, mm: account filp cache to kmemcg

The allocations from filp cache can be directly triggered by userspace
applications.  A buggy application can consume a significant amount of
unaccounted system memory.  Though we have not noticed such buggy
applications in our production but upon close inspection, we found that a
lot of machines spend very significant amount of memory on these caches.

One way to limit allocations from filp cache is to set system level limit
of maximum number of open files.  However this limit is shared between
different users on the system and one user can hog this resource.  To
cater that, we can charge filp to kmemcg and set the maximum limit very
high and let the memory limit of each user limit the number of files they
can open and indirectly limiting their allocations from filp cache.

One side effect of this change is that it will allow _sysctl() to return
ENOMEM and the man page of _sysctl() does not specify that.  However the
man page also discourages to use _sysctl() at all.

Link: http://lkml.kernel.org/r/20171011190359.34926-1-shakeelb@google.com
Signed-off-by: Shakeel Butt <shakeelb@google.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Greg Thelen <gthelen@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/file_table.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN fs/file_table.c~fs-mm-account-filp-cache-to-kmemcg fs/file_table.c
--- a/fs/file_table.c~fs-mm-account-filp-cache-to-kmemcg
+++ a/fs/file_table.c
@@ -312,7 +312,7 @@ void put_filp(struct file *file)
 void __init files_init(void)
 {
 	filp_cachep = kmem_cache_create("filp", sizeof(struct file), 0,
-			SLAB_HWCACHE_ALIGN | SLAB_PANIC, NULL);
+			SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT, NULL);
 	percpu_counter_init(&nr_files, 0, GFP_KERNEL);
 }
 
_

Patches currently in -mm which might be from shakeelb@google.com are

epoll-account-epitem-and-eppoll_entry-to-kmemcg.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-16 20:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-16 20:02 [merged] fs-mm-account-filp-cache-to-kmemcg.patch removed from -mm tree akpm

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).