linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Miquel van Smoorenburg <miquels@cistron.nl>
Cc: linux-mm@kvack.org
Subject: Re: PATCH: mark_page_accessed() for read()s on non-page boundaries
Date: Tue, 7 Dec 2004 14:28:05 -0800	[thread overview]
Message-ID: <20041207142805.2b7517b7.akpm@osdl.org> (raw)
In-Reply-To: <1102457139l.23999l.3l@stargazer.cistron.net>

Miquel van Smoorenburg <miquels@cistron.nl> wrote:
>
> > --- 25/mm/readahead.c~a	Tue Dec  7 13:50:04 2004
> > +++ 25-akpm/mm/readahead.c	Tue Dec  7 13:50:58 2004
> > @@ -369,8 +369,10 @@ page_cache_readahead(struct address_spac
> >  		goto out;	/* Maximally shrunk */
> >  
> >  	max = get_max_readahead(ra);
> > -	if (max == 0)
> > +	if (max == 0) {
> > +		ra->prev_page = offset;	/* For do_generic_mapping_read() */
> >  		goto out;	/* No readahead */
> > +	}
> >  
> >  	orig_next_size = ra->next_size;
> 
> OK, got it. Will go and play with that and posix_fadvise(POSIX_FADV_RANDOM)
> some more.

It'll probably need to handle the "Maximally shrunk" case too.  But I've
locally merged some readahead rework from Steve Pratt and Ram Pai, and it
looks like the changes will be simpler in that case:

page_cache_readahead(struct address_space *mapping, struct file_ra_state *ra,
		     struct file *filp, unsigned long offset,
		     unsigned long req_size)
{
	unsigned long max, min;
	unsigned long newsize = req_size;
	unsigned long block;

	/*
	 * Here we detect the case where the application is performing
	 * sub-page sized reads.  We avoid doing extra work and bogusly
	 * perturbing the readahead window expansion logic.
	 * If size is zero, there is no read ahead window so we need one
	 */
	if (offset == ra->prev_page && req_size == 1 && ra->size != 0)
		goto out;


Still.  Work against -rc3 and I can fix stuff up.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

  reply	other threads:[~2004-12-07 22:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20041207213819.GA32537@cistron.nl>
     [not found] ` <20041207135205.783860cf.akpm@osdl.org>
2004-12-07 22:05   ` Miquel van Smoorenburg
2004-12-07 22:28     ` Andrew Morton [this message]
2004-12-08 23:33       ` Miquel van Smoorenburg

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=20041207142805.2b7517b7.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-mm@kvack.org \
    --cc=miquels@cistron.nl \
    /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