linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Re: [VM PATCH] rotate_reclaimable_page fails frequently
       [not found] <20060205150259.1549.qmail@web33007.mail.mud.yahoo.com>
@ 2006-02-05 16:39 ` Rik van Riel
  2006-02-06  1:47   ` Shantanu Goel
  2006-02-06  4:50   ` Andrew Morton
  0 siblings, 2 replies; 4+ messages in thread
From: Rik van Riel @ 2006-02-05 16:39 UTC (permalink / raw)
  To: Shantanu Goel; +Cc: linux-kernel, linux-mm

On Sun, 5 Feb 2006, Shantanu Goel wrote:

> It seems rotate_reclaimable_page fails most of the
> time due the page not being on the LRU when kswapd
> calls writepage().

The question is, why is the page not yet back on the
LRU by the time the data write completes ?

Surely a disk IO is slow enough that the page will
have been put on the LRU milliseconds before the IO
completes ?

In what kind of configuration do you run into this
problem ?

-- 
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan

--
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] 4+ messages in thread

* Re: [VM PATCH] rotate_reclaimable_page fails frequently
  2006-02-05 16:39 ` [VM PATCH] rotate_reclaimable_page fails frequently Rik van Riel
@ 2006-02-06  1:47   ` Shantanu Goel
  2006-02-06  4:50   ` Andrew Morton
  1 sibling, 0 replies; 4+ messages in thread
From: Shantanu Goel @ 2006-02-06  1:47 UTC (permalink / raw)
  To: Rik van Riel; +Cc: linux-kernel, linux-mm

> The question is, why is the page not yet back on the
> LRU by the time the data write completes ?
> 

One possibility is that dirtiness is being tracked by
buffers which are clean.  When writepage() notices
that it simply marks the page clean and calls
end_page_writeback() which then calls
rotate_reclaimable_page() before the page scanner has
had the chance to put the page back on the LRU.

> Surely a disk IO is slow enough that the page will
> have been put on the LRU milliseconds before the IO
> completes ?
> 

Agreed but if the scenario I described above is
possible, there would essentially be no delay.  I have
not examined the ext3 code paths closely.  Perhaps
someone on the list can verify if this can happen. 
The statistics seem to clearly indicate that writeback
can complete before the scanner gets a chance to put
the page back.

> In what kind of configuration do you run into this
> problem ?

Not sure what you looking for here but there is
nothing unusual on this machine that I can think of. 
The machine runs Ubuntu Breezy with Gnome.  To force 
that particular VM code path, I wrote a simple program
that gobbled a lot of mmap'ed memory and then ran the
dd test.  The only VM parameter I adjusted was
swappiness which I set to 55 instead of the default
60.

Shantanu


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

--
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] 4+ messages in thread

* Re: [VM PATCH] rotate_reclaimable_page fails frequently
  2006-02-05 16:39 ` [VM PATCH] rotate_reclaimable_page fails frequently Rik van Riel
  2006-02-06  1:47   ` Shantanu Goel
@ 2006-02-06  4:50   ` Andrew Morton
  2006-02-06  5:26     ` Shantanu Goel
  1 sibling, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2006-02-06  4:50 UTC (permalink / raw)
  To: Rik van Riel; +Cc: sgoel01, linux-kernel, linux-mm

Rik van Riel <riel@surriel.com> wrote:
>
> On Sun, 5 Feb 2006, Shantanu Goel wrote:
> 
>  > It seems rotate_reclaimable_page fails most of the
>  > time due the page not being on the LRU when kswapd
>  > calls writepage().
> 
>  The question is, why is the page not yet back on the
>  LRU by the time the data write completes ?

Could be they're ext3 pages which were written out by kjournald.  Such
pages are marked dirty but have clean buffers.  ext3_writepage() will
discover that the page is actually clean and will mark it thus without
performing any I/O.

In which case this code in shrink_list():

				/*
				 * A synchronous write - probably a ramdisk.  Go
				 * ahead and try to reclaim the page.
				 */
				if (TestSetPageLocked(page))
					goto keep;
				if (PageDirty(page) || PageWriteback(page))
					goto keep_locked;
				mapping = page_mapping(page);
			case PAGE_CLEAN:
				; /* try to free the page below */

should just go and reclaim the page immediately.

Shantanu, I suggest you add some instrumentation there too, see if it's
working.  (That'll be non-trivial.  Just because we hit PAGE_CLEAN: here
doesn't necessarily mean that the page will be reclaimed).

--
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] 4+ messages in thread

* Re: [VM PATCH] rotate_reclaimable_page fails frequently
  2006-02-06  4:50   ` Andrew Morton
@ 2006-02-06  5:26     ` Shantanu Goel
  0 siblings, 0 replies; 4+ messages in thread
From: Shantanu Goel @ 2006-02-06  5:26 UTC (permalink / raw)
  To: Andrew Morton, Rik van Riel; +Cc: sgoel01, linux-kernel, linux-mm

--- Andrew Morton <akpm@osdl.org> wrote:

> Rik van Riel <riel@surriel.com> wrote:
> >  The question is, why is the page not yet back on
> the
> >  LRU by the time the data write completes ?
> 
> Could be they're ext3 pages which were written out
> by kjournald.  Such
> pages are marked dirty but have clean buffers. 
> ext3_writepage() will
> discover that the page is actually clean and will
> mark it thus without
> performing any I/O.
> 

I had conjectured that something like this might be
happening without knowing the details of how ext3
implements writepage.  The filesystem tested on here
is  ext3.

> Shantanu, I suggest you add some instrumentation
> there too, see if it's
> working.  (That'll be non-trivial.  Just because we
> hit PAGE_CLEAN: here
> doesn't necessarily mean that the page will be
> reclaimed).

I'll do so and report back the results.

Shantanu


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

--
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] 4+ messages in thread

end of thread, other threads:[~2006-02-06  5:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20060205150259.1549.qmail@web33007.mail.mud.yahoo.com>
2006-02-05 16:39 ` [VM PATCH] rotate_reclaimable_page fails frequently Rik van Riel
2006-02-06  1:47   ` Shantanu Goel
2006-02-06  4:50   ` Andrew Morton
2006-02-06  5:26     ` Shantanu Goel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox