All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Wu Fengguang <fengguang.wu@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Vladislav Bolkhovitin <vst@vlnb.net>,
	Jens Axboe <jens.axboe@oracle.com>,
	Jeff Moyer <jmoyer@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH 3/3] readahead: introduce context readahead algorithm
Date: Sun, 12 Apr 2009 10:48:19 +0200	[thread overview]
Message-ID: <20090412084819.GA25314@elte.hu> (raw)
In-Reply-To: <20090412072052.686760755@intel.com>


* Wu Fengguang <fengguang.wu@intel.com> wrote:

> Introduce page cache context based readahead algorithm.
> This is to better support concurrent read streams in general.

>  /*
> + * Count contiguously cached pages from @offset-1 to @offset-@max,
> + * this count is a conservative estimation of
> + * 	- length of the sequential read sequence, or
> + * 	- thrashing threshold in memory tight systems
> + */
> +static pgoff_t count_history_pages(struct address_space *mapping,
> +				   struct file_ra_state *ra,
> +				   pgoff_t offset, unsigned long max)
> +{
> +	pgoff_t head;
> +
> +	rcu_read_lock();
> +	head = radix_tree_prev_hole(&mapping->page_tree, offset - 1, max);
> +	rcu_read_unlock();
> +
> +	return offset - 1 - head;
> +}

Very elegant method! I suspect this will work far better 
than adding various increasingly more complex heuristics.

Emphatically-Acked-by: Ingo Molnar <mingo@elte.hu>

	Ingo

  reply	other threads:[~2009-04-12  8:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-12  7:19 [PATCH 0/3] context readahead for concurrent IO take 2 Wu Fengguang
2009-04-12  7:19 ` [PATCH 1/3] radix-tree: add radix_tree_prev_hole() Wu Fengguang
2009-04-12 17:29   ` Andrew Morton
2009-04-13 13:44     ` Wu Fengguang
2009-04-12  7:19 ` [PATCH 2/3] readahead: move the random read case to bottom Wu Fengguang
2009-04-12  7:19 ` [PATCH 3/3] readahead: introduce context readahead algorithm Wu Fengguang
2009-04-12  8:48   ` Ingo Molnar [this message]
2009-04-12 12:35     ` Wu Fengguang
2009-04-12 12:35       ` Wu Fengguang
2009-04-16 17:12       ` Vladislav Bolkhovitin
2009-04-16 17:12         ` Vladislav Bolkhovitin
     [not found]   ` <87zlej7kwf.fsf@basil.nowhere.org>
2009-04-14  9:27     ` Wu Fengguang
2009-04-14 10:00       ` Andi Kleen
2009-04-14 10:58         ` Wu Fengguang
2009-04-14 11:11           ` Wu Fengguang
2009-04-15  3:43   ` Jeff Moyer
2009-04-15  4:43     ` Wu Fengguang
2009-04-15 17:55       ` Jeff Moyer
2009-04-27  4:48         ` Wu Fengguang
  -- strict thread matches above, loose matches on Subject: below --
2009-04-10 13:12 [PATCH 0/3] context readahead for concurrent IO Wu Fengguang
2009-04-10 13:12 ` [PATCH 3/3] readahead: introduce context readahead algorithm Wu Fengguang
2009-04-11  0:16   ` Andrew Morton
2009-04-12  7:11     ` Wu Fengguang

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=20090412084819.GA25314@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=fengguang.wu@intel.com \
    --cc=jens.axboe@oracle.com \
    --cc=jmoyer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vst@vlnb.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.