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=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,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 93301C433E1 for ; Wed, 27 May 2020 15:54:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 62BC520776 for ; Wed, 27 May 2020 15:54:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 62BC520776 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E2A55800B6; Wed, 27 May 2020 11:54:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DDBF080010; Wed, 27 May 2020 11:54:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D1765800B6; Wed, 27 May 2020 11:54:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0216.hostedemail.com [216.40.44.216]) by kanga.kvack.org (Postfix) with ESMTP id BABB080010 for ; Wed, 27 May 2020 11:54:58 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 6A350181AC550 for ; Wed, 27 May 2020 15:54:58 +0000 (UTC) X-FDA: 76862947476.02.humor04_4a05d2a26d53 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id 2CC37BBCB for ; Wed, 27 May 2020 15:54:54 +0000 (UTC) X-HE-Tag: humor04_4a05d2a26d53 X-Filterd-Recvd-Size: 4212 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Wed, 27 May 2020 15:54:53 +0000 (UTC) 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 21872AFD1; Wed, 27 May 2020 15:54:54 +0000 (UTC) Subject: Re: [PATCH v4 10/19] mm: memcg/slab: deprecate memory.kmem.slabinfo To: Roman Gushchin , Andrew Morton , Christoph Lameter Cc: Johannes Weiner , Michal Hocko , Shakeel Butt , linux-mm@kvack.org, kernel-team@fb.com, linux-kernel@vger.kernel.org References: <20200526214227.989341-1-guro@fb.com> <20200526214227.989341-11-guro@fb.com> From: Vlastimil Babka Message-ID: <2dc94375-2ac6-9dd7-64e8-6e66aeb3a662@suse.cz> Date: Wed, 27 May 2020 17:54:50 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200526214227.989341-11-guro@fb.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 2CC37BBCB X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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: On 5/26/20 11:42 PM, Roman Gushchin wrote: > Deprecate memory.kmem.slabinfo. > > An empty file will be presented if corresponding config options are > enabled. > > The interface is implementation dependent, isn't present in cgroup v2, > and is generally useful only for core mm debugging purposes. In other > words, it doesn't provide any value for the absolute majority of users. > > A drgn-based replacement can be found in tools/cgroup/slabinfo.py . > It does support cgroup v1 and v2, mimics memory.kmem.slabinfo output > and also allows to get any additional information without a need > to recompile the kernel. > > If a drgn-based solution is too slow for a task, a bpf-based tracing > tool can be used, which can easily keep track of all slab allocations > belonging to a memory cgroup. > > Signed-off-by: Roman Gushchin Also there was a Acked-by: Johannes Weiner for this patch. And here's mine: Acked-by: Vlastimil Babka Of course this depends on whether we break somebody's workflow and they complain. > --- > mm/memcontrol.c | 3 --- > mm/slab_common.c | 31 ++++--------------------------- > 2 files changed, 4 insertions(+), 30 deletions(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index ed12bff81ea5..eca03e13c7ec 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -5052,9 +5052,6 @@ static struct cftype mem_cgroup_legacy_files[] = { > (defined(CONFIG_SLAB) || defined(CONFIG_SLUB_DEBUG)) > { > .name = "kmem.slabinfo", > - .seq_start = memcg_slab_start, > - .seq_next = memcg_slab_next, > - .seq_stop = memcg_slab_stop, > .seq_show = memcg_slab_show, > }, > #endif > diff --git a/mm/slab_common.c b/mm/slab_common.c > index b578ae29c743..3c89c2adc930 100644 > --- a/mm/slab_common.c > +++ b/mm/slab_common.c > @@ -1523,35 +1523,12 @@ void dump_unreclaimable_slab(void) > } > > #if defined(CONFIG_MEMCG_KMEM) > -void *memcg_slab_start(struct seq_file *m, loff_t *pos) > -{ > - struct mem_cgroup *memcg = mem_cgroup_from_seq(m); > - > - mutex_lock(&slab_mutex); > - return seq_list_start(&memcg->kmem_caches, *pos); > -} > - > -void *memcg_slab_next(struct seq_file *m, void *p, loff_t *pos) > -{ > - struct mem_cgroup *memcg = mem_cgroup_from_seq(m); > - > - return seq_list_next(p, &memcg->kmem_caches, pos); > -} > - > -void memcg_slab_stop(struct seq_file *m, void *p) > -{ > - mutex_unlock(&slab_mutex); > -} > - > int memcg_slab_show(struct seq_file *m, void *p) > { > - struct kmem_cache *s = list_entry(p, struct kmem_cache, > - memcg_params.kmem_caches_node); > - struct mem_cgroup *memcg = mem_cgroup_from_seq(m); > - > - if (p == memcg->kmem_caches.next) > - print_slabinfo_header(m); > - cache_show(s, m); > + /* > + * Deprecated. > + * Please, take a look at tools/cgroup/slabinfo.py . > + */ > return 0; > } > #endif >