linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 0/2] mm: reduce reclaim stalls with heavy anon and dirty cache
@ 2014-01-24 22:03 Johannes Weiner
  2014-01-24 22:03 ` [patch 1/2] mm: page-writeback: fix dirty_balance_reserve subtraction from dirtyable memory Johannes Weiner
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Johannes Weiner @ 2014-01-24 22:03 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Tejun Heo, Rik van Riel, Mel Gorman, linux-mm, linux-fsdevel,
	linux-kernel

Tejun reported stuttering and latency spikes on a system where random
tasks would enter direct reclaim and get stuck on dirty pages.  Around
50% of memory was occupied by tmpfs backed by an SSD, and another disk
(rotating) was reading and writing at max speed to shrink a partition.

Analysis:

When calculating the amount of dirtyable memory, the VM considers all
free memory and all file and anon pages as baseline to which to apply
dirty limits.  This implies that, given memory pressure from dirtied
cache, the VM would actually start swapping to make room.  But alas,
this is not really the case and page reclaim tries very hard not to
swap as long as there is any used-once cache available.  The dirty
limit may have been 10-15% of main memory, but page cache was less
than 50% of that, which means that a third of the pages that the
reclaimers actually looked at were dirty.  Kswapd stopped making
progress, and in turn allocators were forced into direct reclaim only
to get stuck on dirty/writeback congestion.

These two patches fix the dirtyable memory calculation to acknowledge
the fact that the VM does not really replace anon with dirty cache.
As such, anon memory can no longer be considered "dirtyable."

Longer term we probably want to look into reducing some of the bias
towards cache.  The problematic workload in particular was not even
using any of the anon pages, one swap burst could have resolved it.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-01-28 13:58 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-24 22:03 [patch 0/2] mm: reduce reclaim stalls with heavy anon and dirty cache Johannes Weiner
2014-01-24 22:03 ` [patch 1/2] mm: page-writeback: fix dirty_balance_reserve subtraction from dirtyable memory Johannes Weiner
2014-01-24 23:05   ` Rik van Riel
2014-01-28 13:48   ` Michal Hocko
2014-01-24 22:03 ` [patch 2/2] mm: page-writeback: do not count anon pages as " Johannes Weiner
2014-01-24 23:25   ` Rik van Riel
2014-01-28 13:58   ` Michal Hocko
2014-01-24 22:21 ` [patch 0/2] mm: reduce reclaim stalls with heavy anon and dirty cache Tejun Heo
2014-01-24 23:31   ` Tejun Heo
2014-01-24 22:30 ` Andrew Morton
2014-01-24 22:51   ` Johannes Weiner
2014-01-24 23:26     ` Rik van Riel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).