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=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 05790C433DB for ; Thu, 28 Jan 2021 02:25:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 47BD864DC4 for ; Thu, 28 Jan 2021 02:25:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 47BD864DC4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AA3976B006E; Wed, 27 Jan 2021 21:25:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A55266B0070; Wed, 27 Jan 2021 21:25:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 990046B0071; Wed, 27 Jan 2021 21:25:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0081.hostedemail.com [216.40.44.81]) by kanga.kvack.org (Postfix) with ESMTP id 835336B006E for ; Wed, 27 Jan 2021 21:25:14 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 39C138249980 for ; Thu, 28 Jan 2021 02:25:14 +0000 (UTC) X-FDA: 77753591748.29.train27_2e0939e2759c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id 1D135180868C1 for ; Thu, 28 Jan 2021 02:25:14 +0000 (UTC) X-HE-Tag: train27_2e0939e2759c X-Filterd-Recvd-Size: 4836 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 02:25:12 +0000 (UTC) Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DR46414W7zjFL8; Thu, 28 Jan 2021 10:23:56 +0800 (CST) Received: from [10.174.179.117] (10.174.179.117) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.498.0; Thu, 28 Jan 2021 10:25:07 +0800 Subject: Re: [PATCH] mm, slub: remove slub_memcg_sysfs boot param and CONFIG_SLUB_MEMCG_SYSFS_ON To: Vlastimil Babka CC: , , Roman Gushchin , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton References: <20210127124745.7928-1-vbabka@suse.cz> From: Miaohe Lin Message-ID: <36b8a6fb-9b51-bd1b-d5b8-cb65b2be9c1a@huawei.com> Date: Thu, 28 Jan 2021 10:25:07 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210127124745.7928-1-vbabka@suse.cz> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.117] X-CFilter-Loop: Reflected 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: Hi: On 2021/1/27 20:47, Vlastimil Babka wrote: > The boot param and config determine the value of memcg_sysfs_enabled, which is > unused since commit 10befea91b61 ("mm: memcg/slab: use a single set of > kmem_caches for all allocations") as there are no per-memcg kmem caches > anymore. > Good catch. Thanks. Reviewed-by: Miaohe Lin > Signed-off-by: Vlastimil Babka > --- > Documentation/admin-guide/kernel-parameters.txt | 8 -------- > init/Kconfig | 14 -------------- > mm/slub.c | 16 ---------------- > 3 files changed, 38 deletions(-) > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > index f4497faef266..7dc351da0005 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -4892,14 +4892,6 @@ > last alloc / free. For more information see > Documentation/vm/slub.rst. > > - slub_memcg_sysfs= [MM, SLUB] > - Determines whether to enable sysfs directories for > - memory cgroup sub-caches. 1 to enable, 0 to disable. > - The default is determined by CONFIG_SLUB_MEMCG_SYSFS_ON. > - Enabling this can lead to a very high number of debug > - directories and files being created under > - /sys/kernel/slub. > - > slub_max_order= [MM, SLUB] > Determines the maximum allowed order for slabs. > A high setting may cause OOMs due to memory > diff --git a/init/Kconfig b/init/Kconfig > index e4e2932da237..af454a51f3c5 100644 > --- a/init/Kconfig > +++ b/init/Kconfig > @@ -1851,20 +1851,6 @@ config SLUB_DEBUG > SLUB sysfs support. /sys/slab will not exist and there will be > no support for cache validation etc. > > -config SLUB_MEMCG_SYSFS_ON > - default n > - bool "Enable memcg SLUB sysfs support by default" if EXPERT > - depends on SLUB && SYSFS && MEMCG > - help > - SLUB creates a directory under /sys/kernel/slab for each > - allocation cache to host info and debug files. If memory > - cgroup is enabled, each cache can have per memory cgroup > - caches. SLUB can create the same sysfs directories for these > - caches under /sys/kernel/slab/CACHE/cgroup but it can lead > - to a very high number of debug files being created. This is > - controlled by slub_memcg_sysfs boot parameter and this > - config option determines the parameter's default value. > - > config COMPAT_BRK > bool "Disable heap randomization" > default y > diff --git a/mm/slub.c b/mm/slub.c > index 1b5148747c64..88782727412c 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -5040,22 +5040,6 @@ enum slab_stat_type { > #define SO_OBJECTS (1 << SL_OBJECTS) > #define SO_TOTAL (1 << SL_TOTAL) > > -#ifdef CONFIG_MEMCG > -static bool memcg_sysfs_enabled = IS_ENABLED(CONFIG_SLUB_MEMCG_SYSFS_ON); > - > -static int __init setup_slub_memcg_sysfs(char *str) > -{ > - int v; > - > - if (get_option(&str, &v) > 0) > - memcg_sysfs_enabled = v; > - > - return 1; > -} > - > -__setup("slub_memcg_sysfs=", setup_slub_memcg_sysfs); > -#endif > - > static ssize_t show_slab_objects(struct kmem_cache *s, > char *buf, unsigned long flags) > { >