mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org, Jens Axboe <jens.axboe@oracle.com>
Subject: [PATCH 1/2] cfq-iosched: move cfqq initialization out of cfq_find_alloc_queue()
Date: Fri, 26 Jun 2009 11:05:19 +0200	[thread overview]
Message-ID: <1246007120-24034-2-git-send-email-jens.axboe@oracle.com> (raw)
In-Reply-To: <1246007120-24034-1-git-send-email-jens.axboe@oracle.com>

We're going to be needing that init code outside of that function
to get rid of the __GFP_NOFAIL in cfqq allocation.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
---
 block/cfq-iosched.c |   37 +++++++++++++++++++++----------------
 1 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 833ec18..c760ae7 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -1641,6 +1641,26 @@ static void cfq_ioc_set_ioprio(struct io_context *ioc)
 	ioc->ioprio_changed = 0;
 }
 
+static void cfq_init_cfqq(struct cfq_data *cfqd, struct cfq_queue *cfqq,
+			  pid_t pid, int is_sync)
+{
+	RB_CLEAR_NODE(&cfqq->rb_node);
+	RB_CLEAR_NODE(&cfqq->p_node);
+	INIT_LIST_HEAD(&cfqq->fifo);
+
+	atomic_set(&cfqq->ref, 0);
+	cfqq->cfqd = cfqd;
+
+	cfq_mark_cfqq_prio_changed(cfqq);
+
+	if (is_sync) {
+		if (!cfq_class_idle(cfqq))
+			cfq_mark_cfqq_idle_window(cfqq);
+		cfq_mark_cfqq_sync(cfqq);
+	}
+	cfqq->pid = pid;
+}
+
 static struct cfq_queue *
 cfq_find_alloc_queue(struct cfq_data *cfqd, int is_sync,
 		     struct io_context *ioc, gfp_t gfp_mask)
@@ -1678,23 +1698,8 @@ retry:
 				goto out;
 		}
 
-		RB_CLEAR_NODE(&cfqq->rb_node);
-		RB_CLEAR_NODE(&cfqq->p_node);
-		INIT_LIST_HEAD(&cfqq->fifo);
-
-		atomic_set(&cfqq->ref, 0);
-		cfqq->cfqd = cfqd;
-
-		cfq_mark_cfqq_prio_changed(cfqq);
-
+		cfq_init_cfqq(cfqd, cfqq, current->pid, is_sync);
 		cfq_init_prio_data(cfqq, ioc);
-
-		if (is_sync) {
-			if (!cfq_class_idle(cfqq))
-				cfq_mark_cfqq_idle_window(cfqq);
-			cfq_mark_cfqq_sync(cfqq);
-		}
-		cfqq->pid = current->pid;
 		cfq_log_cfqq(cfqd, cfqq, "alloced");
 	}
 
-- 
1.6.3.2.306.g4f4fa


  reply	other threads:[~2009-06-26  9:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-26  9:05 [PATCH 0/2] cfq-iosched: get rid of __GFP_NOFAIL Jens Axboe
2009-06-26  9:05 ` Jens Axboe [this message]
2009-06-26 16:09   ` [PATCH 1/2] cfq-iosched: move cfqq initialization out of cfq_find_alloc_queue() Jeff Moyer
2009-06-26  9:05 ` [PATCH 2/2] cfq-iosched: get rid of the need for __GFP_FAIL in cfq_find_alloc_queue() Jens Axboe
2009-06-26 16:25   ` Jeff Moyer
2009-06-27 18:26     ` Jens Axboe
2009-06-29 13:46       ` Jeff Moyer
2009-06-29 17:34         ` Jens Axboe
2009-06-29 17:44           ` Jeff Moyer
2009-06-29 17:48             ` Jens Axboe
2009-07-09 15:44       ` Vivek Goyal
2009-07-09 17:38         ` Jens Axboe
2009-07-09 19:59           ` Vivek Goyal
2009-07-09 20:15             ` Jens Axboe
2009-07-01  9:28   ` Shan Wei
2009-07-01  9:32     ` Jens Axboe
2009-07-02  0:49       ` Shan Wei
2009-07-02  6:33         ` Jens Axboe
2009-06-26 16:05 ` [PATCH 0/2] cfq-iosched: get rid of __GFP_NOFAIL Jeff Moyer

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=1246007120-24034-2-git-send-email-jens.axboe@oracle.com \
    --to=jens.axboe@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®