Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2126807ybz; Thu, 23 Apr 2020 12:04:05 -0700 (PDT) X-Google-Smtp-Source: APiQypJnckTQq+l4nIB2YbB0ZXYORmqHrgcZ/bp/o14Bj38PwW6yNiv1rHHwjp1wep7OocW18UQv X-Received: by 2002:aa7:d60a:: with SMTP id c10mr4223972edr.66.1587668645390; Thu, 23 Apr 2020 12:04:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587668645; cv=none; d=google.com; s=arc-20160816; b=frOBqKVDyTxhflsMUVVaKri9fJ8ITKcj3QC51P+21+sgW0vC/3B33HQNI8ygudZou9 /qb+fT8wyv8yjf1oVsTTGOoTQpAa5W7LaXB6PDegJ65IhkdnR9M8vLNTqd9GlM1uhxyL DoMN5aVE5R149KereJ+8vq3MJrHxxtqqdlT6EKxJaehPr4uy1+zw3mR+blTPqVd8fVwz kwelnkxlRKodFQ7qh8FZ2SK/rcBN7XQftFMbr7ekrP2JCyTVMuj0oJ8O6w18ILC70t6I 5mW5rF3qgKIyJ48q5WgRhbfIQv/h2toBVF5/j7wgviPxorBUfir5uipfNBVSWDvqLnUc NSvw== 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:mime-version :message-id:date:subject:cc:to:from; bh=NI4o7qcdjGnb/mw6nxxlmYM5Dqq4AzmGpQIfS+32zpo=; b=xWK9dwDwHwaAjptW4KmGFS8e0sdzkLeW6NrSBWVurLjc/RzK+Ak3Hysi8KSJvoW1Wi JLS+IyHK+XHt66nk3iMpZ8GC04BSbxQ8HMlPdWPcIVz974GAeY2hW7gvDsPkPUsG+7pF Ahp3rvVEaTZ6wZZcnLbSEtHYSktdN0soLo+9Kcl/fxzp+lLtkxZvMm4JntWxoDAMw+/z bgTyazdJd3qlwTXqrkj/LSH6J2dOFUc+o2IHaHdcG1vTFvM5uEgf1SqTP/I7S+vQB+ka VsCydhmo6VgsrN7IGhFpah0sXaFvJ9JBKwFSBfdjbW7FoQKm7nIoyNYFGrBneAz/Qq+Z Uijg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s8si1558432edw.484.2020.04.23.12.03.16; Thu, 23 Apr 2020 12:04:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728040AbgDWL5b (ORCPT + 99 others); Thu, 23 Apr 2020 07:57:31 -0400 Received: from mx2.suse.de ([195.135.220.15]:44084 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727804AbgDWL5a (ORCPT ); Thu, 23 Apr 2020 07:57:30 -0400 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 3251BAD0F; Thu, 23 Apr 2020 11:57:28 +0000 (UTC) From: =?UTF-8?q?Michal=20Koutn=C3=BD?= To: akpm@linux-foundation.org, Christoph Lameter Cc: Pekka Enberg , David Rientjes , Joonsoo Kim , mhocko@kernel.org, vbabka@suse.cz, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND] slub: Remove userspace notifier for cache add/remove Date: Thu, 23 Apr 2020 13:57:21 +0200 Message-Id: <20200423115721.19821-1-mkoutny@suse.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christoph Lameter I came across some unnecessary uevents once again which reminded me this. 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 8<--- 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 Acked-by: Michal Koutný --- mm/slub.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 332d4b459a90..ae6116adf875 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -5665,19 +5665,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) @@ -5745,7 +5732,6 @@ static void sysfs_slab_remove_workfn(struct work_struct *work) #ifdef CONFIG_MEMCG kset_unregister(s->memcg_kset); #endif - kobject_uevent(&s->kobj, KOBJ_REMOVE); out: kobject_put(&s->kobj); } @@ -5803,7 +5789,6 @@ static int sysfs_slab_add(struct kmem_cache *s) } #endif - kobject_uevent(&s->kobj, KOBJ_ADD); if (!unmergeable) { /* Setup first alias */ sysfs_slab_alias(s, s->name); @@ -5884,7 +5869,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"); -- 2.26.0