mm: compaction: fix compiler warning when CONFIG_COMPACTION=n

Bugzilla: https://bugzilla.redhat.com/2120352

commit 31ca72fa7540bb654b55c56adaf99305847376e0
Author: Charan Teja Kalla <quic_charante@quicinc.com>
Date:   Thu Apr 14 19:13:49 2022 -0700

    mm: compaction: fix compiler warning when CONFIG_COMPACTION=n

    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.

    Link: https://lkml.kernel.org/r/1647608518-20924-1-git-send-email-quic_charante@quicinc.com
    Signed-off-by: Charan Teja Kalla <quic_charante@quicinc.com>
    Reported-by: kernel test robot <lkp@intel.com>
    Acked-by: Vlastimil Babka <vbabka@suse.cz>
    Cc: Nitin Gupta <nigupta@nvidia.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Signed-off-by: Chris von Recklinghausen <crecklin@redhat.com>
This commit is contained in:
Chris von Recklinghausen 2022-10-12 07:09:43 -04:00
parent 8075102dcc
commit aa8c7b8813
1 changed files with 5 additions and 5 deletions

View File

@ -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);
@ -50,11 +55,6 @@ static inline void count_compact_events(enum vm_event_item item, long delta)
#define pageblock_start_pfn(pfn) block_start_pfn(pfn, pageblock_order)
#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