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.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 186DEC43460 for ; Tue, 18 May 2021 13:33:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A6190610E9 for ; Tue, 18 May 2021 13:33:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A6190610E9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kroah.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 412FA8E0029; Tue, 18 May 2021 09:33:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3C2EE8E0023; Tue, 18 May 2021 09:33:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 263DB8E0029; Tue, 18 May 2021 09:33:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0183.hostedemail.com [216.40.44.183]) by kanga.kvack.org (Postfix) with ESMTP id E6FDC8E0023 for ; Tue, 18 May 2021 09:33:49 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 8C168180AD838 for ; Tue, 18 May 2021 13:33:49 +0000 (UTC) X-FDA: 78154444578.04.C59336D Received: from wnew2-smtp.messagingengine.com (wnew2-smtp.messagingengine.com [64.147.123.27]) by imf08.hostedemail.com (Postfix) with ESMTP id ACF0980192E2 for ; Tue, 18 May 2021 13:33:45 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.west.internal (Postfix) with ESMTP id CB1CF138E; Tue, 18 May 2021 09:33:45 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 18 May 2021 09:33:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=dFf5WOkSavXSozEUmyF23vNvgNn I6ayFO8rZHK3NyVs=; b=RV3erbT/q2HlYvg96af6Pc+ZWZHVPSWzsYwurq/55x5 MbhMXSXSIogWrnTzsXrF5x+bLqTGuRtumiCBdbCeSwEBrAi3BDnqRb7aYF7QThX9 8BM8kKWlsnTpMyXtAU2CI0sBFUrj8FcmAF+voGmeGhoXw1syEfJTRR6zb3gFhgyL hPW2CyFGO/pfMjSRge6RNeyBsP2YaaohNYgvbtHi1JjoMxJSDZ3C5dBuT3zByOs1 kZdEyo6KkHgWtigIEOqDm9oHtkw6FhJhBt3KM3XtQsgeCQEYtBtsUbWCsTXhWwm7 GsVaSEQhae65jXjjt3MhP3TlYx28AFSmpp+bnP7ApEA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=dFf5WO kSavXSozEUmyF23vNvgNnI6ayFO8rZHK3NyVs=; b=ctwXa1+J4M16sZaGvwzOWb Jdwzfq/mfeVkZc+dyXEaU1368jeg+2N37tCAQGiGz3BIyeIYSux7awhC4bYaQi2s ahGnRjP4Jqgp2sXDvblT2kIpGy/lXTUvDWgcwD1FaO7BWWh170ci+OE+0teKLob6 CjkaCrmv6o0t72dt7QazB9I5r5OpD7d1ST+uK+CG7XfQ7NjA/VCQtX8oO848ei3+ RPAaRuBT5EdYfN0sTMhPf6h9r1AIKkv7Eth0II/f6bI0ND67X7xPgI2nZq9mdkpS ApS/zACX0kjLa3krkZ8/8Mv+pcjg954dadIm8l1E4/XaM/djszAf5SKW/ySLQChw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdeijedgieehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpefirhgvghcu mffjuceoghhrvghgsehkrhhorghhrdgtohhmqeenucggtffrrghtthgvrhhnpeevueehje fgfffgiedvudekvdektdelleelgefhleejieeugeegveeuuddukedvteenucfkphepkeef rdekiedrjeegrdeigeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehgrhgvgheskhhrohgrhhdrtghomh X-ME-Proxy: Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 May 2021 09:33:43 -0400 (EDT) Date: Tue, 18 May 2021 15:33:41 +0200 From: Greg KH To: Faiyaz Mohammed Cc: cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, vbabka@suse.cz, linux-mm@kvack.org, linux-kernel@vger.kernel.org, glittao@gmail.com, vinmenon@codeaurora.org Subject: Re: [PATCH v5] mm: slub: move sysfs slab alloc/free interfaces to debugfs Message-ID: References: <1620296523-21922-1-git-send-email-faiyazm@codeaurora.org> <6d91e7cb-514f-8816-76b1-a70f6891a47a@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6d91e7cb-514f-8816-76b1-a70f6891a47a@codeaurora.org> Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kroah.com header.s=fm3 header.b="RV3erbT/"; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=ctwXa1+J; dmarc=none; spf=pass (imf08.hostedemail.com: domain of greg@kroah.com designates 64.147.123.27 as permitted sender) smtp.mailfrom=greg@kroah.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: ACF0980192E2 X-Stat-Signature: nsqnuqbhq5p7h1oddonyoxjeu4bgj78e X-HE-Tag: 1621344825-520570 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 Tue, May 18, 2021 at 06:24:48PM +0530, Faiyaz Mohammed wrote: > > > On 5/7/2021 5:18 PM, Greg KH wrote: > > On Thu, May 06, 2021 at 03:52:03PM +0530, Faiyaz Mohammed wrote: > >> alloc_calls and free_calls implementation in sysfs have two issues, > >> one is PAGE_SIZE limitiation of sysfs and other is it does not adhere > >> to "one value per file" rule. > >> > >> To overcome this issues, move the alloc_calls and free_calls implemeation > >> to debugfs. > >> > >> Rename the alloc_calls/free_calls to alloc_traces/free_traces, > >> to be inline with what it does. > >> > >> Signed-off-by: Faiyaz Mohammed > >> --- > >> include/linux/slub_def.h | 10 ++ > >> mm/slab_common.c | 9 ++ > >> mm/slub.c | 362 ++++++++++++++++++++++++++++++++++++----------- > >> 3 files changed, 299 insertions(+), 82 deletions(-) > >> > >> diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h > >> index dcde82a..f8c268d 100644 > >> --- a/include/linux/slub_def.h > >> +++ b/include/linux/slub_def.h > >> @@ -110,6 +110,9 @@ struct kmem_cache { > >> #ifdef CONFIG_SYSFS > >> struct kobject kobj; /* For sysfs */ > >> #endif > >> +#ifdef CONFIG_SLUB_DEBUG > >> + struct dentry *slab_cache_dentry; > >> +#endif > >> #ifdef CONFIG_SLAB_FREELIST_HARDENED > >> unsigned long random; > >> #endif > >> @@ -159,6 +162,13 @@ static inline void sysfs_slab_release(struct kmem_cache *s) > >> } > >> #endif > >> > >> +#ifdef CONFIG_DEBUG_FS > >> +void debugfs_slab_release(struct kmem_cache *); > >> +#else > >> +static inline void debugfs_slab_release(struct kmem_cache *s) > >> +{ > >> +} > >> +#endif > >> void object_err(struct kmem_cache *s, struct page *page, > >> u8 *object, char *reason); > >> > >> diff --git a/mm/slab_common.c b/mm/slab_common.c > >> index f8833d3..f3afe6b 100644 > >> --- a/mm/slab_common.c > >> +++ b/mm/slab_common.c > >> @@ -445,6 +445,9 @@ static void slab_caches_to_rcu_destroy_workfn(struct work_struct *work) > >> #else > >> slab_kmem_cache_release(s); > >> #endif > >> +#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_SLUB) > >> + debugfs_slab_release(s); > >> +#endif > > > > If you write your .h files correctly, no need for #ifdef in a .c file. > > > > Please fix up. > > > fixed in new patch and used the single #ifded because > debugfs_slab_release declaration is there in slub_def.h and slab_common > is used for both slab and slub. > Like SLAB_SUPPORTS_SYSFS, SLAB_SUPPORT_DEBUGFS will be not defined if > slab config is used. No, you should have have any #ifdef at all, as I point out in that review. thanks, greg k-h