[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111122141829.GB29261@localhost>
Date: Tue, 22 Nov 2011 22:18:29 +0800
From: Wu Fengguang <fengguang.wu@...el.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Linux Memory Management List <linux-mm@...ck.org>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
Rik van Riel <riel@...hat.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>,
Andi Kleen <andi@...stfloor.org>
Subject: Re: [PATCH 8/8] readahead: dont do start-of-file readahead after
lseek()
> > --- linux-next.orig/fs/read_write.c 2011-11-20 22:02:01.000000000 +0800
> > +++ linux-next/fs/read_write.c 2011-11-20 22:02:03.000000000 +0800
> > @@ -47,6 +47,10 @@ static loff_t lseek_execute(struct file
> > file->f_pos = offset;
> > file->f_version = 0;
> > }
> > +
> > + if (!(file->f_ra.ra_flags & READAHEAD_LSEEK))
> > + file->f_ra.ra_flags |= READAHEAD_LSEEK;
> > +
> > return offset;
> > }
>
> Confused. How does READAHEAD_LSEEK get cleared again?
I thought it's not necessary (at least for this case). But yeah, it's
good to clear it to make it more reasonable and avoid unexpected things.
And it would be simple to do, in ra_submit():
- ra->ra_flags &= ~READAHEAD_MMAP;
+ ra->ra_flags &= ~(READAHEAD_MMAP | READAHEAD_LSEEK);
Thanks,
Fengguang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists