Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-16 Thread Anton Blanchard
Hi, > I guess the downside to this is if a reader is reading a large file, or > several files, sequentially with a small read size (smaller than > PAGE_SIZE), the pages will be marked active after just one read pass. > My gut says the benefits of this patch outweigh the cost. I would > expect re

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Rik van Riel
[EMAIL PROTECTED] wrote: On the other hand, Andreas suggested only marking it once every 32 calls, but that required a helper variable. Statistically, jiffies%32 should end up about the same as a helper variable %32. This of course, if just calling mark_page_accessed() is actually expensive en

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Valdis . Kletnieks
On Thu, 15 Mar 2007 14:35:17 EDT, Rik van Riel said: > [EMAIL PROTECTED] wrote: > > On Wed, 14 Mar 2007 22:33:17 BST, Andreas Mohr said: > > > >> it'd seem we need some kind of state management here to figure out good > >> intervals of when to call mark_page_accessed() *again* for this page. E.g.

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Andrea Arcangeli
On Thu, Mar 15, 2007 at 06:15:45PM -0500, Dave Kleikamp wrote: > On Thu, 2007-03-15 at 23:59 +0100, Andrea Arcangeli wrote: > > On Thu, Mar 15, 2007 at 05:44:01PM +, Hugh Dickins wrote: > > > who removed the !offset condition, he should be consulted on its > > > reintroduction. > > > > the !of

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Dave Kleikamp
On Thu, 2007-03-15 at 23:59 +0100, Andrea Arcangeli wrote: > On Thu, Mar 15, 2007 at 05:44:01PM +, Hugh Dickins wrote: > > who removed the !offset condition, he should be consulted on its > > reintroduction. > > the !offset check looks a pretty broken heuristic indeed, it would > break random

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Andrea Arcangeli
On Thu, Mar 15, 2007 at 03:06:01PM -0700, Andrew Morton wrote: > On Thu, 15 Mar 2007 22:49:23 +0100 > Andrea Arcangeli <[EMAIL PROTECTED]> wrote: > > > On Thu, Mar 15, 2007 at 11:07:35AM -0800, Andrew Morton wrote: > > > > On Thu, 15 Mar 2007 01:22:45 -0400 (EDT) Ashif Harji <[EMAIL > > > > PROTE

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Andrea Arcangeli
On Thu, Mar 15, 2007 at 05:44:01PM +, Hugh Dickins wrote: > who removed the !offset condition, he should be consulted on its > reintroduction. the !offset check looks a pretty broken heuristic indeed, it would break random I/O. The real fix is to add a ra.prev_offset along with ra.prev_page, a

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Andrew Morton
On Thu, 15 Mar 2007 22:49:23 +0100 Andrea Arcangeli <[EMAIL PROTECTED]> wrote: > On Thu, Mar 15, 2007 at 11:07:35AM -0800, Andrew Morton wrote: > > > On Thu, 15 Mar 2007 01:22:45 -0400 (EDT) Ashif Harji <[EMAIL PROTECTED]> > > > wrote: > > > I still think the simple fix of removing the > > > con

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Andrea Arcangeli
On Thu, Mar 15, 2007 at 11:07:35AM -0800, Andrew Morton wrote: > > On Thu, 15 Mar 2007 01:22:45 -0400 (EDT) Ashif Harji <[EMAIL PROTECTED]> > > wrote: > > I still think the simple fix of removing the > > condition is the best approach, but I'm certainly open to alternatives. > > Yes, the problem

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Andreas Mohr
Hi, On Thu, Mar 15, 2007 at 09:07:39PM +0100, Nick Piggin wrote: > Well in general we like to help applications that help themselves. It > is actually a good heuristic, surprisingly. If an application randomly > accesses the same page (and there is no write activity going on), then > it would be b

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Nick Piggin
On Thu, Mar 15, 2007 at 03:55:08PM -0400, Ashif Harji wrote: > > It sounds like people are happy with the fix suggested by Nick. That fix > is okay with me as it fixes the problem I am having. > > I suspect, however, that by not directly detecting the problematic access > pattern, where the fi

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Nick Piggin
On Thu, Mar 15, 2007 at 05:44:01PM +, Hugh Dickins wrote: > On Thu, 15 Mar 2007, Nick Piggin wrote: > > On Thu, Mar 15, 2007 at 11:56:59AM -0400, Chuck Ebbert wrote: > > > Ashif Harji wrote: > > > > > > > > This patch unconditionally calls mark_page_accessed to prevent pages, > > > > especiall

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Ashif Harji
On Thu, 15 Mar 2007, Nick Piggin wrote: On Thu, Mar 15, 2007 at 11:56:59AM -0400, Chuck Ebbert wrote: Ashif Harji wrote: This patch unconditionally calls mark_page_accessed to prevent pages, especially for small files, from being evicted from the page cache despite frequent access. Signed-

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Andrew Morton
> On Thu, 15 Mar 2007 01:22:45 -0400 (EDT) Ashif Harji <[EMAIL PROTECTED]> > wrote: > I still think the simple fix of removing the > condition is the best approach, but I'm certainly open to alternatives. Yes, the problem of falsely activating pages when the file is read in small hunks is worse

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Rik van Riel
[EMAIL PROTECTED] wrote: On Wed, 14 Mar 2007 22:33:17 BST, Andreas Mohr said: it'd seem we need some kind of state management here to figure out good intervals of when to call mark_page_accessed() *again* for this page. E.g. despite non-changing access patterns you could still call mark_page_ac

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Hugh Dickins
On Thu, 15 Mar 2007, Nick Piggin wrote: > On Thu, Mar 15, 2007 at 11:56:59AM -0400, Chuck Ebbert wrote: > > Ashif Harji wrote: > > > > > > This patch unconditionally calls mark_page_accessed to prevent pages, > > > especially for small files, from being evicted from the page cache > > > despite fr

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Valdis . Kletnieks
On Wed, 14 Mar 2007 22:33:17 BST, Andreas Mohr said: > it'd seem we need some kind of state management here to figure out good > intervals of when to call mark_page_accessed() *again* for this page. E.g. > despite non-changing access patterns you could still call mark_page_accessed( ) > every 32 c

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Rik van Riel
Nick Piggin wrote: A change to make database style random read() workloads perform better, by calling mark_page_accessed for some non-page-aligned reads broke the case of < PAGE_CACHE_SIZE files, which will not get their prev_index moved past the first page. Combine both heuristics for marking

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Nick Piggin
On Thu, Mar 15, 2007 at 11:56:59AM -0400, Chuck Ebbert wrote: > Ashif Harji wrote: > > > > This patch unconditionally calls mark_page_accessed to prevent pages, > > especially for small files, from being evicted from the page cache > > despite frequent access. > > > > Signed-off-by: Ashif Harji <

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Chuck Ebbert
Ashif Harji wrote: > > This patch unconditionally calls mark_page_accessed to prevent pages, > especially for small files, from being evicted from the page cache > despite frequent access. > > Signed-off-by: Ashif Harji <[EMAIL PROTECTED]> > I like mine better -- it leaves the comment: From:

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Rik van Riel
Nick Piggin wrote: On Thu, Mar 15, 2007 at 11:39:14AM +0100, Peter Zijlstra wrote: On Wed, 2007-03-14 at 15:58 -0400, Ashif Harji wrote: This patch unconditionally calls mark_page_accessed to prevent pages, especially for small files, from being evicted from the page cache despite frequent acc

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Rik van Riel
Andreas Mohr wrote: I've been thinking hard how to avoid the mark_page_accessed() starvation in case of a fixed, (almost) non-changing access state, but this seems hard since it'd seem we need some kind of state management here to figure out good intervals of when to call mark_page_accessed() *a

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Nick Piggin
On Thu, Mar 15, 2007 at 07:46:56AM -0500, Dave Kleikamp wrote: > On Thu, 2007-03-15 at 01:22 -0400, Ashif Harji wrote: > > > I would tend to agree with David that: "Any application doing many > > tiny-sized reads isn't exactly asking for great performance." As well, > > applications concerned

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Dave Kleikamp
On Thu, 2007-03-15 at 01:22 -0400, Ashif Harji wrote: > I would tend to agree with David that: "Any application doing many > tiny-sized reads isn't exactly asking for great performance." As well, > applications concerned with performance and caching problems can read in a > file in PAGE_SIZE

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Nick Piggin
On Thu, Mar 15, 2007 at 11:39:14AM +0100, Peter Zijlstra wrote: > On Wed, 2007-03-14 at 15:58 -0400, Ashif Harji wrote: > > This patch unconditionally calls mark_page_accessed to prevent pages, > > especially for small files, from being evicted from the page cache despite > > frequent access. >

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-15 Thread Peter Zijlstra
On Wed, 2007-03-14 at 15:58 -0400, Ashif Harji wrote: > This patch unconditionally calls mark_page_accessed to prevent pages, > especially for small files, from being evicted from the page cache despite > frequent access. Since we're hackling over the use-once stuff again... /me brings up: http

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-14 Thread Ashif Harji
On Wed, 14 Mar 2007, Xiaoning Ding wrote: Dave Kleikamp wrote: On Wed, 2007-03-14 at 22:33 +0100, Andreas Mohr wrote: Hi, On Wed, Mar 14, 2007 at 03:55:41PM -0500, Dave Kleikamp wrote: On Wed, 2007-03-14 at 15:58 -0400, Ashif Harji wrote: This patch unconditionally calls mark_page_accessed

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-14 Thread Xiaoning Ding
Dave Kleikamp wrote: On Wed, 2007-03-14 at 22:33 +0100, Andreas Mohr wrote: Hi, On Wed, Mar 14, 2007 at 03:55:41PM -0500, Dave Kleikamp wrote: On Wed, 2007-03-14 at 15:58 -0400, Ashif Harji wrote: This patch unconditionally calls mark_page_accessed to prevent pages, especially for small files

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-14 Thread Dave Kleikamp
On Wed, 2007-03-14 at 22:33 +0100, Andreas Mohr wrote: > Hi, > > On Wed, Mar 14, 2007 at 03:55:41PM -0500, Dave Kleikamp wrote: > > On Wed, 2007-03-14 at 15:58 -0400, Ashif Harji wrote: > > > This patch unconditionally calls mark_page_accessed to prevent pages, > > > especially for small files, f

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-14 Thread Andreas Mohr
Hi, On Wed, Mar 14, 2007 at 03:55:41PM -0500, Dave Kleikamp wrote: > On Wed, 2007-03-14 at 15:58 -0400, Ashif Harji wrote: > > This patch unconditionally calls mark_page_accessed to prevent pages, > > especially for small files, from being evicted from the page cache despite > > frequent access.

Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-14 Thread Dave Kleikamp
On Wed, 2007-03-14 at 15:58 -0400, Ashif Harji wrote: > This patch unconditionally calls mark_page_accessed to prevent pages, > especially for small files, from being evicted from the page cache despite > frequent access. I guess the downside to this is if a reader is reading a large file, or se

[PATCH] mm/filemap.c: unconditionally call mark_page_accessed

2007-03-14 Thread Ashif Harji
This patch unconditionally calls mark_page_accessed to prevent pages, especially for small files, from being evicted from the page cache despite frequent access. Signed-off-by: Ashif Harji <[EMAIL PROTECTED]> --- If the same page of a file is repeatedly accessed (without accessing other pa