From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ACD5D389DEC for ; Fri, 22 May 2026 11:19:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779448797; cv=none; b=RMoNXXg3nhJ6BJ2zKsr003JjthazFAw1+J7qBDzW1VLIH+Fhsm2STESA8qNtlNmlbVub8BSNXaauHGuBoV4ijbwvzQU7psPNVn3ukBMf/Ao8pHboOWxhTiaM+WXeagjD0x8Y9/nVKE/NGIuDOqladQTG6dRp7bMYlW2kRAsIZi8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779448797; c=relaxed/simple; bh=SVOW9xldKSPlLm+gzb0UWSKR/Fv/EN1qi+sTfsS3jXQ=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=GB3rNDVlEpKG2RyaMTHXK213xKghBmyjehr88B480CSCMNxsywftw57Am0x+aojVwouON5E0hA6ENmywqT8eYBnK3kRKOFs2xEAN2lJjBY1kfommQg6mGNuJhOVSNZ9yj+UVa8ch/S+OMktB1NbSBXnSIWAZ/y9UEi1x76Z5qyc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CQ+hluqM; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CQ+hluqM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14A871F000E9; Fri, 22 May 2026 11:19:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779448794; bh=385qrBW1EQYKW/EHtsGF8/FRYRiGYCeEt5ozPxIr+kY=; h=Date:Subject:To:References:From:In-Reply-To; b=CQ+hluqMHKtYZ+KzRNGbbt9yvin2AQWBs2RwtVfXudNxAnUt/UX24SELfoN5UG36q LkviNnAbaA+BUqYvLUOtTf810RlocA6Co5JsUX273Xu8IryuEK/rgb266EmjZt/go6 ZGAql5yfiZERkdG4R3PloSu1uCHCsWIOq7Jr4sBzwK2QWw1O40oWwKtM1ZT0T02L2R JifhNk8V3w4feaj+KcMtjB8DzfrsLdyXWp94A2v13x0Nlhly10Ur5+406cbvAMOBst hvQQcEqaW84VLEUENZUZsGdH1wtCbjNU4TmpC5839qZh8q24MFzMNxTYJssPONld9i 7+XmP0jAf2v1Q== Message-ID: <6ba62058-e5f8-4212-b1a8-56047b4977db@kernel.org> Date: Fri, 22 May 2026 13:19:50 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm/dmapool: remove redundant DMAPOOL_DEBUG macro Content-Language: en-US To: lirongqing , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R . Howlett" , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Harry Yoo , Hao Li References: <20260522105346.2215-1-lirongqing@baidu.com> From: "Vlastimil Babka (SUSE)" In-Reply-To: <20260522105346.2215-1-lirongqing@baidu.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 5/22/26 12:53, lirongqing wrote: > From: Li RongQing > > The DMAPOOL_DEBUG macro is only defined when CONFIG_SLUB_DEBUG_ON is > enabled, and it is used exclusively to guard the pool_check_block() > function. Wrapping CONFIG_SLUB_DEBUG_ON in another local macro adds > unnecessary indirection. > > Simplify the code by removing DMAPOOL_DEBUG entirely and using the > standard CONFIG_SLUB_DEBUG_ON config option directly. > > Signed-off-by: Li RongQing I think a more useful change would be to remove the usage of CONFIG_SLUB_DEBUG_ON completely and rather (re)use a boot option that uses a static key. CONFIG_SLUB_DEBUG_ON is only useful for bots running randconfigs, otherwise normally for debugging a specific problem one doesn't want to rebuild a kernel with CONFIG_SLUB_DEBUG_ON, but just reboot with a boot option slab_debug[=...] (for slab itself) or debug_pagealloc=on etc. (same thing should be done for the usage in mm/mempool.c btw) > --- > mm/dmapool.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/mm/dmapool.c b/mm/dmapool.c > index 5d8af6e..af43f1a 100644 > --- a/mm/dmapool.c > +++ b/mm/dmapool.c > @@ -36,10 +36,6 @@ > #include > #include > > -#ifdef CONFIG_SLUB_DEBUG_ON > -#define DMAPOOL_DEBUG 1 > -#endif > - > struct dma_block { > struct dma_block *next_block; > dma_addr_t dma; > @@ -92,7 +88,7 @@ static ssize_t pools_show(struct device *dev, struct device_attribute *attr, cha > > static DEVICE_ATTR_RO(pools); > > -#ifdef DMAPOOL_DEBUG > +#ifdef CONFIG_SLUB_DEBUG_ON > static void pool_check_block(struct dma_pool *pool, struct dma_block *block, > gfp_t mem_flags) > {