Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

[patch 6/7] blk: add plug for blkdev_issue_discard

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


shli at fusionio

Mar 11, 2012, 8:04 PM

Post #1 of 5 (139 views)
Permalink
[patch 6/7] blk: add plug for blkdev_issue_discard

In raid 0 case, a big discard request is divided into several small requests
in chunk_size unit. Such requests can be merged in low layer if we have
correct plug added. This should improve the performance a little bit.

raid 10 case doesn't matter, as we dispatch request in a separate thread
and there is plug there.

Signed-off-by: Shaohua Li <shli [at] fusionio>
---
block/blk-lib.c | 3 +++
1 file changed, 3 insertions(+)

Index: linux/block/blk-lib.c
===================================================================
--- linux.orig/block/blk-lib.c 2012-03-09 16:56:41.043790011 +0800
+++ linux/block/blk-lib.c 2012-03-12 10:21:38.716609525 +0800
@@ -47,6 +47,7 @@ int blkdev_issue_discard(struct block_de
struct bio_batch bb;
struct bio *bio;
int ret = 0;
+ struct blk_plug plug;

if (!q)
return -ENXIO;
@@ -78,6 +79,7 @@ int blkdev_issue_discard(struct block_de
bb.flags = 1 << BIO_UPTODATE;
bb.wait = &wait;

+ blk_start_plug(&plug);
while (nr_sects) {
bio = bio_alloc(gfp_mask, 1);
if (!bio) {
@@ -102,6 +104,7 @@ int blkdev_issue_discard(struct block_de
atomic_inc(&bb.done);
submit_bio(type, bio);
}
+ blk_finish_plug(&plug);

/* Wait for bios in-flight */
if (!atomic_dec_and_test(&bb.done))

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


vgoyal at redhat

Mar 13, 2012, 8:51 AM

Post #2 of 5 (128 views)
Permalink
Re: [patch 6/7] blk: add plug for blkdev_issue_discard [In reply to]

On Mon, Mar 12, 2012 at 11:04:18AM +0800, Shaohua Li wrote:
> In raid 0 case, a big discard request is divided into several small requests
> in chunk_size unit. Such requests can be merged in low layer if we have
> correct plug added. This should improve the performance a little bit.

Martin posted a patch to remove the support for allowing merging of discard
requests. But this seems to be a reasonable use case for allowing mering
discard requests. CCing Martin.

Thanks
Vivek
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


martin.petersen at oracle

Mar 13, 2012, 10:04 AM

Post #3 of 5 (128 views)
Permalink
Re: [patch 6/7] blk: add plug for blkdev_issue_discard [In reply to]

>>>>> "Vivek" == Vivek Goyal <vgoyal [at] redhat> writes:

Vivek> On Mon, Mar 12, 2012 at 11:04:18AM +0800, Shaohua Li wrote:
>> In raid 0 case, a big discard request is divided into several small
>> requests in chunk_size unit. Such requests can be merged in low layer
>> if we have correct plug added. This should improve the performance a
>> little bit.

Vivek> Martin posted a patch to remove the support for allowing merging
Vivek> of discard requests. But this seems to be a reasonable use case
Vivek> for allowing mering discard requests. CCing Martin.

Merging discard requests is hard given how we need to prepare the
command payload at the bottom of the stack. The current upstream merge
code pretends to be working but it actually doesn't. That's why I want
it dead and buried.

I have some changes pending (that I need for the REQ_COPY support) that
will make merging of non-rw requests easier to deal with. But that's a
kernel release cycle away...

--
Martin K. Petersen Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


vgoyal at redhat

Mar 13, 2012, 10:14 AM

Post #4 of 5 (129 views)
Permalink
Re: [patch 6/7] blk: add plug for blkdev_issue_discard [In reply to]

On Tue, Mar 13, 2012 at 01:04:58PM -0400, Martin K. Petersen wrote:
> >>>>> "Vivek" == Vivek Goyal <vgoyal [at] redhat> writes:
>
> Vivek> On Mon, Mar 12, 2012 at 11:04:18AM +0800, Shaohua Li wrote:
> >> In raid 0 case, a big discard request is divided into several small
> >> requests in chunk_size unit. Such requests can be merged in low layer
> >> if we have correct plug added. This should improve the performance a
> >> little bit.
>
> Vivek> Martin posted a patch to remove the support for allowing merging
> Vivek> of discard requests. But this seems to be a reasonable use case
> Vivek> for allowing mering discard requests. CCing Martin.
>
> Merging discard requests is hard given how we need to prepare the
> command payload at the bottom of the stack. The current upstream merge
> code pretends to be working but it actually doesn't. That's why I want
> it dead and buried.
>
> I have some changes pending (that I need for the REQ_COPY support) that
> will make merging of non-rw requests easier to deal with. But that's a
> kernel release cycle away...

So first we will get rid of mering discard request and then enable after
one release cycle once REQ_COPY support is in?

Thanks
Vivek
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


martin.petersen at oracle

Mar 13, 2012, 10:19 AM

Post #5 of 5 (126 views)
Permalink
Re: [patch 6/7] blk: add plug for blkdev_issue_discard [In reply to]

>>>>> "Vivek" == Vivek Goyal <vgoyal [at] redhat> writes:

Vivek> So first we will get rid of mering discard request

We'll get rid of code that doesn't do anything other than confuse.


Vivek> and then enable after one release cycle once REQ_COPY support is
Vivek> in?

The new code will be entirely different. And one cycle is optimistic
given the current state of affairs in T10.

--
Martin K. Petersen Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.