Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4160474pxj; Tue, 25 May 2021 01:35:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9mLy30eEweuvBiFJ3Jtvrjhothglc4RDTEHdN2eqyMV+akjeHMVIuiVlocrQEIn5HxgOL X-Received: by 2002:a17:906:ff4b:: with SMTP id zo11mr25996378ejb.345.1621931714391; Tue, 25 May 2021 01:35:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621931714; cv=none; d=google.com; s=arc-20160816; b=ju6Cq/W2WkLasO/TI8a+h20u+mUW6RSNVpd/oR6nVsQ1+Ppu89hJU/2azlPl/Z5U3Q xvCf4zm783kscMGkyDcyU4+VqfpPHO1p9fEH1jlJdLAF+B0FDTSjaatCxoEjkltIOH9w SunHYp5D8u8BkjeDqH6sUB+g2ZhjMLisCuGNh6Ei5VXRP3GYSCfQJ8PnAT1zzPXxTOi6 qzvokgkdcbouQ8oXh6TyEHZJddX8/yGCF5orLC1iy43il9E9f4zgXr2nyk2Cpe1usL7S M4HbrUngM6r2Lydnepph8gu/74lo1+/QpmukHiyPHABwyx0rLQpK5sNQ6bHdMz4ULRqi OdhQ== 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=qCbS7Wdy5Ou4CoLnW9R9UziwzS51ke0SZi+8iqorj4o=; b=bKf1pITtoAujdDM9CYwngL5jG9hsfqBRDlL/VSSUhQVRt5XdVEnIUwhBaB/8pdhYRW MRtFhVbxmcdUsng3YA++DeKaDgKO8q4XCCLm4Fx4Svd5oI7dWkGZpDuuKXFUYAI/C8bv n1d37JFdFJhWks4Ftrxk36yeAERDzlammNym77YJTC4J+O35ECtbF4m7oXw9e2JwRKB1 Jw/w/UmXn2CLQl5IwkrXi52bgXyhIfSq/hDbIqBtsipQjXgA21GRmejUz3x2WbRCvOuW upMQA2Hd8tCfOQDaq4JIMLGZ7rFfdNHLabWhysBIg3ho+6fcfU1LncveD2LQQfa0U68c NU6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="l1DU/FaB"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w21si13929816edx.284.2021.05.25.01.34.48; Tue, 25 May 2021 01:35:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="l1DU/FaB"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231886AbhEYHy4 (ORCPT + 99 others); Tue, 25 May 2021 03:54:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:37416 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231640AbhEYHy4 (ORCPT ); Tue, 25 May 2021 03:54:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 319E86128B; Tue, 25 May 2021 07:53:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621929205; bh=i3iKLnAT/uEav9AIigQ8Y+Badv6xYz6k3RQel47yBkg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=l1DU/FaBhz7SMVX3dH4z+eoGUA5ci2yPfij1JkOzkuxeDQvZE6jC+zKrvCARJp2D8 ZodDjWX/tzNFQ4vCh4BSTy/4Bc31e8pqzF6rv6PoDA8xWcc/1hq82A9qZIRO0kNrH0 yLv4csKYEX0+Xxoewfz+o35/sTNj5+DZYizoIIZU= Date: Tue, 25 May 2021 09:53:23 +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 v7] mm: slub: move sysfs slab alloc/free interfaces to debugfs Message-ID: References: <1621928285-751-1-git-send-email-faiyazm@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1621928285-751-1-git-send-email-faiyazm@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 25, 2021 at 01:08:05PM +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. > > Reported-by: kernel test robot > Reported-by: Dan Carpenter > Signed-off-by: Faiyaz Mohammed > --- > changes in V7: > - Drop the older alloc_calls and free_calls interface. > changes in v6: > - https://lore.kernel.org/linux-mm/1621341949-26762-1-git-send-email-faiyazm@codeaurora.org/ > > changes in v5: > - https://lore.kernel.org/linux-mm/1620296523-21922-1-git-send-email-faiyazm@codeaurora.org/ > > changes in v4: > - https://lore.kernel.org/linux-mm/1618583239-18124-1-git-send-email-faiyazm@codeaurora.org/ > > changes in v3: > - https://lore.kernel.org/linux-mm/1617712064-12264-1-git-send-email-faiyazm@codeaurora.org/ > > changes in v2: > - https://lore.kernel.org/linux-mm/3ac1d3e6-6207-96ad-16a1-0f5139d8b2b5@codeaurora.org/ > > changes in v1: > - https://lore.kernel.org/linux-mm/1610443287-23933-1-git-send-email-faiyazm@codeaurora.org/ > > include/linux/slub_def.h | 8 ++ > mm/slab_common.c | 9 ++ > mm/slub.c | 353 ++++++++++++++++++++++++++++++++++------------- > 3 files changed, 276 insertions(+), 94 deletions(-) > > diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h > index dcde82a..b413ebe 100644 > --- a/include/linux/slub_def.h > +++ b/include/linux/slub_def.h > @@ -159,6 +159,14 @@ static inline void sysfs_slab_release(struct kmem_cache *s) > } > #endif > > +#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_SLUB_DEBUG) > +#define SLAB_SUPPORTS_DEBUGFS > +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 a4a5714..873dd79 100644 > --- a/mm/slab_common.c > +++ b/mm/slab_common.c > @@ -455,6 +455,9 @@ static void slab_caches_to_rcu_destroy_workfn(struct work_struct *work) > #else > slab_kmem_cache_release(s); > #endif > +#ifdef SLAB_SUPPORTS_DEBUGFS > + debugfs_slab_release(s); > +#endif Why do you need these #ifdef if your slub_dev.h file already provides an "empty" function for this? > } > } > > @@ -472,6 +475,9 @@ static int shutdown_cache(struct kmem_cache *s) > #ifdef SLAB_SUPPORTS_SYSFS > sysfs_slab_unlink(s); > #endif > +#ifdef SLAB_SUPPORTS_DEBUGFS > + debugfs_slab_release(s); > +#endif Same here. > list_add_tail(&s->list, &slab_caches_to_rcu_destroy); > schedule_work(&slab_caches_to_rcu_destroy_work); > } else { > @@ -482,6 +488,9 @@ static int shutdown_cache(struct kmem_cache *s) > #else > slab_kmem_cache_release(s); > #endif > +#ifdef SLAB_SUPPORTS_DEBUGFS > + debugfs_slab_release(s); > +#endif And here. What is wrong with your .h file that keeps the need for #ifdef in the .c file? I thought I've asked about this a number of times in the past, what am I missing? thanks, greg k-h