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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2723FC433EF for ; Fri, 18 Mar 2022 15:11:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6C1C98D0002; Fri, 18 Mar 2022 11:11:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 66EBB8D0001; Fri, 18 Mar 2022 11:11:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 50FA48D0002; Fri, 18 Mar 2022 11:11:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 3DCC88D0001 for ; Fri, 18 Mar 2022 11:11:42 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 04D7A60790 for ; Fri, 18 Mar 2022 15:11:41 +0000 (UTC) X-FDA: 79257846444.01.7C9C6D3 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf20.hostedemail.com (Postfix) with ESMTP id 4543E1C0020 for ; Fri, 18 Mar 2022 15:11:41 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B0DD91F392; Fri, 18 Mar 2022 15:11:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1647616299; 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=LgAHhMnQFl/XoppBx9vQUXM93wpw76rIne61nM1b/o4=; b=MzOoT2+bBFPmPIi2HiKcQkl46umVRcz4ojhuX57f5xpYZWM2NNIwhoj7Ot0aJddeVkuFZO HoEDaUrIQLwi9cXPeB6GsnwCQQ9OhOB0MzKlEhRSNA9U5S2fxH/NvJdUIxVJvt4yklQjVl Tyx17f8iTllsExwzrAhzHDG4nvG0Ncw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1647616299; 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=LgAHhMnQFl/XoppBx9vQUXM93wpw76rIne61nM1b/o4=; b=QAldZ+evzxhWb8i231IDECz/SSBbl4Uh75rCix/648sD70ffupk/r4jqlJIEoSuGifj4F0 A92z8YdmuhD2gqCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8D6A313B67; Fri, 18 Mar 2022 15:11:39 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id CWMTISuhNGLrWgAAMHmgww (envelope-from ); Fri, 18 Mar 2022 15:11:39 +0000 Message-ID: <845449c1-d19a-5c9e-4ccb-352dff9ec473@suse.cz> Date: Fri, 18 Mar 2022 16:11:39 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] mm: compaction: fix compiler warning when CONFIG_COMPACTION=n Content-Language: en-US To: Charan Teja Kalla , akpm@linux-foundation.org, nigupta@nvidia.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <1647608518-20924-1-git-send-email-quic_charante@quicinc.com> From: Vlastimil Babka In-Reply-To: <1647608518-20924-1-git-send-email-quic_charante@quicinc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspam-User: Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=MzOoT2+b; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=QAldZ+ev; dmarc=none; spf=pass (imf20.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 4543E1C0020 X-Stat-Signature: w77waz8h7dip6zogsshymb3h9z6b4imx X-HE-Tag: 1647616301-870957 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 3/18/22 14:01, Charan Teja Kalla wrote: > The below warning is reported when CONFIG_COMPACTION=n: > > mm/compaction.c:56:27: warning: 'HPAGE_FRAG_CHECK_INTERVAL_MSEC' > defined but not used [-Wunused-const-variable=] > 56 | static const unsigned int HPAGE_FRAG_CHECK_INTERVAL_MSEC = > 500; > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Fix it by moving 'HPAGE_FRAG_CHECK_INTERVAL_MSEC' under > CONFIG_COMPACTION defconfig. Also since this is just a 'static const > int' type, use #define for it. > > Reported-by: kernel test robot > Signed-off-by: Charan Teja Kalla Acked-by: Vlastimil Babka > --- > mm/compaction.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/mm/compaction.c b/mm/compaction.c > index b4e94cd..4d86d04 100644 > --- a/mm/compaction.c > +++ b/mm/compaction.c > @@ -26,6 +26,11 @@ > #include "internal.h" > > #ifdef CONFIG_COMPACTION > +/* > + * Fragmentation score check interval for proactive compaction purposes. > + */ > +#define HPAGE_FRAG_CHECK_INTERVAL_MSEC (500) > + > static inline void count_compact_event(enum vm_event_item item) > { > count_vm_event(item); > @@ -51,11 +56,6 @@ static inline void count_compact_events(enum vm_event_item item, long delta) > #define pageblock_end_pfn(pfn) block_end_pfn(pfn, pageblock_order) > > /* > - * Fragmentation score check interval for proactive compaction purposes. > - */ > -static const unsigned int HPAGE_FRAG_CHECK_INTERVAL_MSEC = 500; > - > -/* > * Page order with-respect-to which proactive compaction > * calculates external fragmentation, which is used as > * the "fragmentation score" of a node/zone.