Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1743488ybl; Thu, 30 Jan 2020 05:19:10 -0800 (PST) X-Google-Smtp-Source: APXvYqz/S2kiMO9OmcMkMPlb/lfoON+u0qEHL0W/uxr2bODDTvAV7YpPLhZJBQW1EsVQ7No+2sy6 X-Received: by 2002:a05:6830:1d59:: with SMTP id p25mr3598213oth.308.1580390349892; Thu, 30 Jan 2020 05:19:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580390349; cv=none; d=google.com; s=arc-20160816; b=QFLMBV2Rk4huFeovg/IlsphEJtFK7XCQqsjgBTcGNV1OnnlfjVVdw/K941zSnh9Gts 8tNghUgnJ0t48Na6vxJykbC+HC9+D3QYxRXyDbZVafolMC3yqdKSQWk0FPcPt7+7TjgA Cc+rrOgUpONhg7A7EEXaunUJocAXxPviOKSlCA4FxaH4JuPDjPsG0oI1bHGY7FxM+vaz 1eKpnIf/SCtqdEBkGlkOLHJeU5KebBWn3jQ9IKxbLTYQ9peMNgrZ+qLeeB5wW/dhvXs3 +LsnMzZL/6tnrjDXKBNB7DOyKcIfLu5JCkL3AMWObmdPEuxTnI1N2EcJ5bULj/SrsGLx 253Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject; bh=zgwhuRlq7o1eBzzZzYRCkYyRiNrCwNXSUbwycFV/pHE=; b=waTYamznaJ7J4u/ebUvX1AZPxBigBZa6j3Im4ewm6hZHaH+91PeYb8IHkYErAdNd5D qRUr5EiOanMqE/U2nVeYZVPBAclXJm6ZNboExCniK92olSEFaZG5Xei1UCCGKoUVob2G 9GEWh16/+AmJguotvRqDZRtZQTBWGrl7zy234+h8UVSXu4ET7iPzAEZ0zYGtyrMLfXmh 1pqxWFMIY+IkIxjl0CSwwm8T80vHdlTrsjbiqcSta+3P9ukZnxdF8bXTiQIOLsUC6gLC uI7cvphMR+cAgaEDYImiAUguHP19gghSrW9fF4l0ZEQvVvUkRJ/sLnDuXuVsEjIV/dTu YX5A== 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 l17si3052629otk.218.2020.01.30.05.18.56; Thu, 30 Jan 2020 05:19:09 -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 S1727322AbgA3NQi (ORCPT + 99 others); Thu, 30 Jan 2020 08:16:38 -0500 Received: from mx2.suse.de ([195.135.220.15]:49944 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727193AbgA3NQi (ORCPT ); Thu, 30 Jan 2020 08:16:38 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 20EC1AC24; Thu, 30 Jan 2020 13:16:35 +0000 (UTC) Subject: Re: SLUB: purpose of sysfs events on cache creation/removal To: Christopher Lameter , =?UTF-8?Q?Michal_Koutn=c3=bd?= Cc: Andrew Morton , Michal Hocko , LKML , linux-mm@kvack.org 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> From: Vlastimil Babka Autocrypt: addr=vbabka@suse.cz; prefer-encrypt=mutual; keydata= mQINBFZdmxYBEADsw/SiUSjB0dM+vSh95UkgcHjzEVBlby/Fg+g42O7LAEkCYXi/vvq31JTB KxRWDHX0R2tgpFDXHnzZcQywawu8eSq0LxzxFNYMvtB7sV1pxYwej2qx9B75qW2plBs+7+YB 87tMFA+u+L4Z5xAzIimfLD5EKC56kJ1CsXlM8S/LHcmdD9Ctkn3trYDNnat0eoAcfPIP2OZ+ 9oe9IF/R28zmh0ifLXyJQQz5ofdj4bPf8ecEW0rhcqHfTD8k4yK0xxt3xW+6Exqp9n9bydiy tcSAw/TahjW6yrA+6JhSBv1v2tIm+itQc073zjSX8OFL51qQVzRFr7H2UQG33lw2QrvHRXqD Ot7ViKam7v0Ho9wEWiQOOZlHItOOXFphWb2yq3nzrKe45oWoSgkxKb97MVsQ+q2SYjJRBBH4 8qKhphADYxkIP6yut/eaj9ImvRUZZRi0DTc8xfnvHGTjKbJzC2xpFcY0DQbZzuwsIZ8OPJCc LM4S7mT25NE5kUTG/TKQCk922vRdGVMoLA7dIQrgXnRXtyT61sg8PG4wcfOnuWf8577aXP1x 6mzw3/jh3F+oSBHb/GcLC7mvWreJifUL2gEdssGfXhGWBo6zLS3qhgtwjay0Jl+kza1lo+Cv BB2T79D4WGdDuVa4eOrQ02TxqGN7G0Biz5ZLRSFzQSQwLn8fbwARAQABtCBWbGFzdGltaWwg QmFia2EgPHZiYWJrYUBzdXNlLmN6PokCVAQTAQoAPgIbAwULCQgHAwUVCgkICwUWAgMBAAIe AQIXgBYhBKlA1DSZLC6OmRA9UCJPp+fMgqZkBQJcbbyGBQkH8VTqAAoJECJPp+fMgqZkpGoP /1jhVihakxw1d67kFhPgjWrbzaeAYOJu7Oi79D8BL8Vr5dmNPygbpGpJaCHACWp+10KXj9yz fWABs01KMHnZsAIUytVs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0wrCoGDkWp4Bbv6jnF7zP Nzftr4l8RuJoywDIiJpdaNpSlXKpj/K6KrnyAI/joYc7 Message-ID: <57b0f41f-cb8c-c295-a0a0-5607d30ccf1f@suse.cz> Date: Thu, 30 Jan 2020 14:16:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=iso-8859-15 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/28/20 7:13 PM, Christopher Lameter wrote: > 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 Acked-by: Vlastimil Babka > 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"); >