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 7782AC2B9F7 for ; Wed, 26 May 2021 11:03:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 09E176108D for ; Wed, 26 May 2021 11:03:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 09E176108D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7D2006B0036; Wed, 26 May 2021 07:03:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 782306B006E; Wed, 26 May 2021 07:03:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5FB5F6B0070; Wed, 26 May 2021 07:03:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0099.hostedemail.com [216.40.44.99]) by kanga.kvack.org (Postfix) with ESMTP id 292486B0036 for ; Wed, 26 May 2021 07:03:56 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 32728180AD82F for ; Wed, 26 May 2021 11:03:55 +0000 (UTC) X-FDA: 78183097230.09.C1804FE Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf22.hostedemail.com (Postfix) with ESMTP id D9CC9C0042E6 for ; Wed, 26 May 2021 11:03:47 +0000 (UTC) Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) by smtp-out2.suse.de (Postfix) with ESMTP id 42D371FD2A; Wed, 26 May 2021 11:03:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1622027033; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jmH4PcnwK0rytF/VgkkXd+8VdrhyiX8N2LMiP410pmM=; b=AhkFEQt5W+uJoB7umdFvSDbZB3TVTeVtxIw3nG86EPFKDPH+Lzkds0UtmnX+ak6QFzIj6c MV1kJyHM+VegjS6s5fhbmKPp7axTIqJzfJ16axyLtWXjoC7HLxTSGBJ/bKUJFnL8sixW7l jEswJUDEjNAk7qWElofnNhf4VcJXo/Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1622027033; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jmH4PcnwK0rytF/VgkkXd+8VdrhyiX8N2LMiP410pmM=; b=GbLhaDhcFq3iUMd0QfZwMwga3xArqoag9jLXIA+EkYKdx6edX8lE7zZUI/BRqGCUdNt1w3 rTW3Qft0gSADNMBg== Received: from director2.suse.de (director2.suse-dmz.suse.de [192.168.254.72]) by imap.suse.de (Postfix) with ESMTPSA id E618411A98; Wed, 26 May 2021 11:03:52 +0000 (UTC) To: Greg KH , Faiyaz Mohammed 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> From: Vlastimil Babka Subject: Re: [PATCH v7] mm: slub: move sysfs slab alloc/free interfaces to debugfs Message-ID: <371e20a8-6b07-1eaa-d587-3b444d03ba2f@suse.cz> Date: Wed, 26 May 2021 13:03:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US X-Rspamd-Queue-Id: D9CC9C0042E6 Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=AhkFEQt5; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=GbLhaDhc; spf=pass (imf22.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Rspamd-Server: rspam04 X-Stat-Signature: euwu8x6coq43et7es8a7swdw8bu4os1m X-HE-Tag: 1622027027-82460 Content-Transfer-Encoding: quoted-printable 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/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(s= truct work_struct *work) >> >> #else >> >> slab_kmem_cache_release(s); >> >> #endif >> >> +#ifdef SLAB_SUPPORTS_DEBUGFS >> >> + debugfs_slab_release(s); >> >> +#endif >> >=20 >> > Why do you need these #ifdef if your slub_dev.h file already provide= s an >> > "empty" function for this? >> >=20 >> We are not including slub_def.h directly. mm/slab.h includes the >> slub_def.h if CONFIG_SLUB enable, >>=20 >> from mm/slab.h >> #ifdef CONFIG_SLAB >> #include >> #endif >>=20 >> #ifdef CONFIG_SLUB >> #include >> #endif >>=20 >> so if CONFIG_SLAB is enable then mm/slab.h includes slab_def.h, to avo= id >> undefined reference error added SLAB_SUPPORTS_DEBUGFS like >> SLAB_SUPPORTS_SYSFS. >=20 > 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 We could do the same with SYSFS, except the SLAB (and SLUB w/o SYSFS) ver= sions 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? > greg k-h >=20