From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1B73C2D0DB for ; Tue, 28 Jan 2020 18:13:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 84613214AF for ; Tue, 28 Jan 2020 18:13:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 84613214AF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0B7E06B0005; Tue, 28 Jan 2020 13:13:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 068666B0006; Tue, 28 Jan 2020 13:13:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E989D6B0007; Tue, 28 Jan 2020 13:13:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0250.hostedemail.com [216.40.44.250]) by kanga.kvack.org (Postfix) with ESMTP id D0DEA6B0005 for ; Tue, 28 Jan 2020 13:13:47 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 790AF8248D7C for ; Tue, 28 Jan 2020 18:13:47 +0000 (UTC) X-FDA: 76427841294.01.brick39_210becdee1238 X-HE-Tag: brick39_210becdee1238 X-Filterd-Recvd-Size: 4252 Received: from gentwo.org (gentwo.org [3.19.106.255]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Tue, 28 Jan 2020 18:13:46 +0000 (UTC) Received: by gentwo.org (Postfix, from userid 1002) id 916443F25D; Tue, 28 Jan 2020 18:13:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 9043D3F25C; Tue, 28 Jan 2020 18:13:46 +0000 (UTC) Date: Tue, 28 Jan 2020 18:13:46 +0000 (UTC) From: Christopher Lameter X-X-Sender: cl@www.lameter.com To: =?ISO-8859-15?Q?Michal_Koutn=FD?= cc: Andrew Morton , Michal Hocko , LKML , linux-mm@kvack.org Subject: Re: SLUB: purpose of sysfs events on cache creation/removal In-Reply-To: <20200128085107.GF17425@blackbody.suse.cz> Message-ID: References: <20191204173224.GN25242@dhcp22.suse.cz> <20200106115733.GH12699@dhcp22.suse.cz> <20200109145236.GS4951@dhcp22.suse.cz> <20200109114415.cf01bd3ad30c5c4aec981653@linux-foundation.org> <20200117171331.GA17179@blackbody.suse.cz> <20200118161528.94dc18c074aeaa384200486b@linux-foundation.org> <20200127173336.GB17425@blackbody.suse.cz> <20200128085107.GF17425@blackbody.suse.cz> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="531401748-1203551302-1580235226=:745" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --531401748-1203551302-1580235226=:745 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On Tue, 28 Jan 2020, Michal Koutn=FD wrote: > On Mon, Jan 27, 2020 at 11:04:53PM +0000, Christopher Lameter wrote: > > The patch exposes details of cgroup caches? Which patch are we talkin= g > > 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 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 Index: linux/mm/slub.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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 =3D { .release =3D kmem_cache_release, }; -static int uevent_filter(struct kset *kset, struct kobject *kobj) -{ - struct kobj_type *ktype =3D get_ktype(kobj); - - if (ktype =3D=3D &slab_ktype) - return 1; - return 0; -} - -static const struct kset_uevent_ops slab_uevent_ops =3D { - .filter =3D 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 =3D kset_create_and_add("slab", &slab_uevent_ops, kernel_kobj= ); + slab_kset =3D kset_create_and_add("slab", NULL, kernel_kobj); if (!slab_kset) { mutex_unlock(&slab_mutex); pr_err("Cannot register slab subsystem.\n"); --531401748-1203551302-1580235226=:745--