* [VFS PATCH] readahead: fix block ordering in __do_page_cache_readahead [not found] <288541983.9689922.1452804546109.JavaMail.zimbra@redhat.com> @ 2016-01-14 20:58 ` Bob Peterson 2016-01-21 14:09 ` Jan Kara 0 siblings, 1 reply; 3+ messages in thread From: Bob Peterson @ 2016-01-14 20:58 UTC (permalink / raw) To: linux-fsdevel; +Cc: Al Viro 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++; ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [VFS PATCH] readahead: fix block ordering in __do_page_cache_readahead 2016-01-14 20:58 ` [VFS PATCH] readahead: fix block ordering in __do_page_cache_readahead Bob Peterson @ 2016-01-21 14:09 ` Jan Kara 2016-01-21 21:03 ` Andrew Morton 0 siblings, 1 reply; 3+ messages in thread From: Jan Kara @ 2016-01-21 14:09 UTC (permalink / raw) To: Bob Peterson; +Cc: linux-fsdevel, Al Viro, Andrew Morton, Wu Fengguang On Thu 14-01-16 15:58:53, Bob Peterson wrote: > 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. > > Signed-off-by: Bob Peterson <rpeterso@redhat.com> The patch looks good to me. But I've added CC's to some relevant people. Honza > --- > 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++; > -- > To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Jan Kara <jack@suse.com> SUSE Labs, CR ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [VFS PATCH] readahead: fix block ordering in __do_page_cache_readahead 2016-01-21 14:09 ` Jan Kara @ 2016-01-21 21:03 ` Andrew Morton 0 siblings, 0 replies; 3+ messages in thread From: Andrew Morton @ 2016-01-21 21:03 UTC (permalink / raw) To: Jan Kara; +Cc: Bob Peterson, linux-fsdevel, Al Viro, Wu Fengguang On Thu, 21 Jan 2016 15:09:16 +0100 Jan Kara <jack@suse.cz> wrote: > On Thu 14-01-16 15:58:53, Bob Peterson wrote: > > 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. > > > > Signed-off-by: Bob Peterson <rpeterso@redhat.com> > > The patch looks good to me. But I've added CC's to some relevant people. > The patch looks good to me. How curious. It's hard to believe that this has persisted for so long without being noticed. However "kernel test robot" is reporting a 13.5% performance regression from this patch. http://comments.gmane.org/gmane.linux.kernel/2128714 ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-01-21 21:03 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <288541983.9689922.1452804546109.JavaMail.zimbra@redhat.com> 2016-01-14 20:58 ` [VFS PATCH] readahead: fix block ordering in __do_page_cache_readahead Bob Peterson 2016-01-21 14:09 ` Jan Kara 2016-01-21 21:03 ` Andrew Morton
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).