mm: Reduce direct reclaim stalls with RAM-backed swap
Subsystems (8)
cover mm: Reduce direct reclaim stalls with RAM-backed swap
From: Matt Fleming <[email protected]>
Hi,
Systems with zram-only swap can spin in direct reclaim for 20-30 minutes without ever invoking the OOM killer. We've hit this repeatedly in production on machines with 377 GiB RAM and a 377 GiB zram device.
The problem
-----------
should_reclaim_retry() calls zone_reclaimable_pages() to estimate how much memory is still reclaimable. That estimate includes anonymous pages, on the assumption that swapping them out frees physical pages.
With disk-backed swap, that's true -- writing a page to disk frees a page of RAM, and SwapFree accurately reflects how many more pages can be written. With zram, the free slot count is inaccurate. A 377 GiB zram device with 10% used reports ~340 GiB of free swap slots, but filling those slots requires physical RAM that the system doesn't have -- that's why it's in direct reclaim in the first place.
The reclaimable estimate is off by orders of magnitude.
The fix
-------
This patch introduces two new flags: BLK_FEAT_RAM_BACKED at the block layer (set by zram and brd) and SWP_RAM_BACKED at the swap layer. When all active swap devices are RAM-backed, should_reclaim_retry() excludes anonymous pages from the reclaimable estimate and counts only file-backed pages. Once file pages are exhausted the watermark check fails and the kernel falls through to OOM.
Opting to OOM kill something over spinning in direct reclaim optimises for Mean Time To Recovery (MTTR) and prevents "brownout" situations where performance is degraded for prolonged periods (we've seen 20-30 minutes degraded system performance).
Design choices and known limitations
-------------------------------------
Why not fix zone_reclaimable_pages() globally?
Other callers (e.g. balance_pgdat() in kswapd) use the anon-inclusive count for different purposes. Changing it globally risks breaking kswapd's reclaim decisions in ways that are hard to test. Limiting the change to should_reclaim_retry() keeps the blast radius small and squarely in the direct reclaim path.
What about mixed swap configurations (zram + disk)?
When at least one disk-backed swap device is active, swap_all_ram_backed is false and the current behaviour is preserved. Per-device reclaimable accounting is possible but it's a much larger change, and mixed zram+disk configurations are uncommon in practice AFAIK.
Can we make zram free space accounting more accurate?
This is possible but probably the most complicated solution. Swap device drivers could provide a callback which RAM-backed drivers would use to estimate how much physical memory they could store given some average compression ratio (either historic or projected given a list of anon pages to swap) and the amount of free physical memory. Plus, this wouldn't be constant and would change on every invocation of the callback inline with the current compression ratio and the amount of free memory.
Build-testing
-------------
Built with defconfig, allnoconfig, allmodconfig, and multiple randconfig iterations on x86_64 / 7.0-rc2.
Matt Fleming (1):
mm: Reduce direct reclaim stalls with RAM-backed swap
drivers/block/brd.c | 3 ++- drivers/block/zram/zram_drv.c | 3 ++- include/linux/blkdev.h | 8 ++++++ include/linux/swap.h | 9 +++++++ mm/page_alloc.c | 23 ++++++++++++++++- mm/swapfile.c | 47 ++++++++++++++++++++++++++++++++++- 6 files changed, 89 insertions(+), 4 deletions(-)
Signature · 1 line
2.43.0
RFC PATCH 1/1 mm: Reduce direct reclaim stalls with RAM-backed swap
From: Matt Fleming <[email protected]>
The current should_reclaim_retry() code does not account for the fact the number of logical swap pages available for RAM-backed swap (zram, brd) is dependent on having enough free physical pages, and simply always assumes that enough pages are reclaimable to satisfy the allocation.
For instance, given a system with a 200GiB zram device (10% used) and 100MB of free physical pages, should_reclaim_retry() incorrectly concludes that it can swap 180GiB worth of anon pages to swap.
Because it appears to be always possible to write to swap, the OOM killer is delayed and the system retries in direct reclaim for prolonged periods (20-30 minutes observed in production).
Fix this by excluding anon pages from the reclaimable estimate when all active swap devices are RAM-backed. Once file-backed pages are exhausted the watermark check fails and the kernel falls through to OOM as expected.
To identify RAM-backed swap devices at swapon time, introduce BLK_FEAT_RAM_BACKED (set by zram and brd) and SWP_RAM_BACKED (swapfile.c). A cached bool swap_all_ram_backed is maintained under swap_lock by swap_update_all_ram_backed() during swapon/swapoff, which is locklessly accessed in should_reclaim_retry().
--- drivers/block/brd.c | 3 ++- drivers/block/zram/zram_drv.c | 3 ++- include/linux/blkdev.h | 8 ++++++ include/linux/swap.h | 9 +++++++ mm/page_alloc.c | 23 ++++++++++++++++- mm/swapfile.c | 47 ++++++++++++++++++++++++++++++++++- 6 files changed, 89 insertions(+), 4 deletions(-)
drivers/block/brd.c +2 -1
@@ -310,7 +310,8 @@ static int brd_alloc(int i) .max_discard_segments = 1, .discard_granularity = PAGE_SIZE, .features =BLK_FEAT_SYNCHRONOUS | - BLK_FEAT_NOWAIT, +BLK_FEAT_NOWAIT | + BLK_FEAT_RAM_BACKED, }; brd =brd_find_or_alloc_device (i);
drivers/block/zram/zram_drv.c +2 -1
@@ -3074,7 +3074,8 @@ static int zram_add(void) .max_write_zeroes_sectors = UINT_MAX, #endif .features =BLK_FEAT_STABLE_WRITES | - BLK_FEAT_SYNCHRONOUS, +BLK_FEAT_SYNCHRONOUS | + BLK_FEAT_RAM_BACKED, };struct zram *zram;int ret, device_id;
include/linux/blkdev.h +8 -0
@@ -334,6 +334,9 @@ typedef unsigned int __bitwise blk_features_t;/* is a zoned device */ #define BLK_FEAT_ZONED ((__force blk_features_t)(1u << 10)) +/* storage is backed by system RAM (e.g. zram, brd) */ +#define BLK_FEAT_RAM_BACKED ((__force blk_features_t)(1u << 11)) +/* supports PCI(e) p2p requests */ #define BLK_FEAT_PCI_P2PDMA ((__force blk_features_t)(1u << 12))
@@ -1477,6 +1480,11 @@ static inline bool bdev_synchronous(struct block_device *bdev)return bdev->bd_disk->queue->limits.features &BLK_FEAT_SYNCHRONOUS ; } +static inline bool bdev_ram_backed (struct block_device *bdev) +{ +return bdev->bd_disk->queue->limits.features &BLK_FEAT_RAM_BACKED ; +} +static inline bool bdev_stable_writes (struct block_device *bdev) {struct request_queue *q =bdev_get_queue (bdev);
include/linux/swap.h +9 -0
@@ -216,6 +216,7 @@ enum {SWP_PAGE_DISCARD = (1 <<10 ),/* freed swap page-cluster discards */ SWP_STABLE_WRITES = (1 <<11 ),/* no overwrite PG_writeback pages */ SWP_SYNCHRONOUS_IO = (1 <<12 ),/* synchronous IO is efficient */ + SWP_RAM_BACKED = (1 << 13), /* swap device uses main memory (e.g. zram) */ /* add others here before... */ };
@@ -451,6 +452,11 @@ static inline long get_nr_swap_pages(void) }extern void si_swapinfo (struct sysinfo *); +extern bool swap_all_ram_backed; +static inline bool swap_is_all_ram_backed (void ) +{ +return READ_ONCE (swap_all_ram_backed); +}extern int add_swap_count_continuation (swp_entry_t ,gfp_t );int swap_type_of (dev_t device,sector_t offset);int find_first_swap (dev_t *device);
@@ -508,6 +514,9 @@ static inline void put_swap_device(struct swap_info_struct *si)#define si_swapinfo (val) \ do { (val)->freeswap = (val)->totalswap = 0; } while (0) + +static inline bool swap_is_all_ram_backed (void ) {return false; } +#define free_folio_and_swap_cache (folio) \ folio_put(folio)#define free_pages_and_swap_cache (pages, nr) \
mm/page_alloc.c +22 -1
@@ -37,6 +37,7 @@#include <linux/vmstat.h> #include <linux/fault-inject.h> #include <linux/compaction.h> +#include <linux/swap.h> #include <trace/events/kmem.h> #include <trace/events/oom.h> #include <linux/prefetch.h>
@@ -4604,6 +4605,7 @@ should_reclaim_retry(gfp_t gfp_mask, unsigned order,struct zone *zone;struct zoneref *z;bool ret = false; +bool ram_backed_swap =swap_is_all_ram_backed ();/* * Costly allocations might have made a progress but this doesn't mean
@@ -4637,7 +4639,26 @@ should_reclaim_retry(gfp_t gfp_mask, unsigned order, !__cpuset_zone_allowed(zone, gfp_mask))continue ; - available = reclaimable =zone_reclaimable_pages (zone); +if (ram_backed_swap) { +/* +* Exclude anon pages when all swap is RAM-backed. +* The reclaimable estimate assumes anon can be +* reclaimed using free swap slots, but those slots +* are only logical accounting for zram: storing the +* swapped data still consumes physical pages. Free +* RAM is the real limit, so counting anon inflates +* 'available', keeps the watermark check passing, +* and delays falling through to OOM. +*/ + reclaimable = +zone_page_state_snapshot (zone, +NR_ZONE_INACTIVE_FILE ) + +zone_page_state_snapshot (zone, +NR_ZONE_ACTIVE_FILE ); + }else { + reclaimable =zone_reclaimable_pages (zone); + } + available = reclaimable; available +=zone_page_state_snapshot (zone,NR_FREE_PAGES );/*
mm/swapfile.c +46 -1
84 lines not on this page · raw message
Signature · 1 line
2.43.0
No way. Stop adding hacks to the block layer just because you're abusing a block driver for compressed swap. Please everyone direct their enegery to pluggable zwap backends and backing store less zswap now instead of making the zram mess even worse.
Johannes Weiner
maintainerQuoted 4 lines · Christoph Hellwig
No way. Stop adding hacks to the block layer just because you're abusing a block driver for compressed swap. Please everyone direct their enegery to pluggable zwap backends and backing store less zswap now instead of making the zram mess even worse.
+1
The virtual block device idea seems simple and attractive at first because, hey it looks just like any other swap device, and the block surface is so much smaller than the MM surface.
But compression is a *memory* consumer. A big one. And with swap it sits in the reclaim path. So now you have to solve intricate MM problems with the block layer in between.
The effectiveness of compression as a reclaim strategy is also highly variable and dependent on page contents, so the static properties of the block device abstraction are a poor fit for the problem space.
I'd propose the following:
What keeps users in the zram camp is disk-less setups.
What keeps users in the zswap camp is reclaim-writeback, cgroup accounting & control, and the prospect of fully dynamic sizing.
There are ongoing efforts to solve zswap's disk requirement and with it its dependency on static address spacing.
The gap on the zram side looks wider, and more awkward to solve given the block layer intermediary. And it's already 2.6x the SLOC of zswap.
So I fully agree. We should try to make zswap the single compressed swap implementation. It would simplify things dramatically for kernel developers working on MM and the swap subsystem. It would make things better for users too.
Shakeel Butt
reviewerHi Matt,
Thanks for the report and one request I have is to avoid cover letter for a single patch to avoid partitioning the discussion.
Quoted 8 lines · Matt Fleming
From: Matt Fleming <[email protected]>
Hi,
Systems with zram-only swap can spin in direct reclaim for 20-30 minutes without ever invoking the OOM killer. We've hit this repeatedly in production on machines with 377 GiB RAM and a 377 GiB zram device.
Have you tried zswap and if you see similar issues with zswap?
Quoted 7 lines
The problem
-----------
should_reclaim_retry()callszone_reclaimable_pages()to estimate how much memory is still reclaimable. That estimate includes anonymous pages, on the assumption that swapping them out frees physical pages.
Quoted 9 lines
With disk-backed swap, that's true -- writing a page to disk frees a page of RAM, and SwapFree accurately reflects how many more pages can be written. With zram, the free slot count is inaccurate. A 377 GiB zram device with 10% used reports ~340 GiB of free swap slots, but filling those slots requires physical RAM that the system doesn't have -- that's why it's in direct reclaim in the first place.
The reclaimable estimate is off by orders of magnitude.
Over the time we (kernel MM community) have implicitly decided to keep the kernel oom-killer very conservative as adding more heuristics in the reclaim/oom path makes the kernel more unreliable and punt the aggressiveness of oom-killing to the userspace as a policy. All major Linux deployments have started using userspace oom-killers like systemd-oomd, Android's LMKD, fb-oomd or some internal alternatives. That provides more flexibility to define the aggressiveness of oom-killing based on your business needs.
Though userspace oom-killers are prone to reliability issues (oom-killer getting stuck in reclaim or not getting enough CPU), so we (Roman) are working on adding support for BPF based oom-killer where wen think we can do oom policies more reliably.
Anyways, I am wondering if you have tried systemd-oomd or some userspace alternative. If you are interested in BPF oom-killer, we can help with that as well.
thanks,
Shakeel
Jens Axboe
maintainerQuoted 4 lines · Shakeel Butt
Hi Matt,
Thanks for the report and one request I have is to avoid cover letter for a single patch to avoid partitioning the discussion.
No - cover letters are ALWAYS fine.
Signature · 1 line
Jens Axboe
Quoted 4 lines · Shakeel Butt
Hi Matt,
Thanks for the report and one request I have is to avoid cover letter for a single patch to avoid partitioning the discussion.
Noted.
Quoted 1 line
Have you tried zswap and if you see similar issues with zswap?
Yes, we've started experimenting with zswap but that's still in progress.
Quoted 8 lines
Over the time we (kernel MM community) have implicitly decided to keep the kernel oom-killer very conservative as adding more heuristics in the reclaim/oom path makes the kernel more unreliable and punt the aggressiveness of oom-killing to the userspace as a policy. All major Linux deployments have started using userspace oom-killers like systemd-oomd, Android's LMKD, fb-oomd or some internal alternatives. That provides more flexibility to define the aggressiveness of oom-killing based on your business needs.
Quoted 8 lines
Though userspace oom-killers are prone to reliability issues (oom-killer getting stuck in reclaim or not getting enough CPU), so we (Roman) are working on adding support for BPF based oom-killer where wen think we can do oom policies more reliably.
Anyways, I am wondering if you have tried systemd-oomd or some userspace alternative. If you are interested in BPF oom-killer, we can help with that as well.
oomd is also being discussed but so far we haven't experimented with it yet.
What's the status of BPF oom-killer: is this the latest?
https://lore.kernel.org/all/[email protected]/
Thanks,
Matt
Shakeel Butt
reviewerQuoted 30 lines · Matt Fleming
Quoted 4 lines · Shakeel Butt
Hi Matt,
Thanks for the report and one request I have is to avoid cover letter for a single patch to avoid partitioning the discussion.
Noted.
Quoted 1 line
Have you tried zswap and if you see similar issues with zswap?
Yes, we've started experimenting with zswap but that's still in progress.
Quoted 8 lines
Over the time we (kernel MM community) have implicitly decided to keep the kernel oom-killer very conservative as adding more heuristics in the reclaim/oom path makes the kernel more unreliable and punt the aggressiveness of oom-killing to the userspace as a policy. All major Linux deployments have started using userspace oom-killers like systemd-oomd, Android's LMKD, fb-oomd or some internal alternatives. That provides more flexibility to define the aggressiveness of oom-killing based on your business needs.
Quoted 8 lines
Though userspace oom-killers are prone to reliability issues (oom-killer getting stuck in reclaim or not getting enough CPU), so we (Roman) are working on adding support for BPF based oom-killer where wen think we can do oom policies more reliably.
Anyways, I am wondering if you have tried systemd-oomd or some userspace alternative. If you are interested in BPF oom-killer, we can help with that as well.
Quoted 6 lines
oomd is also being discussed but so far we haven't experimented with it yet.
What's the status of BPF oom-killer: is this the latest?
Yes this is the latest and I think Roman is planning to send the next version soon.
Johannes Weiner
maintainerQuoted 4 lines · Matt Fleming
When all active swap devices are RAM-backed,
should_reclaim_retry()excludes anonymous pages from the reclaimable estimate and counts only file-backed pages. Once file pages are exhausted the watermark check fails and the kernel falls through to OOM.
What about when anon pages *are* reclaimable through compression, though? Then we'd declare OOM prematurely.
You could make the case that what is reclaimable should have been reclaimed already by the time we get here. But then you could make the same case for file pages, and then there is nothing left.
The check is meant to be an optimization. The primary OOM cutoff is that we aren't able to reclaim anything. This reclaimable check is a shortcut that says, even if we are reclaiming some, there is not enough juice in that box to keep squeezing.
Have you looked at what exactly keeps resetting no_progress_loops when the system is in this state?
I could see an argument that the two checks are not properly aligned right now. We could be making nominal forward progress on a small, heavily thrashing cache position only; but we'll keep looping because, well, look at all this anon memory! (Which isn't being reclaimed.)
If that's the case, a better solution might be to split did_some_progress into anon and file progress, and only consider the LRU pages for which reclaim is actually making headway. And ignore those where we fail to succeed - for whatever reason, really, not just this particular zram situation.
And if that isn't enough, maybe pass did_some_progress as the actual page counts instead of a bool, and only consider an LRU type reclaimable if the last scan cycle reclaimed at least N% of it.
Quoted 3 lines · Johannes Weiner
What about when anon pages *are* reclaimable through compression, though? Then we'd declare OOM prematurely.
I agree this RFC is a rather blunt approach which is why I tried to limit it to zram/brd specifically.
Quoted 11 lines
You could make the case that what is reclaimable should have been reclaimed already by the time we get here. But then you could make the same case for file pages, and then there is nothing left.
The check is meant to be an optimization. The primary OOM cutoff is that we aren't able to reclaim anything. This reclaimable check is a shortcut that says, even if we are reclaiming some, there is not enough juice in that box to keep squeezing.
Have you looked at what exactly keeps resetting
no_progress_loopswhen the system is in this state?
I pulled data for some of the worst offenders atm but I couldn't catch any in this 20-30 min brownout situation. Still, I think this illustrates the problem...
Across three machines, every reclaim_retry_zone event showed no_progress_loops = 0 and wmark_check = pass. On the busiest node (141 retry events over 5 minutes), the reclaimable estimate ranged from 4.8M to 5.3M pages (19-21 GiB). The counter never incremented once.
The reclaimable watermark check also always passes. The traced reclaimable values (19-21 GiB per zone) trivially exceed the min watermark (~68 MiB), so should_reclaim_retry() never falls through on that path either.
Sample output from a bpftrace script [1] on the reclaim_retry_zone tracepoint (LOOPS = no_progress_loops, WMARK = wmark_check):
COMM PID NODE ORDER RECLAIMABLE AVAILABLE MIN_WMARK LOOPS WMARK
app1 2133536 4 0 4960156 5013010 17522 0 1 app2 2337869 5 0 4845655 4901543 17521 0 1 app3 339457 6 0 4823519 4838900 17522 0 1 app4 2179800 6 0 4819201 4835085 17522 0 1 app5 2299092 0 0 3566433 3595953 15821 0 1 app6 2194373 7 0 5612347 5626651 17521 0 1
Here are the numbers from a 5-minute bpftrace session on a node under memory pressure:
should_reclaim_retry:
141 calls, no_progress_loops = 0 every time, wmark_check = pass every time reclaimable estimate: 4.8M - 5.3M pages (19-21 GiB)
shrink_folio_list (mm_vmscan_lru_shrink_inactive) [2]:
anon: 52M pages reclaimed / 244M scanned (21% hit rate)
53% of scan events reclaimed zero pages
file: 33M pages reclaimed / 42M scanned (78% hit rate)
21% of scan events reclaimed zero pages
priority distribution peaked at 2-3 (most aggressive levels)
[1] https://gist.github.com/mfleming/167b00bef7e1f4e686a6d32833c42079
[2] https://gist.github.com/mfleming/e31c86d3ab0a883e9053e19010150a13
A second node showed the same pattern: 18% anon scan efficiency vs 90% file, no_progress_loops = 0, wmark always passes.
Quoted 10 lines
I could see an argument that the two checks are not properly aligned right now. We could be making nominal forward progress on a small, heavily thrashing cache position only; but we'll keep looping because, well, look at all this anon memory! (Which isn't being reclaimed.)
If that's the case, a better solution might be to split
did_some_progressinto anon and file progress, and only consider the LRU pages for which reclaim is actually making headway. And ignore those where we fail to succeed - for whatever reason, really, not just this particular zram situation.
Right. The mm_vmscan_lru_shrink_inactive tracepoint shows the anon LRU being scanned aggressively at priority 1-3, but only 21% of scanned pages are reclaimed. Meanwhile file reclaim runs at 78-90% efficiency but there aren't enough file pages to satisfy the allocation.
Quoted 3 lines
And if that isn't enough, maybe pass
did_some_progressas the actual page counts instead of a bool, and only consider an LRU type reclaimable if the last scan cycle reclaimed at least N% of it.
Nice idea. I'll work on a patch.
Thanks,
Matt
Sergey Senozhatsky
maintainerQuoted 7 lines · Matt Fleming
What about mixed swap configurations (zram + disk)?
When at least one disk-backed swap device is active,
swap_all_ram_backedis false and the current behaviour is preserved. Per-device reclaimable accounting is possible but it's a much larger change, and mixed zram+disk configurations are uncommon in practice AFAIK.
There are also setups where zram is configured with a backing device (a real physical device) to which zram writeback pages, effectively releasing pool memory that they occupied.
PATCH 1/1 mm: Require LRU reclaim progress before retrying direct reclaim
In reply to Matt FlemingFrom: Matt Fleming <[email protected]>
should_reclaim_retry() uses zone_reclaimable_pages() to estimate whether retrying reclaim could eventually satisfy an allocation. It's possible for reclaim to make minimal or no progress on an LRU type despite having ample reclaimable pages, e.g. anonymous pages when the only swap is RAM-backed (zram). This can cause the reclaim path to loop indefinitely.
Track LRU reclaim progress (anon vs file) through a new struct reclaim_progress passed out of try_to_free_pages(), and only count a type's reclaimable pages if at least reclaim_progress_pct% was actually reclaimed in the last cycle.
The threshold is exposed as /proc/sys/vm/reclaim_progress_pct (default 1, range 0-100). Setting 0 disables the gate and restores the previous behaviour. Environments with only RAM-backed swap (zram) and small memory may need a higher value to prevent futile anon LRU churn from keeping the allocator spinning.
--- include/linux/swap.h | 13 +++++- mm/page_alloc.c | 101 +++++++++++++++++++++++++++++++++++-------- mm/vmscan.c | 72 ++++++++++++++++++++++-------- 3 files changed, 146 insertions(+), 40 deletions(-)
include/linux/swap.h +11 -2
@@ -368,9 +368,18 @@ void folio_mark_lazyfree(struct folio *folio);extern void swap_setup (void );/* linux/mm/vmscan.c */ +struct reclaim_progress { +unsigned long nr_reclaimed; +unsigned long nr_anon; +unsigned long nr_file; +}; +extern unsigned long zone_reclaimable_pages (struct zone *zone); -extern unsigned long try_to_free_pages (struct zonelist *zonelist,int order, -gfp_t gfp_mask,nodemask_t *mask); +extern unsigned long zone_reclaimable_file_pages (struct zone *zone); +extern unsigned long zone_reclaimable_anon_pages (struct zone *zone); +extern void try_to_free_pages (struct zonelist *zonelist,int order, +gfp_t gfp_mask,nodemask_t *mask, +struct reclaim_progress *progress);#define MEMCG_RECLAIM_MAY_SWAP (1 << 1)#define MEMCG_RECLAIM_PROACTIVE (1 << 2)
mm/page_alloc.c +82 -19
208 lines not on this page · raw message
mm/vmscan.c +53 -19
136 lines not on this page · raw message
Signature · 1 line
2.43.0
Re: [PATCH] mm: Require LRU reclaim progress before retrying direct reclaim
Quoted 19 lines · Matt Fleming
From: Matt Fleming <[email protected]>
should_reclaim_retry()useszone_reclaimable_pages()to estimate whether retrying reclaim could eventually satisfy an allocation. It's possible for reclaim to make minimal or no progress on an LRU type despite having ample reclaimable pages, e.g. anonymous pages when the only swap is RAM-backed (zram). This can cause the reclaim path to loop indefinitely.Track LRU reclaim progress (anon vs file) through a new struct
reclaim_progresspassed out oftry_to_free_pages(), and only count a type's reclaimable pages if at least reclaim_progress_pct% was actually reclaimed in the last cycle.The threshold is exposed as
/proc/sys/vm/reclaim_progress_pct(default 1, range 0-100). Setting 0 disables the gate and restores the previous behaviour. Environments with only RAM-backed swap (zram) and small memory may need a higher value to prevent futile anon LRU churn from keeping the allocator spinning.
Quoted 7 lines
Suggested-by Johannes Weiner <[email protected]>Signed-off-by Matt Fleming <[email protected]>--- include/linux/swap.h | 13 +++++- mm/page_alloc.c | 101 +++++++++++++++++++++++++++++++++++-------- mm/vmscan.c | 72 ++++++++++++++++++++++-------- 3 files changed, 146 insertions(+), 40 deletions(-)
Whoops, I fat-fingered this and sent it as a reply. I'll send it again as a separate patch. My bad.