public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Jan Kara <jack@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	Christoph Hellwig <hch@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	Jens Axboe <jens.axboe@oracle.com>,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: [PATCH 03/11] block: Stop abusing rq->csd.list in blk-softirq
Date: Sat,  8 Feb 2014 17:18:32 +0100	[thread overview]
Message-ID: <1391876320-25068-4-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1391876320-25068-1-git-send-email-fweisbec@gmail.com>

From: Jan Kara <jack@suse.cz>

Abusing rq->csd.list for a list of requests to complete is rather ugly.
We use rq->queuelist instead which is much cleaner. It is safe because
queuelist is used by the block layer only for requests waiting to be
submitted to a device. Thus it is unused when irq reports the request IO
is finished.

Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
 block/blk-softirq.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/block/blk-softirq.c b/block/blk-softirq.c
index 57790c1..b5c37d9 100644
--- a/block/blk-softirq.c
+++ b/block/blk-softirq.c
@@ -30,8 +30,8 @@ static void blk_done_softirq(struct softirq_action *h)
 	while (!list_empty(&local_list)) {
 		struct request *rq;
 
-		rq = list_entry(local_list.next, struct request, csd.list);
-		list_del_init(&rq->csd.list);
+		rq = list_entry(local_list.next, struct request, queuelist);
+		list_del_init(&rq->queuelist);
 		rq->q->softirq_done_fn(rq);
 	}
 }
@@ -45,9 +45,14 @@ static void trigger_softirq(void *data)
 
 	local_irq_save(flags);
 	list = this_cpu_ptr(&blk_cpu_done);
-	list_add_tail(&rq->csd.list, list);
+	/*
+	 * We reuse queuelist for a list of requests to process. Since the
+	 * queuelist is used by the block layer only for requests waiting to be
+	 * submitted to the device it is unused now.
+	 */
+	list_add_tail(&rq->queuelist, list);
 
-	if (list->next == &rq->csd.list)
+	if (list->next == &rq->queuelist)
 		raise_softirq_irqoff(BLOCK_SOFTIRQ);
 
 	local_irq_restore(flags);
@@ -136,7 +141,7 @@ void __blk_complete_request(struct request *req)
 		struct list_head *list;
 do_local:
 		list = this_cpu_ptr(&blk_cpu_done);
-		list_add_tail(&req->csd.list, list);
+		list_add_tail(&req->queuelist, list);
 
 		/*
 		 * if the list only contains our just added request,
@@ -144,7 +149,7 @@ do_local:
 		 * entries there, someone already raised the irq but it
 		 * hasn't run yet.
 		 */
-		if (list->next == &req->csd.list)
+		if (list->next == &req->queuelist)
 			raise_softirq_irqoff(BLOCK_SOFTIRQ);
 	} else if (raise_blk_irq(ccpu, req))
 		goto do_local;
-- 
1.8.3.1


  parent reply	other threads:[~2014-02-08 16:21 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-08 16:18 [RFC PATCH 00/11] smp: Single IPI cleanups Frederic Weisbecker
2014-02-08 16:18 ` [PATCH 01/11] block: Stop abusing csd.list for fifo_time Frederic Weisbecker
2014-02-08 16:18 ` [PATCH 02/11] block: Remove useless IPI struct initialization Frederic Weisbecker
2014-02-10 20:21   ` Jan Kara
2014-02-08 16:18 ` Frederic Weisbecker [this message]
2014-02-08 16:18 ` [PATCH 04/11] smp: Iterate functions through llist_for_each_entry_safe() Frederic Weisbecker
2014-02-08 16:18 ` [PATCH 05/11] smp: Remove unused list_head from csd Frederic Weisbecker
2014-02-08 16:18 ` [PATCH 06/11] smp: Teach __smp_call_function_single() to check for offline cpus Frederic Weisbecker
2014-02-08 16:18 ` [PATCH 07/11] smp: Consolidate the various smp_call_function_single() declensions Frederic Weisbecker
2014-02-10 20:27   ` Jan Kara
2014-02-08 16:18 ` [PATCH 08/11] smp: Move __smp_call_function_single() below its safe version Frederic Weisbecker
2014-02-10 20:29   ` Jan Kara
2014-02-08 16:18 ` [PATCH 09/11] watchdog: Simplify a little the IPI call Frederic Weisbecker
2014-02-10 12:26   ` Michal Hocko
2014-02-10 14:46   ` Don Zickus
2014-02-08 16:18 ` [PATCH 10/11] smp: Remove wait argument from __smp_call_function_single() Frederic Weisbecker
2014-02-08 16:42   ` Christoph Hellwig
2014-02-08 16:46     ` Frederic Weisbecker
2014-02-08 16:54       ` Christoph Hellwig
2014-02-08 16:18 ` [PATCH 11/11] smp: Enhance and precise the role & requirements of __smp_call_function_single() Frederic Weisbecker
  -- strict thread matches above, loose matches on Subject: below --
2014-02-24 15:39 [PATCH 00/11] smp: Single IPI cleanups v2 Frederic Weisbecker
2014-02-24 15:39 ` [PATCH 03/11] block: Stop abusing rq->csd.list in blk-softirq Frederic Weisbecker

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=1391876320-25068-4-git-send-email-fweisbec@gmail.com \
    --to=fweisbec@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@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