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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C31EC04A6A for ; Tue, 8 Aug 2023 16:23:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229523AbjHHQWh (ORCPT ); Tue, 8 Aug 2023 12:22:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232445AbjHHQT6 (ORCPT ); Tue, 8 Aug 2023 12:19:58 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B6129032; Tue, 8 Aug 2023 08:49:00 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 65DF020017; Tue, 8 Aug 2023 07:29:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1691479795; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lpA4KdrK70TL2Etj3PL1Cfra8aJL0LqY3fuNb0fiTvc=; b=mgZVAibaY3lnvIFmOTTHRMtxp3t7qQKh8BnOSevYzZfKQ9ODixCurYGn0FceCkXYyYsp0+ RvsA+wkdqZohpaqPEn1MlNCQFu0gtGvRAx4qDNx3uVWO++I0kqwdfjEmJD+LpiPmQNnfxG pO3CeZANL2wZKxSHtzxRki9EQbPlmFg= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 37BD813451; Tue, 8 Aug 2023 07:29:55 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 2xkkCvPu0WTBXwAAMHmgww (envelope-from ); Tue, 08 Aug 2023 07:29:55 +0000 Date: Tue, 8 Aug 2023 09:29:54 +0200 From: Michal Hocko To: Roman Gushchin Cc: xiongwei.song@windriver.com, hannes@cmpxchg.org, shakeelb@google.com, muchun.song@linux.dev, akpm@linux-foundation.org, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/memcontrol: add tips for kmem.slabinfo Message-ID: References: <20230808022229.1560559-1-xiongwei.song@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 07-08-23 20:59:59, Roman Gushchin wrote: > On Tue, Aug 08, 2023 at 10:22:29AM +0800, xiongwei.song@windriver.com wrote: > > From: Xiongwei Song > > > > No any output from kmem.slabinfo, which is not friendly. Adding > > tips for it. > > > > Signed-off-by: Xiongwei Song > > --- > > mm/memcontrol.c | 6 ++---- > > 1 file changed, 2 insertions(+), 4 deletions(-) > > > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > > index e8ca4bdcb03c..58d3bd93890b 100644 > > --- a/mm/memcontrol.c > > +++ b/mm/memcontrol.c > > @@ -5002,10 +5002,8 @@ static ssize_t memcg_write_event_control(struct kernfs_open_file *of, > > #if defined(CONFIG_MEMCG_KMEM) && (defined(CONFIG_SLAB) || defined(CONFIG_SLUB_DEBUG)) > > static int mem_cgroup_slab_show(struct seq_file *m, void *p) > > { > > - /* > > - * Deprecated. > > - * Please, take a look at tools/cgroup/memcg_slabinfo.py . > > - */ > > + seq_puts(m, "This file is deprecated.\n" > > + "Please use tools/cgroup/memcg_slabinfo.py, which is in kernel source.\n"); > > It'll break the ABI. Agreed > The only possible option here is to use WARN_ON_ONCE(), which will print once to dmesg. > But honestly I'm not sure we need it. There are systems with panic_on_warn configured. I do not think we want those to go down just becasue some random tool tries to read this file. -- Michal Hocko SUSE Labs