Re: [PATCH] mm: disallow direct reclaim page writeback

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Mel Gorman
Date: Friday, April 23, 2010 - 3:50 am

On Fri, Apr 23, 2010 at 11:06:32AM +1000, Dave Chinner wrote:

2G RAM, AMD Phenom with 4 cores.


Compile-based loads that fill up memory and put it under heavy memory
pressure that also dirties memory. While they are running, a kernel module
is loaded that starts allocating huge pages one at a time so that accurate
timing and the state of the system can be gathered at allocation time. The
number of allocation attempts is 90% of the number of huge pages that exist
in the system.


Yes, but unfortunately they are not in a publishable state. Parts of
them depend on an automation harness that I don't hold the copyright to.


Unfortunately, I don't know what the effect on the underlying load is
as it takes longer than the huge page allocation attempts do. The tests
objective is to check how well lumpy reclaim works undedmemory pressure.

However, the time it takes to allocate a huge page increases with direct
reclaim disabled (i.e. your patch) early in the test up until about 40%
of memory was allocated as huge pages. After that, the latencies with
disable-directreclaim are lower until the gives up while the latencies with
enable-directreclaim increase.

In other words, with direct reclaim writing back pages, lumpy reclaim is a
lot more determined to get the pages cleaned and wait on them if necessary. A
compromise patch might be to have a wait_on_page_dirty to be cleared instead
of queueing the IO and wait_on_page_writeback? How long it stalled would
depend heavily on what rate pages were getting cleaned in the background.


You are using the nr_hugepages interface and writing a large number to it
so you are also triggering the hugetlbfs retry-logic and have little control
over how many times the allocator gets called on each attempt. How many huge
pages it allocates depends on how much progress it is able to make during
lumpy reclaim.

It's why the tests I run allocate huge pages one at a time and measure
the latencies as it goes. The results tend to be quite reproducible.
Success figures would be the same between runs and the rate of
allocation success would generally be comparable as well.

Your test could do something similar by only ever requesting one additional
page. It will be good enough to measure allocation latency.  The gathering
of other system state at the time of failure is not very important here
(where as it was important during anti-frag development hence the use of a
kernel module).


Typically, there is not much variance between tests. Maybe 1-2% in allocation
success rates.


With writeback, lumpy reclaim takes a range of pages, cleans them, waits for
the IO before moving on. This causes a seeky IO pattern and takes time. Also
causes a nice amount of trashing.

With your patch, lumpy reclaim would just skip over ranges with dirty pages
until it found clean pages in a suitable range. When there is plenty of
usable memore early in the test, it probably scans more but causes less
IO so would appear faster. Later in the test, it scans more but eventually
encounters too many dirty pages and gives up. Hence, its success rates will
be more random because it depends on where exactly the dirty pages were.

If this is accurate, it will always be the case that your patch causes less
disruption in the system and will appear faster due to the lack of IO but
will be less predictable and give up easier so will have lower success
rates when there are dirty pages in the system.


The underlying workload is only important in how many pages it is
dirtying at any given time. Heck, at one point my test workload was a
single process that created a mapping the size of physical memory and in
test a) would constantly read it and in test b) would constantly write
it. Lumpy reclaim with dirty-page-writeback was always more predictable
and had higher success rates.

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] mm: disallow direct reclaim page writeback, Dave Chinner, (Mon Apr 12, 5:17 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, KOSAKI Motohiro, (Tue Apr 13, 1:31 am)
Re: [PATCH] mm: disallow direct reclaim page writeback, Dave Chinner, (Tue Apr 13, 3:29 am)
Re: [PATCH] mm: disallow direct reclaim page writeback, Dave Chinner, (Tue Apr 13, 4:19 am)
Re: [PATCH] mm: disallow direct reclaim page writeback, KOSAKI Motohiro, (Tue Apr 13, 4:39 am)
Re: [PATCH] mm: disallow direct reclaim page writeback, Dave Chinner, (Tue Apr 13, 7:36 am)
Re: [PATCH] mm: disallow direct reclaim page writeback, Mel Gorman, (Tue Apr 13, 12:34 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Chris Mason, (Tue Apr 13, 1:20 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Minchan Kim, (Tue Apr 13, 5:24 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Dave Chinner, (Tue Apr 13, 6:40 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Dave Chinner, (Tue Apr 13, 8:12 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Dave Chinner, (Tue Apr 13, 9:44 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, KAMEZAWA Hiroyuki, (Tue Apr 13, 9:59 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Dave Chinner, (Tue Apr 13, 10:41 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, KOSAKI Motohiro, (Tue Apr 13, 10:54 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Minchan Kim, (Tue Apr 13, 11:13 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, KOSAKI Motohiro, (Tue Apr 13, 11:52 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, KOSAKI Motohiro, (Tue Apr 13, 11:52 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, KOSAKI Motohiro, (Tue Apr 13, 11:52 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, KOSAKI Motohiro, (Tue Apr 13, 11:52 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Dave Chinner, (Wed Apr 14, 12:06 am)
Re: [PATCH] mm: disallow direct reclaim page writeback, Minchan Kim, (Wed Apr 14, 12:19 am)
Re: [PATCH] mm: disallow direct reclaim page writeback, Dave Chinner, (Wed Apr 14, 12:28 am)
Re: [PATCH] mm: disallow direct reclaim page writeback, Dave Chinner, (Wed Apr 14, 12:36 am)
Re: [PATCH] mm: disallow direct reclaim page writeback, Minchan Kim, (Wed Apr 14, 12:54 am)
Re: [PATCH] mm: disallow direct reclaim page writeback, KAMEZAWA Hiroyuki, (Wed Apr 14, 2:42 am)
Re: [PATCH] mm: disallow direct reclaim page writeback, Minchan Kim, (Wed Apr 14, 3:01 am)
Re: [PATCH] mm: disallow direct reclaim page writeback, Minchan Kim, (Wed Apr 14, 3:16 am)
Re: [PATCH] mm: disallow direct reclaim page writeback, Chris Mason, (Wed Apr 14, 4:20 am)
Re: [PATCH] mm: disallow direct reclaim page writeback, Chris Mason, (Wed Apr 14, 7:07 am)
Re: [PATCH] mm: disallow direct reclaim page writeback, Dave Chinner, (Wed Apr 14, 6:34 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Dave Chinner, (Wed Apr 14, 6:56 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Johannes Weiner, (Wed Apr 14, 7:37 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, KOSAKI Motohiro, (Wed Apr 14, 7:43 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, KOSAKI Motohiro, (Wed Apr 14, 9:09 pm)
[PATCH 2/4] vmscan: kill prev_priority completely, KOSAKI Motohiro, (Wed Apr 14, 9:13 pm)
[PATCH 3/4] vmscan: move priority variable into scan_control, KOSAKI Motohiro, (Wed Apr 14, 9:14 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, KOSAKI Motohiro, (Wed Apr 14, 9:35 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Dave Chinner, (Wed Apr 14, 11:20 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Dave Chinner, (Wed Apr 14, 11:32 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Dave Chinner, (Wed Apr 14, 11:58 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Dave Chinner, (Thu Apr 15, 1:54 am)
Re: [PATCH] mm: disallow direct reclaim page writeback, KOSAKI Motohiro, (Thu Apr 15, 3:21 am)
[PATCH 1/4] vmscan: simplify shrink_inactive_list(), KOSAKI Motohiro, (Thu Apr 15, 3:23 am)
[PATCH 2/4] [cleanup] mm: introduce free_pages_prepare, KOSAKI Motohiro, (Thu Apr 15, 3:24 am)
Re: [PATCH] mm: disallow direct reclaim page writeback, Chris Mason, (Thu Apr 15, 6:42 am)
Re: [PATCH 3/4] mm: introduce free_pages_bulk, Mel Gorman, (Thu Apr 15, 6:46 am)
Re: [PATCH 1/4] vmscan: delegate pageout io to flusher thr ..., Suleiman Souhlal, (Thu Apr 15, 10:24 am)
Re: [PATCH 1/4] vmscan: delegate pageout io to flusher thr ..., Suleiman Souhlal, (Thu Apr 15, 10:27 am)
Re: [PATCH 1/4] vmscan: simplify shrink_inactive_list(), Valdis.Kletnieks, (Thu Apr 15, 11:22 am)
Re: [PATCH 1/4] vmscan: simplify shrink_inactive_list(), Dave Chinner, (Thu Apr 15, 4:40 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, KAMEZAWA Hiroyuki, (Thu Apr 15, 6:13 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Dave Chinner, (Thu Apr 15, 9:14 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, KAMEZAWA Hiroyuki, (Thu Apr 15, 9:18 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Johannes Weiner, (Fri Apr 16, 4:56 pm)
Re: [PATCH 1/4] vmscan: simplify shrink_inactive_list(), Dave Chinner, (Fri Apr 16, 7:37 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Andrew Morton, (Sat Apr 17, 5:32 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Andrew Morton, (Sun Apr 18, 9:31 am)
Re: [PATCH] mm: disallow direct reclaim page writeback, Christoph Hellwig, (Sun Apr 18, 12:05 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Sorin Faibish, (Sun Apr 18, 12:10 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Sorin Faibish, (Sun Apr 18, 12:11 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Christoph Hellwig, (Sun Apr 18, 12:35 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Sorin Faibish, (Sun Apr 18, 4:34 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Dave Chinner, (Sun Apr 18, 5:35 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Arjan van de Ven, (Sun Apr 18, 5:49 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Dave Chinner, (Sun Apr 18, 6:08 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Arjan van de Ven, (Sun Apr 18, 9:32 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Dave Chinner, (Thu Apr 22, 6:06 pm)
Re: [PATCH] mm: disallow direct reclaim page writeback, Mel Gorman, (Fri Apr 23, 3:50 am)