public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jaxboe@fusionio.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: merging discard request in the block layer
Date: Tue, 22 Mar 2011 20:54:06 +0100	[thread overview]
Message-ID: <4D88FE5E.1010204@fusionio.com> (raw)
In-Reply-To: <20110322194755.GA20122@infradead.org>

On 2011-03-22 20:47, Christoph Hellwig wrote:
> It seems the current block layer wil happily try to merge discard
> requests that were split because they are at the max that bi_size
> can hold together again.  At least that's what the
> 
> 	blk: request botched

That would seem to indicate a bug in the merging logic instead.

> make me believe when testing XFS code that allows multiple
> asynchronous discard request, unlike the current blkdev_issue_discard
> which always waits for one before starting the next.
> 
> I tried this little sniplet to prevent it:
> 
> Index: xfs/block/blk-merge.c
> ===================================================================
> --- xfs.orig/block/blk-merge.c	2011-03-22 13:07:24.733857580 +0100
> +++ xfs/block/blk-merge.c	2011-03-22 13:08:17.448856577 +0100
> @@ -373,7 +373,7 @@ static int attempt_merge(struct request_
>  	/*
>  	 * Don't merge file system requests and discard requests
>  	 */
> -	if ((req->cmd_flags & REQ_DISCARD) != (next->cmd_flags & REQ_DISCARD))
> +	if ((req->cmd_flags & REQ_DISCARD) || (next->cmd_flags & REQ_DISCARD))
>  		return 0;
>  
>  	/*

That's not going to be enough, you want to disable the bio to request
merging of discards as well in elevator.c:elv_rq_merge_ok(). Does
that then fix it?


-- 
Jens Axboe


  reply	other threads:[~2011-03-22 19:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-22 19:47 merging discard request in the block layer Christoph Hellwig
2011-03-22 19:54 ` Jens Axboe [this message]
2011-03-22 21:00   ` Christoph Hellwig
2011-03-22 21:03   ` Jens Axboe
2011-03-23 13:01     ` Christoph Hellwig
2011-03-23 15:26       ` Jens Axboe
2011-03-30 14:16     ` Christoph Hellwig
2011-05-03 18:05   ` Christoph Hellwig

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=4D88FE5E.1010204@fusionio.com \
    --to=jaxboe@fusionio.com \
    --cc=hch@infradead.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