All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fengguang Wu <wfg@mail.ustc.edu.cn>
To: Andrew Morton <akpm@osdl.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 6/9] readahead: save mmap read-around states in file_ra_state
Date: Sun, 16 Dec 2007 19:59:34 +0800	[thread overview]
Message-ID: <397806668.49083@ustc.edu.cn> (raw)
Message-ID: <20071216120418.360445517@mail.ustc.edu.cn> (raw)
In-Reply-To: 20071216115927.986126305@mail.ustc.edu.cn

[-- Attachment #1: readahead-convert-mmap-readaround.patch --]
[-- Type: text/plain, Size: 881 bytes --]

Change mmap read-around to share the same code style and data structure
with readahead code.

Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn>
---
 mm/filemap.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

--- linux-2.6.24-rc4-mm1.orig/mm/filemap.c
+++ linux-2.6.24-rc4-mm1/mm/filemap.c
@@ -1333,13 +1333,15 @@ static void do_sync_mmap_readahead(struc
 	if (ra->mmap_miss > MMAP_LOTSAMISS)
 		return;
 
-	ra_pages = max_sane_readahead(file->f_ra.ra_pages);
+	/*
+	 * mmap read-around
+	 */
+	ra_pages = max_sane_readahead(ra->ra_pages);
 	if (ra_pages) {
-		pgoff_t start = 0;
-
-		if (offset > ra_pages / 2)
-			start = offset - ra_pages / 2;
-		do_page_cache_readahead(mapping, file, start, ra_pages);
+		ra->start = max_t(long, 0, offset - ra_pages / 2);
+		ra->size = ra_pages;
+		ra->async_size = 0;
+		ra_submit(ra, mapping, file);
 	}
 }
 

-- 

  parent reply	other threads:[~2007-12-16 12:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-16 11:59 [PATCH 0/9] mmap read-around and readahead Fengguang Wu
2007-12-16 11:59 ` Fengguang Wu
2007-12-16 23:35   ` Linus Torvalds
2007-12-18 11:46     ` Fengguang Wu
2007-12-18 11:46       ` Fengguang Wu
     [not found]     ` <20071218114609.GA27778@mail.ustc.edu.cn>
2007-12-18 12:13       ` Fengguang Wu
2007-12-18 12:13         ` Fengguang Wu
2007-12-19  7:37     ` Fengguang Wu
2007-12-19  7:37       ` Fengguang Wu
2007-12-16 11:59 ` [PATCH 1/9] readahead: simplify readahead call scheme Fengguang Wu
2007-12-16 11:59   ` Fengguang Wu
2007-12-16 11:59 ` [PATCH 2/9] readahead: clean up and simplify the code for filemap page fault readahead Fengguang Wu
2007-12-16 11:59   ` Fengguang Wu
2007-12-18  8:19   ` Nick Piggin
2007-12-18 11:50     ` Fengguang Wu
2007-12-18 11:50       ` Fengguang Wu
2007-12-18 23:54       ` Nick Piggin
2007-12-19  6:55         ` Fengguang Wu
2007-12-19  6:55           ` Fengguang Wu
2007-12-16 11:59 ` [PATCH 3/9] readahead: auto detection of sequential mmap reads Fengguang Wu
2007-12-16 11:59   ` Fengguang Wu
2007-12-16 11:59 ` [PATCH 4/9] readahead: quick startup on sequential mmap readahead Fengguang Wu
2007-12-16 11:59   ` Fengguang Wu
2007-12-16 11:59 ` [PATCH 5/9] readahead: make ra_submit() non-static Fengguang Wu
2007-12-16 11:59   ` Fengguang Wu
2007-12-16 11:59 ` Fengguang Wu [this message]
2007-12-16 11:59   ` [PATCH 6/9] readahead: save mmap read-around states in file_ra_state Fengguang Wu
2007-12-16 11:59 ` [PATCH 7/9] readahead: remove unused do_page_cache_readahead() Fengguang Wu
2007-12-16 11:59   ` Fengguang Wu
2007-12-16 11:59 ` [PATCH 8/9] readahead: move max_sane_readahead() calls into force_page_cache_readahead() Fengguang Wu
2007-12-16 11:59   ` Fengguang Wu
2007-12-16 11:59 ` [PATCH 9/9] readahead: call max_sane_readahead() in ondemand_readahead() Fengguang Wu
2007-12-16 11:59   ` Fengguang Wu
  -- strict thread matches above, loose matches on Subject: below --
2007-12-22  1:31 [PATCH 0/9] mmap read-around and readahead take 2 Fengguang Wu
2007-12-22  1:31 ` [PATCH 6/9] readahead: save mmap read-around states in file_ra_state Fengguang Wu
2007-12-22  1:31   ` Fengguang Wu

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=397806668.49083@ustc.edu.cn \
    --to=wfg@mail.ustc.edu.cn \
    --cc=akpm@osdl.org \
    --cc=torvalds@linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.