Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp708226ybl; Wed, 4 Dec 2019 09:34:11 -0800 (PST) X-Google-Smtp-Source: APXvYqwno6IgMFJTMqPUHJfjWvkPsLMU3/hD3Mrq154X0khBPRCFOR60x+b+hZwa5y9ucB3OD89I X-Received: by 2002:a05:6830:1499:: with SMTP id s25mr3246591otq.223.1575480851279; Wed, 04 Dec 2019 09:34:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575480851; cv=none; d=google.com; s=arc-20160816; b=SgR7KjVqF6WLwGu4tRmwnr7B1fuuMnEsQ9YZM1BBL4W4Wwc5en6x995+yUeBsTWiRd JjX08LwShKZ/3z779gqFVRk1z2rHHutFTOrjE8/NxhsxR/WhVlZlPvsjZQ9c6yVbyhfV pOWK6HEwlgH8LxLOjp7zv08+hZLQJN5n+ikQQWnyP8Mxs+Th8iY/Jfi9nUjDOB1GTGXE /oMbWbPKD7ryIp5g7g8lcYV6VwxLac/RX7z3XEY6fKpFH25vYtUuIURtRiH9tW0TXjce EBL3V3bXVBBmKKUosIz/4BjPjodYkJPLvLbw+J1O+olbz4We2nz+MWMr8LyjeoI2Aj5a Czzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Da4Y4n3NMFC/79t5RanRXSUf1h1wEAGbNHxtuyP+xmM=; b=0jslGEzKhNofjO9W5Wz/BRI4+O8ssiOXHQ0euWbSk7ASxkso8e4r3ZfZyF9sY7S0hp pn2giNO+O6g68YXthsHaeX9UuOdPg7tUIQ32ZHOjfanYfIJ9XFx9NyrRrxw56w7iMoNE Q9++NTf1+uFUf7dvmZj+kbM8fKK9D1RFyTdAmpx7MDzctvA72USPguh7ESC7CZ0z1oXh RmTXdVib5/+ZsbisHL5gvR/ywe3uG29MqhzKG7xGxoWf+GUdubCjUGyjn81zCO5J2Qj4 ouFEDAF89+cCyCnDma+QRGDXV/VyVMNUP1x7VcnXSuMaAXUAB3AtZqvVi8zqqXDQn6wj 1sqg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a10si3476346oid.244.2019.12.04.09.33.58; Wed, 04 Dec 2019 09:34:11 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728224AbfLDRc3 (ORCPT + 99 others); Wed, 4 Dec 2019 12:32:29 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:35572 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726934AbfLDRc3 (ORCPT ); Wed, 4 Dec 2019 12:32:29 -0500 Received: by mail-wm1-f68.google.com with SMTP id u8so655939wmu.0 for ; Wed, 04 Dec 2019 09:32:27 -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=Z94DkfufL6HVtq5BV+uU20SpiNvgoUy4yY7ngu6G+RM2sQ61nJWU0ONGFvbdr3OHma 1b2mX5hK51qYdj2ZJoQOaVqYP/s3a3LWaCAcXBfcarUlEgBlLeR1ca1g05W+pqZLpqQX lWi5zlONVDlMnk4ggJvH9UWRudA3BA80Zg6mupRiQF/DEJFAdUfClAPcKJnV3nVFu4SZ NAfasXzjoMYKW+qu6iRGTRSnR1RRkwv2q8qEApfbaoOd6/m7hLTApOmGpU4q9KS7AkPY ApgF91e03Pog4Fj7AQrsNtW45l4Hudi/0bq+ptZgPsFb9eTnK+NZF8zdQDAOFtPKDbn9 ZPYA== X-Gm-Message-State: APjAAAUz+FIOhU3zE38p6iL47nPNqRSQ/cxD0F+LvetWWgC/72txAOpy y1oyhWsX5aqF5luDi46Okes= 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [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