Re: Slowwwwwwwwwwww NFS read performance....

From: Ram Pai
Date: Thu Jan 15 2004 - 14:56:29 EST


On Thu, 2004-01-15 at 11:00, Trond Myklebust wrote:
> PÃ on , 14/01/2004 klokka 21:35, skreiv Trond Myklebust:
>
> > Err.. no...
> >
> > I didn't have a 2.6.1-mm3 machine ready to go in our GigE testbed (I'm
> > busy compiling one up right now). However I did run a quick test on
> > 2.6.0-test11. Iozone rather than bonnie, but the results should be
> > comparable:
>
> Hah.... They turned out not to be...
>
> The changeset with key
>
> akpm@xxxxxxxx[torvalds]|ChangeSet|20031230234945|63435
>
> # ChangeSet
> # 2003/12/30 15:49:45-08:00 akpm@xxxxxxxx
> # [PATCH] readahead: multiple performance fixes
> #
> # From: Ram Pai <linuxram@xxxxxxxxxx>
>
Yes this problem has been reported earlier. Attaching Andrew's patch
that reverts a change. This should work. Please confirm.

Thanks,
RP


diff -puN mm/filemap.c~readahead-partial-backout mm/filemap.c
--- 25/mm/filemap.c~readahead-partial-backout 2004-01-09 17:41:14.000000000 -0800
+++ 25-akpm/mm/filemap.c 2004-01-09 17:41:14.000000000 -0800
@@ -587,22 +587,13 @@ void do_generic_mapping_read(struct addr
read_actor_t actor)
{
struct inode *inode = mapping->host;
- unsigned long index, offset, last;
+ unsigned long index, offset;
struct page *cached_page;
int error;

cached_page = NULL;
index = *ppos >> PAGE_CACHE_SHIFT;
offset = *ppos & ~PAGE_CACHE_MASK;
- last = (*ppos + desc->count) >> PAGE_CACHE_SHIFT;
-
- /*
- * Let the readahead logic know upfront about all
- * the pages we'll need to satisfy this request
- */
- for (; index < last; index++)
- page_cache_readahead(mapping, ra, filp, index);
- index = *ppos >> PAGE_CACHE_SHIFT;

for (;;) {
struct page *page;
@@ -621,6 +612,7 @@ void do_generic_mapping_read(struct addr
}

cond_resched();
+ page_cache_readahead(mapping, ra, filp, index);

nr = nr - offset;
find_page:

_