From: Ashif Harji <asharji@cs.uwaterloo.ca>
To: linux-mm@kvack.org
Cc: Nick Piggin <npiggin@suse.de>, Jan Kara <jack@suse.cz>,
linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Subject: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed
Date: Wed, 14 Mar 2007 15:58:43 -0400 (EDT) [thread overview]
Message-ID: <Pine.GSO.4.64.0703141218530.28958@cpu102.cs.uwaterloo.ca> (raw)
In-Reply-To: <20070313185554.GA5105@duck.suse.cz>
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>
---
If the same page of a file is repeatedly accessed (without accessing other
pages of that file) via the same file descriptor, mark_page_accessed is
never called after the first time the page is accessed.
The implication of this code is that for files of size less than or equal
to a single page, the page associated with such a file is likely to get
evicted from the cache regardless of how frequently it is accessed.
However, this behaviour also occurs with files of any size if the same
page is repeatedly accessed.
As a benchmark, I have an experimental web server that uses sendfile to
repeatedly transmit files. The files are based on the static portion of
the SPECweb99 fileset and range in size to model a reasonable workload.
With this workload, a significant number of the requests are for files of
size 4 KB or less.
By changing the kernel to always call mark_page_accessed, the server
throughput is increased by as much as 20%. With one test, for example,
without the change I get throughput of around 868 Mbps. After making the
change, performance increases to 1111 Mbps.
Using a configuration that should be unaffected by the change, performance
was around 855 Mbps without the change and around 851 Mbps with the
change. As expected the change had no appreciable effect.
See thread http://lkml.org/lkml/2007/3/9/403 for additional discussion on
this change.
This patch is for kernel version 2.6.20.1.
Andrew, can you also put this change into the -mm kernels for testing?
--- linux-2.6.20.1/mm/filemap.c.orig 2007-03-14 10:31:58.000000000 -0500
+++ linux-2.6.20.1/mm/filemap.c 2007-03-13 16:11:54.000000000 -0500
@@ -943,12 +943,7 @@ page_ok:
if (mapping_writably_mapped(mapping))
flush_dcache_page(page);
- /*
- * When (part of) the same page is read multiple times
- * in succession, only mark it as accessed the first time.
- */
- if (prev_index != index)
- mark_page_accessed(page);
+ mark_page_accessed(page);
prev_index = index;
/*
next prev parent reply other threads:[~2007-03-14 19:59 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-09 22:03 do_generic_mapping_read performance issue Ashif Harji
2007-03-12 14:20 ` Jan Kara
2007-03-12 14:39 ` Nick Piggin
2007-03-12 15:13 ` Jan Kara
2007-03-12 17:05 ` Ashif Harji
2007-03-12 17:35 ` Jan Kara
2007-03-13 18:43 ` Ashif Harji
2007-03-13 18:55 ` Jan Kara
2007-03-14 19:58 ` Ashif Harji [this message]
2007-03-14 20:55 ` [PATCH] mm/filemap.c: unconditionally call mark_page_accessed 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
2007-03-15 20:07 ` Nick Piggin
2007-03-15 20:31 ` Andreas Mohr
2007-03-12 16:46 ` do_generic_mapping_read performance issue Ashif Harji
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.0703141218530.28958@cpu102.cs.uwaterloo.ca \
--to=asharji@cs.uwaterloo.ca \
--cc=akpm@linux-foundation.org \
--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
all inboxes | Powered by JetHome®