mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: Nikanth Karthikesan <knikanth@suse.de>,
	Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org
Subject: Re: [bug] as_merged_requests(): possible recursive locking detected
Date: Sat, 2 Feb 2008 11:54:49 +1100	[thread overview]
Message-ID: <200802021154.50174.nickpiggin@yahoo.com.au> (raw)
In-Reply-To: <20080201103151.GL15220@kernel.dk>

On Friday 01 February 2008 21:31, Jens Axboe wrote:
> On Fri, Feb 01 2008, Jens Axboe wrote:

> > I think the right solution is to remove swap_io_context() and fix the io
> > context referencing in as-iosched.c instead.
>
> IOW, the below. I don't know why Nick originally wanted to swap io
> contexts for a rq <-> rq merge, there seems little (if any) benefit to
> doing so.

Yeah, I guess this patch is fine. Simpler is better.

>
> diff --git a/block/as-iosched.c b/block/as-iosched.c
> index 9603684..852803e 100644
> --- a/block/as-iosched.c
> +++ b/block/as-iosched.c
> @@ -1266,22 +1266,8 @@ static void as_merged_requests(struct request_queue
> *q, struct request *req, */
>  	if (!list_empty(&req->queuelist) && !list_empty(&next->queuelist)) {
>  		if (time_before(rq_fifo_time(next), rq_fifo_time(req))) {
> -			struct io_context *rioc = RQ_IOC(req);
> -			struct io_context *nioc = RQ_IOC(next);
> -
>  			list_move(&req->queuelist, &next->queuelist);
>  			rq_set_fifo_time(req, rq_fifo_time(next));
> -			/*
> -			 * Don't copy here but swap, because when anext is
> -			 * removed below, it must contain the unused context
> -			 */
> -			if (rioc != nioc) {
> -				double_spin_lock(&rioc->lock, &nioc->lock,
> -								rioc < nioc);
> -				swap_io_context(&rioc, &nioc);
> -				double_spin_unlock(&rioc->lock, &nioc->lock,
> -								rioc < nioc);
> -			}
>  		}
>  	}
>
> diff --git a/block/blk-ioc.c b/block/blk-ioc.c
> index 6d16755..80245dc 100644
> --- a/block/blk-ioc.c
> +++ b/block/blk-ioc.c
> @@ -176,15 +176,6 @@ void copy_io_context(struct io_context **pdst, struct
> io_context **psrc) }
>  EXPORT_SYMBOL(copy_io_context);
>
> -void swap_io_context(struct io_context **ioc1, struct io_context **ioc2)
> -{
> -	struct io_context *temp;
> -	temp = *ioc1;
> -	*ioc1 = *ioc2;
> -	*ioc2 = temp;
> -}
> -EXPORT_SYMBOL(swap_io_context);
> -
>  int __init blk_ioc_init(void)
>  {
>  	iocontext_cachep = kmem_cache_create("blkdev_ioc",
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index baba233..bbe3cf4 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -39,7 +39,6 @@ void exit_io_context(void);
>  struct io_context *get_io_context(gfp_t gfp_flags, int node);
>  struct io_context *alloc_io_context(gfp_t gfp_flags, int node);
>  void copy_io_context(struct io_context **pdst, struct io_context **psrc);
> -void swap_io_context(struct io_context **ioc1, struct io_context **ioc2);
>
>  struct request;
>  typedef void (rq_end_io_fn)(struct request *, int);

  reply	other threads:[~2008-02-02  0:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-31 22:14 Ingo Molnar
2008-01-31 22:19 ` Ingo Molnar
2008-02-01  8:40 ` Jens Axboe
2008-02-01 10:45   ` Ingo Molnar
2008-02-01 10:47     ` Jens Axboe
2008-02-01 11:01       ` Ingo Molnar
2008-02-01 11:22         ` Jens Axboe
     [not found]           ` <47A35177.BANGALORE.BLR.100.174746A.1.1085C.1@1:7.BANGALORE.BLR.100.0.1.0.1@16>
2008-02-01 11:53             ` Fwd: " Nikanth Karthikesan
2008-02-01 10:03 ` Nikanth Karthikesan
2008-02-01 10:12   ` Jens Axboe
2008-02-01 10:31     ` Jens Axboe
2008-02-02  0:54       ` Nick Piggin [this message]
2008-02-01 11:00     ` Nikanth Karthikesan

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=200802021154.50174.nickpiggin@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=jens.axboe@oracle.com \
    --cc=knikanth@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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®