+ mm-slab-memcg_link-the-slabs-kmem_cache.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm, slab: memcg_link the SLAB's kmem_cache
has been added to the -mm tree.  Its filename is
     mm-slab-memcg_link-the-slabs-kmem_cache.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-slab-memcg_link-the-slabs-kmem_cache.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-slab-memcg_link-the-slabs-kmem_cache.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Shakeel Butt <shakeelb@xxxxxxxxxx>
Subject: mm, slab: memcg_link the SLAB's kmem_cache

All the root caches are linked into slab_root_caches which was introduced
by the commit 510ded33e075 ("slab: implement slab_root_caches list") but
it missed to add the SLAB's kmem_cache.

While experimenting with opt-in/opt-out kmem accounting, I noticed system
crashes due to NULL dereference inside cache_from_memcg_idx() while
deferencing kmem_cache.memcg_params.memcg_caches.  The upstream clean
kernel will not see these crashes but SLAB should be consistent with SLUB
which does linked its boot caches (kmem_cache_node and kmem_cache) into
slab_root_caches.

Link: http://lkml.kernel.org/r/20180319210020.60289-1-shakeelb@xxxxxxxxxx
Fixes: 510ded33e075c ("slab: implement slab_root_caches list")
Signed-off-by: Shakeel Butt <shakeelb@xxxxxxxxxx>
Cc: Tejun Heo <tj@xxxxxxxxxx>
Cc: Vladimir Davydov <vdavydov.dev@xxxxxxxxx>
Cc: Greg Thelen <gthelen@xxxxxxxxxx>
Cc: Christoph Lameter <cl@xxxxxxxxx>
Cc: Pekka Enberg <penberg@xxxxxxxxxx>
Cc: David Rientjes <rientjes@xxxxxxxxxx>
Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx>
Cc: Johannes Weiner <hannes@xxxxxxxxxxx>
Cc: Michal Hocko <mhocko@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/slab.c |    1 +
 1 file changed, 1 insertion(+)

diff -puN mm/slab.c~mm-slab-memcg_link-the-slabs-kmem_cache mm/slab.c
--- a/mm/slab.c~mm-slab-memcg_link-the-slabs-kmem_cache
+++ a/mm/slab.c
@@ -1283,6 +1283,7 @@ void __init kmem_cache_init(void)
 				  nr_node_ids * sizeof(struct kmem_cache_node *),
 				  SLAB_HWCACHE_ALIGN, 0, 0);
 	list_add(&kmem_cache->list, &slab_caches);
+	memcg_link_cache(kmem_cache);
 	slab_state = PARTIAL;
 
 	/*
_

Patches currently in -mm which might be from shakeelb@xxxxxxxxxx are

mm-slab-memcg_link-the-slabs-kmem_cache.patch
slab-slub-remove-size-disparity-on-debug-kernel.patch
mm-memcg-remote-memcg-charging-for-kmem-allocations.patch
fs-fsnotify-account-fsnotify-metadata-to-kmemcg.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux