Skip to contentSkip to conversation

mm: Proactive compaction

RFC Superseded Nitin Gupta 2 participants 5 messages Oct 31, 2019 – Nov 3, 2019

Subsystems (3)

v2 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

RFC v2 1/1 mm: Proactive compaction

For some applications we need to allocate almost all memory as hugepages. However, on a running system, higher order allocations can fail if the memory is fragmented. Linux kernel currently does on-demand compaction as we request more hugepages but this style of compaction incurs very high latency. Experiments with one-time full memory compaction (followed by hugepage allocations) shows that kernel is able to restore a highly fragmented memory state to a fairly compacted memory state within <1 sec for a 32G system. Such data suggests that a more proactive compaction can help us allocate a large fraction of memory as hugepages keeping allocation latencies low.

For a more proactive compaction, the approach taken here is to define per page-node tunable called ‘hpage_compaction_effort’ which dictates bounds for external fragmentation for HPAGE_PMD_ORDER pages which kcompactd should try to maintain.

The tunable is exposed through sysfs:
/sys/kernel/mm/compaction/node-n/hpage_compaction_effort

The value of this tunable is used to determine low and high thresholds for external fragmentation wrt HPAGE_PMD_ORDER order.

Note that previous version of this patch [1] was found to introduce too many tunables (per-order, extfrag_{low, high}) but this one reduces them to just (per-node, hpage_compaction_effort). Also, the new tunable is an opaque value instead of asking for specific bounds of “external fragmentation” which would have been difficult to estimate. The internal interpretation of this opaque value allows for future fine-tuning.

Currently, we use a simple translation from this tunable to [low, high] extfrag thresholds (low=100-hpage_compaction_effort, high=low+10%). To periodically check per-node extfrag status, we reuse per-node kcompactd threads which are woken up every few milliseconds to check the same. If any zone on its corresponding node has extfrag above the high threshold for the HPAGE_PMD_ORDER order, the thread starts compaction in background till all zones are below the low extfrag level for this order. By default. By default, the tunable is set to 0 (=> low=100%, high=100%).

This patch is largely based on ideas from Michal Hocko posted here:
https://lore.kernel.org/linux-mm/[email protected]/

* Performance data

System: x64_64, 32G RAM, 12-cores.

I made a small driver that allocates as many hugepages as possible and measures allocation latency:

The driver first tries to allocate hugepage using GFP_TRANSHUGE_LIGHT and if that fails, tries to allocate with GFP_TRANSHUGE | __GFP_RETRY_MAYFAIL. The drives stops when both methods fail for a hugepage allocation.

Before starting the driver, the system was fragmented from a userspace program that allocates all memory and then for each 2M aligned section, frees 3/4 of base pages using munmap. The workload is mainly anonymous userspace pages which are easy to move around. I intentionally avoided unmovable pages in this test to see how much latency we incur just by hitting the slow path for most allocations.

(all latency values are in microseconds)

- With vanilla kernel 5.4.0-rc5:

percentile latency
---------- -------

         5       7
        10       7
        25       8
        30       8
        40       8
        50       8
        60       9
        75     215
        80     222
        90     323
        95     429

Total 2M hugepages allocated = 1829 (3.5G worth of hugepages out of 25G total free => 14% of free memory could be allocated as hugepages)

- Now with kernel 5.4.0-rc5 + this patch:
(hpage_compaction_effort = 60)

percentile latency
---------- -------

         5       3
        10       3
        25       4
        30       4
        40       4
        50       4
        60       5
        75       6
        80       9
        90     370
        95     652

Total 2M hugepages allocated = 11120 (21.7G worth of hugepages out of 25G total free => 86% of free memory could be allocated as hugepages)

Above workload produces a memory state which is easy to compact. However, if memory is filled with unmovable pages, pro-active compaction should essentially back off. To test this aspect, I ran a mix of this workload (thanks to Matthew Wilcox for suggesting these):

- dentry_thrash: it opens /tmp/missing.x for x in [1, 1000000] where first 10000 files actually exist.
- pagecache_thrash: it opens a 128G file (on a 32G system) and then reads at random offsets.

With this mix of workload, system quickly reaches 90-100% fragmentation wrt order-9. Trace of compaction events shows that we keep hitting compaction_deferred event, as expected.

After terminating dentry_thrash and dropping denty caches, the system could proceed with compaction according to set value of hpage_compaction_effort (60).

[1] https://patchwork.kernel.org/patch/11098289/

---
 include/linux/compaction.h |  10 ++
 mm/compaction.c            | 193 ++++++++++++++++++++++++++++++-------
 mm/vmstat.c                |  12 +++
 3 files changed, 178 insertions(+), 37 deletions(-)
include/linux/compaction.h +10 -0
index 4b898cdbdf05..7bf78b74b46a 100644
@@ -60,6 +60,15 @@ enum compact_result {
 
 struct alloc_context; /* in mm/internal.h */
 
+// "node-%d"
+#define COMPACTION_STATE_NAME_LEN 16
+// Per-node compaction state
+struct compaction_state {
+	int node_id;
+	unsigned int hpage_compaction_effort;
+	char name[COMPACTION_STATE_NAME_LEN];
+};
+
 /*
  * Number of free order-0 pages that should be available above given watermark
  * to make sure compaction has reasonable chance of not running out of free
@@ -90,6 +99,7 @@ extern int sysctl_compaction_handler(struct ctl_table *table, int write,
 extern int sysctl_extfrag_threshold;
 extern int sysctl_compact_unevictable_allowed;
 
+extern int extfrag_for_order(struct zone *zone, unsigned int order);
 extern int fragmentation_index(struct zone *zone, unsigned int order);
 extern enum compact_result try_to_compact_pages(gfp_t gfp_mask,
 		unsigned int order, unsigned int alloc_flags,
mm/compaction.c +156 -37

266 lines not on this page · raw message

mm/vmstat.c +12 -0
index 6afc892a148a..06abe3307db8 100644
@@ -1074,6 +1074,18 @@ static int __fragmentation_index(unsigned int order, struct contig_page_info *in
 	return 1000 - div_u64( (1000+(div_u64(info->free_pages * 1000ULL, requested))), info->free_blocks_total);
 }
 
+int extfrag_for_order(struct zone *zone, unsigned int order)
+{
+	struct contig_page_info info;
+
+	fill_contig_page_info(zone, order, &info);
+	if (info.free_pages == 0)
+		return 0;
+
+	return (info.free_pages - (info.free_blocks_suitable << order)) * 100
+							/ info.free_pages;
+}
+
 /* Same as __fragmentation index but allocs contig_page_info on stack */
 int fragmentation_index(struct zone *zone, unsigned int order)
 {
Signature · 1 line
2.17.1
#1 lore raw
reproduce:

Hi Nitin,

[FYI, it's a private test report for your RFC patch.] [auto build test WARNING on mmotm/master]

url:    https://github.com/0day-ci/linux/commits/Nitin-Gupta/mm-Proactive-compaction/20191102-074747
base:   git://git.cmpxchg.org/linux-mmotm.git master
config: i386-defconfig (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag

All warnings (new ones prefixed by >>):

In file included from include/linux/ioport.h:13:0,
from include/linux/device.h:15,
from include/linux/node.h:18,
from include/linux/cpu.h:17,
from mm/compaction.c:11:
In function 'extfrag_hpage_wmark',
inlined from '__compact_finished' at mm/compaction.c:1906:6,
inlined from 'compact_zone' at mm/compaction.c:1974:8:
include/linux/compiler.h:350:38: error: call to '__compiletime_assert_1860' declared with attribute error: BUILD_BUG failed
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^
include/linux/compiler.h:331:4: note: in definition of macro '__compiletime_assert'

       prefix ## suffix();    \
       ^~~~~~
   include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:59:21: note: in expansion of macro 'BUILD_BUG_ON_MSG'
    #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
                        ^~~~~~~~~~~~~~~~
>> include/linux/huge_mm.h:280:28: note: in expansion of macro 'BUILD_BUG'
    #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
                               ^~~~~~~~~
>> include/linux/huge_mm.h:78:26: note: in expansion of macro 'HPAGE_PMD_SHIFT'
    #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT)
                             ^~~~~~~~~~~~~~~
>> mm/compaction.c:1860:33: note: in expansion of macro 'HPAGE_PMD_ORDER'
     return extfrag_for_order(zone, HPAGE_PMD_ORDER) > wmark;
                                    ^~~~~~~~~~~~~~~
   In function 'extfrag_hpage_wmark',
       inlined from 'node_hpage_should_compact.isra.53' at mm/compaction.c:1868:7:
   include/linux/compiler.h:350:38: error: call to '__compiletime_assert_1860' declared with attribute error: BUILD_BUG failed
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
                                         ^
   include/linux/compiler.h:331:4: note: in definition of macro '__compiletime_assert'
       prefix ## suffix();    \
       ^~~~~~
   include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:59:21: note: in expansion of macro 'BUILD_BUG_ON_MSG'
    #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
                        ^~~~~~~~~~~~~~~~
>> include/linux/huge_mm.h:280:28: note: in expansion of macro 'BUILD_BUG'
    #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
                               ^~~~~~~~~
>> include/linux/huge_mm.h:78:26: note: in expansion of macro 'HPAGE_PMD_SHIFT'
    #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT)
                             ^~~~~~~~~~~~~~~
>> mm/compaction.c:1860:33: note: in expansion of macro 'HPAGE_PMD_ORDER'
     return extfrag_for_order(zone, HPAGE_PMD_ORDER) > wmark;
                                    ^~~~~~~~~~~~~~~
   mm/compaction.c: In function 'node_hpage_should_compact.isra.53':
   include/linux/compiler.h:350:38: error: call to '__compiletime_assert_1869' declared with attribute error: BUILD_BUG failed
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
                                         ^
   include/linux/compiler.h:331:4: note: in definition of macro '__compiletime_assert'
       prefix ## suffix();    \
       ^~~~~~
   include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:59:21: note: in expansion of macro 'BUILD_BUG_ON_MSG'
    #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
                        ^~~~~~~~~~~~~~~~
>> include/linux/huge_mm.h:280:28: note: in expansion of macro 'BUILD_BUG'
    #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
                               ^~~~~~~~~
>> include/linux/huge_mm.h:78:26: note: in expansion of macro 'HPAGE_PMD_SHIFT'
    #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT)
                             ^~~~~~~~~~~~~~~
   mm/compaction.c:1869:30: note: in expansion of macro 'HPAGE_PMD_ORDER'
       compaction_suitable(zone, HPAGE_PMD_ORDER,
                                 ^~~~~~~~~~~~~~~

vim +/HPAGE_PMD_ORDER +1860 mm/compaction.c

1851
1852 static unsigned int extfrag_hpage_wmark(struct zone *zone, bool low)
1853 {
1854 int node_id, wmark, wmark_low;
1855
1856 node_id = zone->zone_pgdat->node_id;
1857 wmark_low = 100 - compaction_states[node_id].hpage_compaction_effort;
1858 wmark = low ? wmark_low : min(wmark_low + 10, 100);
1859

> 1860		return extfrag_for_order(zone, HPAGE_PMD_ORDER) > wmark;

1861 }
1862

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#2 lore raw
In reply to Nitin Gupta
reproduce:

Hi Nitin,

[FYI, it's a private test report for your RFC patch.] [auto build test ERROR on mmotm/master]

url:    https://github.com/0day-ci/linux/commits/Nitin-Gupta/mm-Proactive-compaction/20191102-074747
base:   git://git.cmpxchg.org/linux-mmotm.git master
config: x86_64-randconfig-g003-201944 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag

All error/warnings (new ones prefixed by >>):

In file included from include/linux/ioport.h:13:0,
from include/linux/device.h:15, from include/linux/node.h:18, from include/linux/cpu.h:17, from mm/compaction.c:11:
mm/compaction.c: In function 'extfrag_hpage_wmark':

>> include/linux/compiler.h:350:38: error: call to '__compiletime_assert_1860' declared with attribute error: BUILD_BUG failed
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
                                         ^
   include/linux/compiler.h:331:4: note: in definition of macro '__compiletime_assert'
       prefix ## suffix();    \
       ^~~~~~
   include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:59:21: note: in expansion of macro 'BUILD_BUG_ON_MSG'
    #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
                        ^~~~~~~~~~~~~~~~
   include/linux/huge_mm.h:280:28: note: in expansion of macro 'BUILD_BUG'
    #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
                               ^~~~~~~~~
   include/linux/huge_mm.h:78:26: note: in expansion of macro 'HPAGE_PMD_SHIFT'
    #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT)
                             ^~~~~~~~~~~~~~~
   mm/compaction.c:1860:33: note: in expansion of macro 'HPAGE_PMD_ORDER'
     return extfrag_for_order(zone, HPAGE_PMD_ORDER) > wmark;
                                    ^~~~~~~~~~~~~~~
   In file included from include/linux/ioport.h:13:0,
                    from include/linux/device.h:15,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from mm/compaction.c:11:
   In function 'node_hpage_should_compact.isra.27',
       inlined from 'kcompactd_work_requested.isra.28' at mm/compaction.c:2608:2:
   include/linux/compiler.h:350:38: error: call to '__compiletime_assert_1870' declared with attribute error: BUILD_BUG failed
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
                                         ^
   include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
     (cond) ?     \
      ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
    #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                               ^~~~~~~~~~~~~~
>> mm/compaction.c:1868:3: note: in expansion of macro 'if'
      if (extfrag_hpage_wmark(zone, false) &&
      ^~
   include/linux/compiler.h:338:2: note: in expansion of macro '__compiletime_assert'
     __compiletime_assert(condition, msg, prefix, suffix)
     ^~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:59:21: note: in expansion of macro 'BUILD_BUG_ON_MSG'
    #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
                        ^~~~~~~~~~~~~~~~
   include/linux/huge_mm.h:280:28: note: in expansion of macro 'BUILD_BUG'
    #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
                               ^~~~~~~~~
   include/linux/huge_mm.h:78:26: note: in expansion of macro 'HPAGE_PMD_SHIFT'
    #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT)
                             ^~~~~~~~~~~~~~~
   mm/compaction.c:1869:30: note: in expansion of macro 'HPAGE_PMD_ORDER'
       compaction_suitable(zone, HPAGE_PMD_ORDER,
                                 ^~~~~~~~~~~~~~~

vim +/if +1868 mm/compaction.c

1862
1863 static bool node_hpage_should_compact(pg_data_t *pgdat)
1864 {
1865 struct zone *zone;
1866
1867 for_each_populated_zone(zone) {

> 1868			if (extfrag_hpage_wmark(zone, false) &&

1869 compaction_suitable(zone, HPAGE_PMD_ORDER,
1870 0, zone_idx(zone)) == COMPACT_CONTINUE) {
1871 return true;
1872 }
1873 }
1874 return false;
1875 }
1876

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#3 lore raw
In reply to Nitin Gupta
reproduce:

Hi Nitin,

[FYI, it's a private test report for your RFC patch.] [auto build test WARNING on mmotm/master]

url:    https://github.com/0day-ci/linux/commits/Nitin-Gupta/mm-Proactive-compaction/20191102-074747
base:   git://git.cmpxchg.org/linux-mmotm.git master
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-6-g57f8611-dirty
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag

sparse warnings: (new ones prefixed by >>)

>> mm/compaction.c:29:25: sparse: sparse: symbol 'compaction_states' was not declared. Should it be static?

include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast from restricted gfp_t
include/trace/events/compaction.h:170:1: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected unsigned long flags @@ got restricted gfpunsigned long flags @@
include/trace/events/compaction.h:170:1: sparse: expected unsigned long flags
include/trace/events/compaction.h:170:1: sparse: got restricted gfp_t [usertype] gfp_mask
include/trace/events/compaction.h:170:1: sparse: sparse: cast to restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: cast to restricted gfp_t include/trace/events/compaction.h:170:1: sparse: sparse: restricted gfp_t degrades to integer include/trace/events/compaction.h:170:1: sparse: sparse: restricted gfp_t degrades to integer include/linux/gfp.h:318:27: sparse: sparse: restricted gfp_t degrades to integer
mm/compaction.c:2343:39: sparse: sparse: incorrect type in initializer (different base types) @@ expected int may_perform_io @@ got restricted gint may_perform_io @@
mm/compaction.c:2343:39: sparse: expected int may_perform_io
mm/compaction.c:2343:39: sparse: got restricted gfp_t
mm/compaction.c:485:13: sparse: sparse: context imbalance in 'compact_lock_irqsave' - wrong count at exit include/linux/spinlock.h:393:9: sparse: sparse: context imbalance in 'compact_unlock_should_abort' - unexpected unlock mm/compaction.c:641:39: sparse: sparse: context imbalance in 'isolate_freepages_block' - unexpected unlock mm/compaction.c:1050:39: sparse: sparse: context imbalance in 'isolate_migratepages_block' - unexpected unlock

Please review and possibly fold the followup patch.

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#4 lore raw

[RFC PATCH] mm: compaction_states[] can be static

In reply to Nitin Gupta
Fixes: ff0a4b0b75b6 ("mm: Proactive compaction")
Fixes ff0a4b0b75b6 ("mm: Proactive compaction")
---
 compaction.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/compaction.c +1 -1
index b337f25b329dc..eb6e82e25ccac 100644
@@ -26,7 +26,7 @@
 #include "internal.h"
 
 #ifdef CONFIG_COMPACTION
-struct compaction_state compaction_states[MAX_NUMNODES];
+static struct compaction_state compaction_states[MAX_NUMNODES];
 #endif
 
 #ifdef CONFIG_COMPACTION