Skip to content

Commit 68243e7

Browse files
Mel Gormantorvalds
Mel Gorman
authored andcommitted
mm: account for the number of times direct reclaimers get throttled
Under significant pressure when writing back to network-backed storage, direct reclaimers may get throttled. This is expected to be a short-lived event and the processes get woken up again but processes do get stalled. This patch counts how many times such stalling occurs. It's up to the administrator whether to reduce these stalls by increasing min_free_kbytes. Signed-off-by: Mel Gorman <mgorman@suse.de> Cc: David Miller <davem@davemloft.net> Cc: Neil Brown <neilb@suse.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Mike Christie <michaelc@cs.wisc.edu> Cc: Eric B Munson <emunson@mgebm.net> Cc: Eric Dumazet <eric.dumazet@gmail.com> Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Cc: Mel Gorman <mgorman@suse.de> Cc: Christoph Lameter <cl@linux.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 5515061 commit 68243e7

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

include/linux/vm_event_item.h

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
3030
FOR_ALL_ZONES(PGSTEAL_DIRECT),
3131
FOR_ALL_ZONES(PGSCAN_KSWAPD),
3232
FOR_ALL_ZONES(PGSCAN_DIRECT),
33+
PGSCAN_DIRECT_THROTTLE,
3334
#ifdef CONFIG_NUMA
3435
PGSCAN_ZONE_RECLAIM_FAILED,
3536
#endif

mm/vmscan.c

+3
Original file line numberDiff line numberDiff line change
@@ -2167,6 +2167,9 @@ static void throttle_direct_reclaim(gfp_t gfp_mask, struct zonelist *zonelist,
21672167
if (pfmemalloc_watermark_ok(pgdat))
21682168
return;
21692169

2170+
/* Account for the throttling */
2171+
count_vm_event(PGSCAN_DIRECT_THROTTLE);
2172+
21702173
/*
21712174
* If the caller cannot enter the filesystem, it's possible that it
21722175
* is due to the caller holding an FS lock or performing a journal

mm/vmstat.c

+1
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,7 @@ const char * const vmstat_text[] = {
745745
TEXTS_FOR_ZONES("pgsteal_direct")
746746
TEXTS_FOR_ZONES("pgscan_kswapd")
747747
TEXTS_FOR_ZONES("pgscan_direct")
748+
"pgscan_direct_throttle",
748749

749750
#ifdef CONFIG_NUMA
750751
"zone_reclaim_failed",

0 commit comments

Comments
 (0)