From: Ashif Harji <asharji@cs.uwaterloo.ca>
To: Nick Piggin <npiggin@suse.de>
Cc: Chuck Ebbert <cebbert@redhat.com>,
linux-mm@kvack.org, Jan Kara <jack@suse.cz>,
linux-kernel@vger.kernel.org,
akpm@linux-foundation.orgAndrew Morton
<akpm@linux-foundation.org>, Rik van Riel <riel@redhat.com>
Subject: Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed
Date: Thu, 15 Mar 2007 15:55:08 -0400 (EDT) [thread overview]
Message-ID: <Pine.GSO.4.64.0703151532530.29483@cpu102.cs.uwaterloo.ca> (raw)
In-Reply-To: <20070315162944.GI8321@wotan.suse.de>
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-off-by: Ashif Harji <asharji@beta.uwaterloo.ca>
>>>
>>
>> I like mine better -- it leaves the comment:
>
> How about this? It also doesn't break the use-once heuristic.
>
> --
> 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 the page accessed.
>
> Signed-off-by: Nick Piggin <npiggin@suse.de>
>
> Index: linux-2.6/mm/filemap.c
> ===================================================================
> --- linux-2.6.orig/mm/filemap.c
> +++ linux-2.6/mm/filemap.c
> @@ -929,7 +929,7 @@ page_ok:
> * When (part of) the same page is read multiple times
> * in succession, only mark it as accessed the first time.
> */
> - if (prev_index != index)
> + if (prev_index != index || !offset)
> mark_page_accessed(page);
> prev_index = index;
>
>
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 file is accessed sequentially in small hunks, other
applications may experience performance problems related to caching. For
example, if an application frequently and non-sequentially reads from the
same page. This is especially true for files of size < PAGE_CACHE_SIZE.
But, I'm not sure if such an access pattern likely.
ashif.
--
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>
next prev parent reply other threads:[~2007-03-15 19:55 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.GSO.4.64.0703081612290.1080@cpu102.cs.uwaterloo.ca>
[not found] ` <20070312142012.GH30777@atrey.karlin.mff.cuni.cz>
[not found] ` <20070312143900.GB6016@wotan.suse.de>
[not found] ` <20070312151355.GB23532@duck.suse.cz>
[not found] ` <Pine.GSO.4.64.0703121247210.7679@cpu102.cs.uwaterloo.ca>
[not found] ` <20070312173500.GF23532@duck.suse.cz>
[not found] ` <Pine.GSO.4.64.0703131438580.8193@cpu102.cs.uwaterloo.ca>
[not found] ` <20070313185554.GA5105@duck.suse.cz>
2007-03-14 19:58 ` Ashif Harji
2007-03-14 20:55 ` Dave Kleikamp
2007-03-14 21:33 ` Andreas Mohr
2007-03-14 22:08 ` Dave Kleikamp
2007-03-15 1:36 ` Xiaoning Ding
2007-03-15 5:22 ` Ashif Harji
2007-03-15 12:46 ` Dave Kleikamp
2007-03-15 12:50 ` Nick Piggin
2007-03-15 19:07 ` Andrew Morton
2007-03-15 21:49 ` Andrea Arcangeli
2007-03-15 22:06 ` Andrew Morton
2007-03-15 23:15 ` Andrea Arcangeli
2007-03-15 15:00 ` Rik van Riel
2007-03-15 17:37 ` Valdis.Kletnieks
2007-03-15 18:35 ` Rik van Riel
2007-03-16 3:51 ` Valdis.Kletnieks
2007-03-16 4:09 ` Rik van Riel
2007-03-16 14:20 ` Anton Blanchard
2007-03-15 10:39 ` Peter Zijlstra
2007-03-15 12:38 ` Nick Piggin
2007-03-15 15:06 ` Rik van Riel
2007-03-15 15:56 ` Chuck Ebbert
2007-03-15 16:29 ` Nick Piggin
2007-03-15 17:04 ` Rik van Riel
2007-03-15 17:44 ` Hugh Dickins
2007-03-15 20:01 ` Nick Piggin
2007-03-15 22:59 ` Andrea Arcangeli
2007-03-15 23:15 ` Dave Kleikamp
2007-03-15 23:28 ` Andrea Arcangeli
2007-03-15 19:55 ` Ashif Harji [this message]
2007-03-15 20:07 ` Nick Piggin
2007-03-15 20:31 ` Andreas Mohr
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.GSO.4.64.0703151532530.29483@cpu102.cs.uwaterloo.ca \
--to=asharji@cs.uwaterloo.ca \
--cc=akpm@linux-foundation.orgAndrew \
--cc=cebbert@redhat.com \
--cc=jack@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=npiggin@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox