From: Christopher Lameter <cl@linux.com>
To: "Michal Koutný" <mkoutny@suse.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-mm@kvack.org
Subject: Re: SLUB: purpose of sysfs events on cache creation/removal
Date: Tue, 28 Jan 2020 18:13:46 +0000 (UTC) [thread overview]
Message-ID: <alpine.DEB.2.21.2001281813130.745@www.lameter.com> (raw)
In-Reply-To: <20200128085107.GF17425@blackbody.suse.cz>
[-- Attachment #1: Type: text/plain, Size: 2224 bytes --]
On Tue, 28 Jan 2020, Michal Koutný wrote:
> On Mon, Jan 27, 2020 at 11:04:53PM +0000, Christopher Lameter <cl@linux.com> wrote:
> > The patch exposes details of cgroup caches? Which patch are we talking
> > about?
> Sorry, that's misunderstanding. I mean the current state (sending
> uevents) exposes the internals (creation of caches per cgroup). The
> patch [1] removing uevent notifications is rectifying it.
From: Christoph Lameter <cl@linux.com>
Subject: slub: Remove userspace notifier for cache add/remove
Kmem caches are internal kernel structures so it is strange that
userspace notifiers would be needed. And I am not aware of any use
of these notifiers. These notifiers may just exist because in the
initial slub release the sysfs code was copied from another
subsystem.
Signed-off-by: Christoph Lameter <cl@linux.com>
Index: linux/mm/slub.c
===================================================================
--- linux.orig/mm/slub.c 2020-01-28 18:13:02.134506141 +0000
+++ linux/mm/slub.c 2020-01-28 18:13:02.134506141 +0000
@@ -5632,19 +5632,6 @@ static struct kobj_type slab_ktype = {
.release = kmem_cache_release,
};
-static int uevent_filter(struct kset *kset, struct kobject *kobj)
-{
- struct kobj_type *ktype = get_ktype(kobj);
-
- if (ktype == &slab_ktype)
- return 1;
- return 0;
-}
-
-static const struct kset_uevent_ops slab_uevent_ops = {
- .filter = uevent_filter,
-};
-
static struct kset *slab_kset;
static inline struct kset *cache_kset(struct kmem_cache *s)
@@ -5712,7 +5699,6 @@ static void sysfs_slab_remove_workfn(str
#ifdef CONFIG_MEMCG
kset_unregister(s->memcg_kset);
#endif
- kobject_uevent(&s->kobj, KOBJ_REMOVE);
out:
kobject_put(&s->kobj);
}
@@ -5770,7 +5756,6 @@ static int sysfs_slab_add(struct kmem_ca
}
#endif
- kobject_uevent(&s->kobj, KOBJ_ADD);
if (!unmergeable) {
/* Setup first alias */
sysfs_slab_alias(s, s->name);
@@ -5851,7 +5836,7 @@ static int __init slab_sysfs_init(void)
mutex_lock(&slab_mutex);
- slab_kset = kset_create_and_add("slab", &slab_uevent_ops, kernel_kobj);
+ slab_kset = kset_create_and_add("slab", NULL, kernel_kobj);
if (!slab_kset) {
mutex_unlock(&slab_mutex);
pr_err("Cannot register slab subsystem.\n");
next prev parent reply other threads:[~2020-01-28 18:13 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-26 12:19 SLUB: purpose of sysfs events on cache creation/removal Michal Hocko
2019-11-26 16:32 ` Christopher Lameter
2019-11-26 16:54 ` Michal Hocko
2019-11-27 15:40 ` Christopher Lameter
2019-11-27 16:24 ` Michal Hocko
2019-11-27 16:26 ` Christopher Lameter
2019-11-27 17:43 ` Michal Hocko
2019-12-04 13:28 ` Michal Hocko
2019-12-04 15:25 ` Christopher Lameter
2019-12-04 15:32 ` Michal Hocko
2019-12-04 16:53 ` Christopher Lameter
2019-12-04 17:32 ` Michal Hocko
2020-01-06 11:57 ` Michal Hocko
2020-01-06 15:51 ` Christopher Lameter
2020-01-06 15:51 ` Christopher Lameter
2020-01-09 14:52 ` Michal Hocko
2020-01-09 19:44 ` Andrew Morton
2020-01-09 20:13 ` Michal Hocko
2020-01-09 20:15 ` Michal Hocko
2020-01-17 17:13 ` Michal Koutný
2020-01-19 0:15 ` Andrew Morton
2020-01-27 17:33 ` Michal Koutný
2020-01-27 23:04 ` Christopher Lameter
2020-01-27 23:04 ` Christopher Lameter
2020-01-28 8:51 ` Michal Koutný
2020-01-28 18:13 ` Christopher Lameter [this message]
2020-01-28 18:13 ` Christopher Lameter
2020-01-30 13:16 ` Vlastimil Babka
2020-01-09 14:07 ` Vlastimil Babka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.21.2001281813130.745@www.lameter.com \
--to=cl@linux.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=mkoutny@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.