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.5 required=3.0 tests=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 5BD10C43603 for ; Wed, 4 Dec 2019 17:32:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F4149207DD for ; Wed, 4 Dec 2019 17:32:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F4149207DD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5F8AA6B0BBB; Wed, 4 Dec 2019 12:32:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5A9036B0BBC; Wed, 4 Dec 2019 12:32:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4706D6B0BBD; Wed, 4 Dec 2019 12:32:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0139.hostedemail.com [216.40.44.139]) by kanga.kvack.org (Postfix) with ESMTP id 2DB646B0BBB for ; Wed, 4 Dec 2019 12:32:29 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id DBAE1441C for ; Wed, 4 Dec 2019 17:32:28 +0000 (UTC) X-FDA: 76228153176.25.soda98_6ce8a9d861162 X-HE-Tag: soda98_6ce8a9d861162 X-Filterd-Recvd-Size: 5127 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Wed, 4 Dec 2019 17:32:28 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id p9so596504wmc.2 for ; Wed, 04 Dec 2019 09:32:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Da4Y4n3NMFC/79t5RanRXSUf1h1wEAGbNHxtuyP+xmM=; b=spTmyqnGrqDuexmNMDY5HwwBknc/zZh/5Tmzwq0kHeCb0p3qJHvVb6pOlIgOq7DB8d eCe96eIKEqkSGY3maKkaKv++LCSvZsNNH8VvCkMcmbInr2FGv/GO9nJP6MQWHWe8+AY2 +WNx+FsnSVjXyMxvIxw1aSP4L1kZLz/vhXJ5+R1oMVxByHMhkBxrGfY6FWvb75kxhdqZ U6ALZsadvRWma8qTqEM0OSXRFUHpsq+g4TfcJYwnfV/NjaJ5S4l9wkoLNY2lvhGfE8R7 1obQR9V0iSoHyhUb3v87/ZluJnPvuMOVFffolEy5Ru8QAS6jpi/BZB8T7jaPXITqOWvO Epvw== X-Gm-Message-State: APjAAAU8MMGaN7S0qVdQXKiSYquyn6dlpcnwuvOtBJ1V2RAtK914hh/Q LbNuAOv3F6UEkXaGKrp4lRk= X-Google-Smtp-Source: APXvYqz2+J1w4/+Mka97KTYvxkWaEPcEfNDGA9xqF4/DUTq+CSCHZZfIrpdSQSf8NDotGd4eWrU1Kw== X-Received: by 2002:a1c:1dd3:: with SMTP id d202mr677882wmd.130.1575480747146; Wed, 04 Dec 2019 09:32:27 -0800 (PST) Received: from localhost (ip-37-188-170-11.eurotel.cz. [37.188.170.11]) by smtp.gmail.com with ESMTPSA id c9sm6995939wmc.47.2019.12.04.09.32.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Dec 2019 09:32:26 -0800 (PST) Date: Wed, 4 Dec 2019 18:32:24 +0100 From: Michal Hocko To: Christopher Lameter Cc: LKML , linux-mm@kvack.org, Andrew Morton Subject: Re: SLUB: purpose of sysfs events on cache creation/removal Message-ID: <20191204173224.GN25242@dhcp22.suse.cz> References: <20191126165420.GL20912@dhcp22.suse.cz> <20191127162400.GT20912@dhcp22.suse.cz> <20191127174317.GD26807@dhcp22.suse.cz> <20191204132812.GF25242@dhcp22.suse.cz> <20191204153225.GM25242@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) 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: [Cc akpm - the email thread starts http://lkml.kernel.org/r/20191126121901.GE20912@dhcp22.suse.cz] On Wed 04-12-19 16:53:47, Cristopher Lameter wrote: > On Wed, 4 Dec 2019, Michal Hocko wrote: > > > As I've said I believe it is quite risky. But if you as a maintainer > > believe this is the right thing to do I will not object. Care to send a > > patch? > > 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 2019-12-02 15:13:23.948312925 +0000 > +++ linux/mm/slub.c 2019-12-04 16:32:34.648550310 +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"); -- Michal Hocko SUSE Labs