Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4528312rwb; Tue, 8 Aug 2023 09:43:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFXPU20isfuqTtpZ2mXD3UJW5hEMH1mPRkcVexruYamvzhfyYzTaGB1prCNBHLLqQx74rJ1 X-Received: by 2002:a05:6a20:4414:b0:141:d54e:a908 with SMTP id ce20-20020a056a20441400b00141d54ea908mr1436pzb.41.1691513011512; Tue, 08 Aug 2023 09:43:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691513011; cv=none; d=google.com; s=arc-20160816; b=JRboaT4KuoMXE6cyv2ovhPM9+4yYF+c9FCfJi2A8clCg7UUhGeau+Ph9lDlsWC0MQS F2fGaomMaR9xS2MsWYzq24jMYKmAMLZpSSWH75t1SbHbY6c73yRFRE4mOI9Jp2BEOCy5 RJh0odAFcXZ9YIKkRcf37fF352RkMYNHSBI551++03rbwQFDC7h50gsohdV4fstksGTP z3hiC6HsTuinsanvVHFwQ/IrlhNi+ReLDMlR+G5ITLHSvaMaowN2N5x2tXiPJUxk/KnY rwCGDovfcfXj3liZtlPcH7dpxMBW5NDtA4CAqUe/w67M8VHfFhXWf3h52QyAF5o0v/ZD 3Ztg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lpA4KdrK70TL2Etj3PL1Cfra8aJL0LqY3fuNb0fiTvc=; fh=t8jGBr/YwqeW8jW6xc2C1E5+EYzWg2QtXNrHAqzjvaU=; b=Px2+9bsntLLHOZOAk33j7IDDzOw1RM2W60vSJiPZk/MosqaubJ8fzlgopr0A+M7NxV 5RfYlizDA9V0a7FVnqOl/yJwFWBvBGwdxsBqRvS96e3ufALMnyHEu1HwqgUi/PRTBJ9S zzyYsAkduYj+LUeg79h3UFmjGZwcVlQnE9rEMXLjB8LB/gUuHu/yp9NZzRl9mfRHEq6z a4CylRDTrOspDINh2Rd+jHGPmORw5+GD7XuDHyDYF21qYnEwu0wcA6g6yOrT0sDb8BWe 0qi0F5dXDS7xAN1oJ9qeJemao2V64u+hub5Kd758BNNoZEprPgm0LsZCtDf8pWUIWLVu SIag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=mgZVAiba; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t23-20020a656097000000b005579d6bdf7esi6957020pgu.856.2023.08.08.09.43.15; Tue, 08 Aug 2023 09:43:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=mgZVAiba; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229464AbjHHQWg (ORCPT + 99 others); Tue, 8 Aug 2023 12:22:36 -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: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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