Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5219052pxj; Wed, 26 May 2021 05:47:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQF9rqTog7lCw63DXv2aKx5Qynp1kh3HjaIkSaSlA+Ds0lf5RpCiqw53yeLVVsgK0gBQpJ X-Received: by 2002:a05:6638:635:: with SMTP id h21mr3016837jar.135.1622033264329; Wed, 26 May 2021 05:47:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622033264; cv=none; d=google.com; s=arc-20160816; b=lT7QNgiK26lf5qSneWVAVHXzpYIjpxoMeNGoWjJ/Q++SdKJCymgzc2fUxLKE4EXM+M A0WyMWpMNYbqt6pBMphU2+39soSHgzEx1ak10VTrwB1dltCH4Ml8uYuCtdIcYK7CC2ii 38FO5FqyYIAnCj0YWD3EIjqYZkskZNgwT35ynttIB93rHviwdpxrKZq8dv/E6mlQ7yQj qChM4PDmQlS63TGKfsAts00TUfY93QmH3WcKf6W3ddk0CUOy1vCPvlZLOLgU8x9ZdEoR kFrtVO2x84Kkg4tjMgTo1tJZmC/+0Gyhst5bv09kMMm3bGMw7H93xyczs9N3sIfB1Zqo p8WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to:dkim-signature:dkim-signature; bh=jmH4PcnwK0rytF/VgkkXd+8VdrhyiX8N2LMiP410pmM=; b=afsNhF87FZ2Hs33ibzy7aHU5qiA4h4+hS0ecfvkYUZ3yVC61Mot/2Q6ZzTEOczHFAR vq7oT87Z18csKiw85WG89R6WGks9rrx2p7ObIXfMHUWd1DP2QL/CzMS60OcsrfaD9gD4 1d2zY4rAJaEkugcaCWM0frLcI6PB+QUZIb1Ffclf8NSZ+/pZDMf9VpAJMZAPt2gYQtPG VumcvToDt9AZ+IlkkEF6dPYqkpxrYwTWwcmSgluYSbrk4KmCXlq9gV6J+skxjbK1RPI+ ezUjvCznCQSozjhR/TxeGyFrvQNbYndBTqv6yIP3Sx+cOqDoNyWSMetIn1/BjQ0OF9Qp L6Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=AhkFEQt5; dkim=neutral (no key) header.i=@suse.cz; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 19si21092005ilg.27.2021.05.26.05.47.22; Wed, 26 May 2021 05:47:44 -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=@suse.cz header.s=susede2_rsa header.b=AhkFEQt5; dkim=neutral (no key) header.i=@suse.cz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234097AbhEZLF3 (ORCPT + 99 others); Wed, 26 May 2021 07:05:29 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:48392 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234095AbhEZLFZ (ORCPT ); Wed, 26 May 2021 07:05:25 -0400 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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? > greg k-h >