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=-10.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,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 50983C47082 for ; Wed, 26 May 2021 15:06:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C0BEB60C3D for ; Wed, 26 May 2021 15:06:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C0BEB60C3D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1B6C06B0036; Wed, 26 May 2021 11:06:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 168216B006E; Wed, 26 May 2021 11:06:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F22256B0070; Wed, 26 May 2021 11:06:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0026.hostedemail.com [216.40.44.26]) by kanga.kvack.org (Postfix) with ESMTP id BFBA46B0036 for ; Wed, 26 May 2021 11:06:55 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 09A624DC7 for ; Wed, 26 May 2021 15:06:55 +0000 (UTC) X-FDA: 78183709590.17.43CA21F Received: from m43-7.mailgun.net (m43-7.mailgun.net [69.72.43.7]) by imf23.hostedemail.com (Postfix) with ESMTP id DB3D5A0001D7 for ; Wed, 26 May 2021 15:06:45 +0000 (UTC) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1622041614; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=b8BjlH9egfM8irtGeEu6Ssq225EyE56PX+b1TLfvFCQ=; b=iOpNlUhlrGv+yUSyzW5FlTCeRE9zpxcsJVk2u5yCfvMrcRPkn3WOdLKA3cSFSIUqz6OWLynz 2fz14fru1oo6l4unupf376GqcB0tZc6TsziLn9dLSvD8wdWXNg9I1Fl49LQLMemF3s48efL6 35aJGrRmjOhBNt5rnw/JgfiqB9o= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyIwY2Q3OCIsICJsaW51eC1tbUBrdmFjay5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-west-2.postgun.com with SMTP id 60ae63f2c229adfeff0f2600 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 26 May 2021 15:06:26 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 6C0EFC43460; Wed, 26 May 2021 15:06:26 +0000 (UTC) Received: from [192.168.0.105] (unknown [49.204.183.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: faiyazm) by smtp.codeaurora.org (Postfix) with ESMTPSA id 2BDD2C4338A; Wed, 26 May 2021 15:06:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 2BDD2C4338A Subject: Re: [PATCH v7] mm: slub: move sysfs slab alloc/free interfaces to debugfs To: Vlastimil Babka , Greg KH Cc: cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, glittao@gmail.com, vinmenon@codeaurora.org References: <1621928285-751-1-git-send-email-faiyazm@codeaurora.org> <7324d56f-c5fe-05fa-55f2-7dd2dbf9bce0@codeaurora.org> <371e20a8-6b07-1eaa-d587-3b444d03ba2f@suse.cz> From: Faiyaz Mohammed Message-ID: <544e7eaf-ceaa-0ff0-15c3-b615db7e1b00@codeaurora.org> Date: Wed, 26 May 2021 20:36:18 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <371e20a8-6b07-1eaa-d587-3b444d03ba2f@suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=mg.codeaurora.org header.s=smtp header.b=iOpNlUhl; spf=pass (imf23.hostedemail.com: domain of bounce@mg.codeaurora.org designates 69.72.43.7 as permitted sender) smtp.mailfrom=bounce@mg.codeaurora.org; dmarc=none X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: DB3D5A0001D7 X-Stat-Signature: 9bkqoq5q9aguyrxmzdbxf79z6dwuiioj X-HE-Tag: 1622041605-641957 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/2021 4:33 PM, Vlastimil Babka wrote: > On 5/25/21 1:54 PM, Greg KH wrote: >> On Tue, May 25, 2021 at 02:27:15PM +0530, Faiyaz Mohammed wrote: >>>> --- 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? >>>> >>> We are not including slub_def.h directly. mm/slab.h includes the >>> slub_def.h if CONFIG_SLUB enable, >>> >>> from mm/slab.h >>> #ifdef CONFIG_SLAB >>> #include >>> #endif >>> >>> #ifdef CONFIG_SLUB >>> #include >>> #endif >>> >>> so if CONFIG_SLAB is enable then mm/slab.h includes slab_def.h, to avoid >>> undefined reference error added SLAB_SUPPORTS_DEBUGFS like >>> SLAB_SUPPORTS_SYSFS. >> >> Ick, ok, messy code, I'll stop complaining now if this really is the >> only way to do it (still feels wrong to me...) > > How about simply replicating the empty function in > include/linux/slab_def.h > Yes, we can add empty function in include/linux/slab_def.h. I will add in next patch version. > We could do the same with SYSFS, except the SLAB (and SLUB w/o SYSFS) versions > of sysfs_slab_release() would not be empty, but just call > slab_kmem_cache_release(s); > Then we could get rid of the #ifdef's completely? > Is it okay, if I raise separate patch for sysfs by adding empty function in slab_def.h? Thanks and regards, Mohammed Faiyaz >> greg k-h >> >