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=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 7DB55C433DF for ; Tue, 2 Jun 2020 04:45:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4297420734 for ; Tue, 2 Jun 2020 04:45:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZYRFr9Vm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4297420734 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DA5358000F; Tue, 2 Jun 2020 00:45:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D51C58000D; Tue, 2 Jun 2020 00:45:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C92478000F; Tue, 2 Jun 2020 00:45:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0009.hostedemail.com [216.40.44.9]) by kanga.kvack.org (Postfix) with ESMTP id ABFF08000D for ; Tue, 2 Jun 2020 00:45:52 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 749F52471 for ; Tue, 2 Jun 2020 04:45:52 +0000 (UTC) X-FDA: 76883034144.04.scent76_16234ec8d5622 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id 59205800574A for ; Tue, 2 Jun 2020 04:45:52 +0000 (UTC) X-HE-Tag: scent76_16234ec8d5622 X-Filterd-Recvd-Size: 4020 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Tue, 2 Jun 2020 04:45:51 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F21ED2074B; Tue, 2 Jun 2020 04:45:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591073151; bh=pSPIzpvnf8ndxE3gmqWmaoFCONlhbBHB29ux5z8S+Pk=; h=Date:From:To:Subject:In-Reply-To:From; b=ZYRFr9Vm3GDNESZ0Z9C7vzwHu4AuwXTj/7aBeDd7qlKwEbwSieIUS2aNotQ+ZFqkL KS7qBjC387g3ZsPSDGPWGt8jC5o2kAbvheHy7K1QwU8C7IG0C3WQjKHqCfVvEYOj17 CQXAQC3SxdGFHLTXi0sdnP7YX8HYhGPvU/IsejA4= Date: Mon, 01 Jun 2020 21:45:50 -0700 From: Andrew Morton To: akpm@linux-foundation.org, cl@linux.com, iamjoonsoo.kim@lge.com, linux-mm@kvack.org, mkoutny@suse.com, mm-commits@vger.kernel.org, penberg@kernel.org, rientjes@google.com, torvalds@linux-foundation.org, vbabka@suse.cz Subject: [patch 009/128] slub: Remove userspace notifier for cache add/remove Message-ID: <20200602044550.5r93m7jjY%akpm@linux-foundation.org> In-Reply-To: <20200601214457.919c35648e96a2b46b573fe1@linux-foundation.org> User-Agent: s-nail v14.8.16 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 59205800574A X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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: =46rom: Christoph Lameter Subject: slub: Remove userspace notifier for cache add/remove I came across some unnecessary uevents once again which reminded me this.= =20 The patch seems to be lost in the leaves of the original discussion [1], so resending. [1] https://lore.kernel.org/r/alpine.DEB.2.21.2001281813130.745@www.lameter= .com 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. Link: http://lkml.kernel.org/r/20200423115721.19821-1-mkoutny@suse.com Signed-off-by: Christoph Lameter Acked-by: Vlastimil Babka Acked-by: Michal Koutn=C3=BD Acked-by: David Rientjes Cc: Pekka Enberg Cc: Joonsoo Kim Signed-off-by: Andrew Morton --- mm/slub.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) --- a/mm/slub.c~slub-remove-userspace-notifier-for-cache-add-remove +++ a/mm/slub.c @@ -5715,19 +5715,6 @@ static struct kobj_type slab_ktype =3D { .release =3D kmem_cache_release, }; =20 -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; =20 static inline struct kset *cache_kset(struct kmem_cache *s) @@ -5795,7 +5782,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); } @@ -5853,7 +5839,6 @@ static int sysfs_slab_add(struct kmem_ca } #endif =20 - kobject_uevent(&s->kobj, KOBJ_ADD); if (!unmergeable) { /* Setup first alias */ sysfs_slab_alias(s, s->name); @@ -5934,7 +5919,7 @@ static int __init slab_sysfs_init(void) =20 mutex_lock(&slab_mutex); =20 - 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"); _