public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Fengguang Wu <wfg@mail.ustc.edu.cn>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
	Nick Piggin <nickpiggin@yahoo.com.au>,
	Lubos Lunak <l.lunak@suse.cz>
Subject: Re: [PATCH 7/7] iosched: introduce deadline_kick_page()
Date: Sat, 24 Jun 2006 13:01:04 +0200	[thread overview]
Message-ID: <20060624110104.GP4083@suse.de> (raw)
In-Reply-To: <20060624082312.833976992@localhost.localdomain>

On Sat, Jun 24 2006, Fengguang Wu wrote:
> Introduce deadline_kick_page() to
> 	- find the request containing the page
> 	- remove its BIO_RW_AHEAD flag
> 	- reschedule if it was of type READA
> 
> Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn>
> ---
> 
> 
>  block/deadline-iosched.c |   45 +++++++++++++++++++++++++++++++++++++++++++--
>  1 files changed, 43 insertions(+), 2 deletions(-)
> 
> --- linux-2.6.17-rc6-mm2.orig/block/deadline-iosched.c
> +++ linux-2.6.17-rc6-mm2/block/deadline-iosched.c
> @@ -317,6 +317,44 @@ deadline_add_request(struct request_queu
>  }
>  
>  /*
> + * We have a pending read on @page,
> + * find the corresponding request of type READA,
> + * promote it to READ, and reschedule it.
> + */
> +static int
> +deadline_kick_page(struct request_queue *q, struct page *page)
> +{
> +	struct deadline_data *dd = q->elevator->elevator_data;
> +	struct deadline_rq *drq;
> +	struct request *rq;
> +	struct list_head *pos;
> +	struct bio_vec *bvec;
> +	struct bio *bio;
> +	int i;
> +
> +	list_for_each(pos, &dd->fifo_list[READ]) {
> +		drq = list_entry_fifo(pos);
> +		rq = drq->request;
> +		if (rq->flags & (1 << BIO_RW_AHEAD)) {
> +			rq_for_each_bio(bio, rq) {
> +				bio_for_each_segment(bvec, bio, i) {
> +					if (page == bvec->bv_page)
> +						goto found;
> +				}
> +			}
> +		}
> +	}

Uh that's horrible!

Before we go into further details, I'd like to see some numbers on where
this makes a difference.

-- 
Jens Axboe


  parent reply	other threads:[~2006-06-24 10:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20060624082006.574472632@localhost.localdomain>
2006-06-24  8:20 ` [PATCH 0/7] [RFC] iosched: make a difference between read/readahead requests Fengguang Wu
     [not found] ` <20060624082310.253199615@localhost.localdomain>
2006-06-24  8:20   ` [PATCH 1/7] iosched: introduce WRITEA Fengguang Wu
     [not found] ` <20060624082311.501730089@localhost.localdomain>
2006-06-24  8:20   ` [PATCH 4/7] iosched: submit READA requests on possible readahead code path Fengguang Wu
     [not found] ` <20060624082311.912265883@localhost.localdomain>
2006-06-24  8:20   ` [PATCH 5/7] iosched: introduce elv_kick_page() Fengguang Wu
     [not found] ` <20060624082312.833976992@localhost.localdomain>
2006-06-24  8:20   ` [PATCH 7/7] iosched: introduce deadline_kick_page() Fengguang Wu
2006-06-24 11:01   ` Jens Axboe [this message]
     [not found]     ` <20060625063232.GA5867@mail.ustc.edu.cn>
2006-06-25  6:32       ` Fengguang Wu
2006-06-28 11:27       ` Jens Axboe
     [not found]         ` <20060704013248.GA7333@mail.ustc.edu.cn>
2006-07-04  1:32           ` Fengguang Wu
     [not found] <20060624020358.719251923@localhost.localdomain>
     [not found] ` <20060624024259.755490540@localhost.localdomain>
2006-06-24  2:04   ` Fengguang Wu

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=20060624110104.GP4083@suse.de \
    --to=axboe@suse.de \
    --cc=akpm@osdl.org \
    --cc=l.lunak@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=wfg@mail.ustc.edu.cn \
    /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