Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp694446ybl; Tue, 28 Jan 2020 10:16:06 -0800 (PST) X-Google-Smtp-Source: APXvYqysEmbpTnLQ7DJTxrObF8CVF2M0uf069VZwJRsQbfZcNVdjbmG8SgZGLNfo7jt6BuZE8bSS X-Received: by 2002:aca:f411:: with SMTP id s17mr3831904oih.177.1580235365914; Tue, 28 Jan 2020 10:16:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580235365; cv=none; d=google.com; s=arc-20160816; b=N8OzHgtAMdL2P5mK/T5RgTSobgwNoGAKzc+n3KWdvuxqp68XlFNCXJ5JdolTm1unfl YxK0OXKggxV1U5orVEk+7DXw/N3jVKLPhMsAxkgpy+4CfovyoTVObLR/IbkSH2VkpkUZ srRpoaDyEI6skZ7RiPZpaaVH7NTsDIhNsSvh6G9Jl7DdzRJTaUbnerVQxDBYF1Ow2o+I jV97c0BDrcDrl8vf4blGJCiCxiyjJh/Vg9qDOkMmkBYY05pEq/fh+M1RORFEZd7E3axk Vk64vJAPHf9vjZ3YvQBR+Je1WFn8ENID2NdV3whbnSAvd1dqKXaaOp3ThLjPWZWDYIqO lDkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=cZo06CLZKk6RCowOb+PBAa3HT82xhBb/fshlElVCF4E=; b=KVUh8YtWGafLlUUL48oZBHK/8vsnbAzxHD51tlb/+C1ItJb0soKZcxFx5Jgdi0yxlp dICUyrXPY/6GjEHS+kXZ0I+wAsJUYnY0VmR1tArR2PppHNbRToXEc0ipTj7TEb+ylKAC yZ6SPRRsyaFuJVbn3PknQ2UTH8y+qBTNsf+vbZE+SZJheRfR9aRYfIp7B+QQLVnaW2Gi 8PAnPcGOPIn8pdQH7X5ppwMK3jREBOHXUiOr9ikQlEql0TbZB2zuc0bRtzDQtX3tbAyr EM+w6a8l6910l6enMxZnjQ5KociYYiuwCJYkdCLw26BekvHz+CuUtRKYNdlQXTOkNyQ6 93Bw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f60si8231232otf.119.2020.01.28.10.15.53; Tue, 28 Jan 2020 10:16:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726725AbgA1SNr (ORCPT + 99 others); Tue, 28 Jan 2020 13:13:47 -0500 Received: from gentwo.org ([3.19.106.255]:56214 "EHLO gentwo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726318AbgA1SNr (ORCPT ); Tue, 28 Jan 2020 13:13:47 -0500 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: 8BIT On Tue, 28 Jan 2020, Michal Koutn? 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 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 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 =================================================================== --- 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"); --531401748-1203551302-1580235226=:745--