linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bob Peterson <rpeterso@redhat.com>
To: linux-fsdevel@vger.kernel.org
Cc: Al Viro <aviro@redhat.com>
Subject: [VFS PATCH] readahead: fix block ordering in __do_page_cache_readahead
Date: Thu, 14 Jan 2016 15:58:53 -0500 (EST)	[thread overview]
Message-ID: <287059480.9694215.1452805133579.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <288541983.9689922.1452804546109.JavaMail.zimbra@redhat.com>

Hi,

I just ran into this today. I had temporarily disabled readpages in GFS2 in order to
test something and discovered, to my surprise, that the block IOs were being issued
in reverse order. In my case, the block_map function was called in reverse block
order. In other words: lblock started at 8, then proceeded to 7, 6, 5, 4, 3, 2, 1, 0.
So I surmised the order must be wrong. After a little digging, I whipped up this
little patch. Can anyone out there corroborate this or tell me if I've I lost my mind?

Viro?

I'll add my Signed-off-by but I really haven't tested it or anything. It's kind of
moot for file systems with readpages, but it might be worth doing.

Regards,

Bob Peterson
Red Hat File Systems

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
diff --git a/mm/readahead.c b/mm/readahead.c
index ba22d7f..b76fb34 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -185,7 +185,7 @@ int __do_page_cache_readahead(struct address_space *mapping, struct file *filp,
 		if (!page)
 			break;
 		page->index = page_offset;
-		list_add(&page->lru, &page_pool);
+		list_add_tail(&page->lru, &page_pool);
 		if (page_idx == nr_to_read - lookahead_size)
 			SetPageReadahead(page);
 		ret++;

       reply	other threads:[~2016-01-14 20:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <288541983.9689922.1452804546109.JavaMail.zimbra@redhat.com>
2016-01-14 20:58 ` Bob Peterson [this message]
2016-01-21 14:09   ` [VFS PATCH] readahead: fix block ordering in __do_page_cache_readahead Jan Kara
2016-01-21 21:03     ` Andrew Morton

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=287059480.9694215.1452805133579.JavaMail.zimbra@redhat.com \
    --to=rpeterso@redhat.com \
    --cc=aviro@redhat.com \
    --cc=linux-fsdevel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).