All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] block: introduce a function submit_bio_noacct_mq_direct
@ 2021-03-02 19:05 ` Mikulas Patocka
  0 siblings, 0 replies; 8+ messages in thread
From: Mikulas Patocka @ 2021-03-02 19:05 UTC (permalink / raw)
  To: JeffleXu, Mike Snitzer, Heinz Mauelshagen, axboe, caspar,
	io-uring, linux-block, joseph.qi, dm-devel, hch
  Cc: Mikulas Patocka

[-- Attachment #1: block-submit-bio-mq-direct.patch --]
[-- Type: text/plain, Size: 1834 bytes --]

Introduce a function that submits bio to a request-based device driver.
The function doesn't offload requests to current->bio_list. It is expected
to be called from device mapper, where current->bio_list is already set
up.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

---
 block/blk-core.c       |   16 ++++++++++++++++
 include/linux/blkdev.h |    1 +
 2 files changed, 17 insertions(+)

Index: linux-2.6/block/blk-core.c
===================================================================
--- linux-2.6.orig/block/blk-core.c	2021-03-01 19:47:27.000000000 +0100
+++ linux-2.6/block/blk-core.c	2021-03-02 10:43:28.000000000 +0100
@@ -992,6 +992,22 @@ static blk_qc_t __submit_bio_noacct(stru
 	return ret;
 }
 
+blk_qc_t submit_bio_noacct_mq_direct(struct bio *bio)
+{
+	struct gendisk *disk = bio->bi_bdev->bd_disk;
+
+	if (unlikely(bio_queue_enter(bio) != 0))
+		return BLK_QC_T_NONE;
+	
+	if (!blk_crypto_bio_prep(&bio)) {
+		blk_queue_exit(disk->queue);
+		return BLK_QC_T_NONE;
+	}
+
+	return blk_mq_submit_bio(bio);
+}
+EXPORT_SYMBOL(submit_bio_noacct_mq_direct);
+
 static blk_qc_t __submit_bio_noacct_mq(struct bio *bio)
 {
 	struct bio_list bio_list[2] = { };
Index: linux-2.6/include/linux/blkdev.h
===================================================================
--- linux-2.6.orig/include/linux/blkdev.h	2021-03-01 19:47:29.000000000 +0100
+++ linux-2.6/include/linux/blkdev.h	2021-03-02 10:44:04.000000000 +0100
@@ -912,6 +912,7 @@ static inline void rq_flush_dcache_pages
 
 extern int blk_register_queue(struct gendisk *disk);
 extern void blk_unregister_queue(struct gendisk *disk);
+blk_qc_t submit_bio_noacct_mq_direct(struct bio *bio);
 blk_qc_t submit_bio_noacct(struct bio *bio);
 extern void blk_rq_init(struct request_queue *q, struct request *rq);
 extern void blk_put_request(struct request *);


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dm-devel] [PATCH 1/4] block: introduce a function submit_bio_noacct_mq_direct
@ 2021-03-02 19:05 ` Mikulas Patocka
  0 siblings, 0 replies; 8+ messages in thread
From: Mikulas Patocka @ 2021-03-02 19:05 UTC (permalink / raw)
  To: JeffleXu, Mike Snitzer, Heinz Mauelshagen, axboe, caspar,
	io-uring, linux-block, joseph.qi, dm-devel, hch
  Cc: Mikulas Patocka

[-- Attachment #1: block-submit-bio-mq-direct.patch --]
[-- Type: text/plain, Size: 1933 bytes --]

Introduce a function that submits bio to a request-based device driver.
The function doesn't offload requests to current->bio_list. It is expected
to be called from device mapper, where current->bio_list is already set
up.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

---
 block/blk-core.c       |   16 ++++++++++++++++
 include/linux/blkdev.h |    1 +
 2 files changed, 17 insertions(+)

Index: linux-2.6/block/blk-core.c
===================================================================
--- linux-2.6.orig/block/blk-core.c	2021-03-01 19:47:27.000000000 +0100
+++ linux-2.6/block/blk-core.c	2021-03-02 10:43:28.000000000 +0100
@@ -992,6 +992,22 @@ static blk_qc_t __submit_bio_noacct(stru
 	return ret;
 }
 
+blk_qc_t submit_bio_noacct_mq_direct(struct bio *bio)
+{
+	struct gendisk *disk = bio->bi_bdev->bd_disk;
+
+	if (unlikely(bio_queue_enter(bio) != 0))
+		return BLK_QC_T_NONE;
+	
+	if (!blk_crypto_bio_prep(&bio)) {
+		blk_queue_exit(disk->queue);
+		return BLK_QC_T_NONE;
+	}
+
+	return blk_mq_submit_bio(bio);
+}
+EXPORT_SYMBOL(submit_bio_noacct_mq_direct);
+
 static blk_qc_t __submit_bio_noacct_mq(struct bio *bio)
 {
 	struct bio_list bio_list[2] = { };
Index: linux-2.6/include/linux/blkdev.h
===================================================================
--- linux-2.6.orig/include/linux/blkdev.h	2021-03-01 19:47:29.000000000 +0100
+++ linux-2.6/include/linux/blkdev.h	2021-03-02 10:44:04.000000000 +0100
@@ -912,6 +912,7 @@ static inline void rq_flush_dcache_pages
 
 extern int blk_register_queue(struct gendisk *disk);
 extern void blk_unregister_queue(struct gendisk *disk);
+blk_qc_t submit_bio_noacct_mq_direct(struct bio *bio);
 blk_qc_t submit_bio_noacct(struct bio *bio);
 extern void blk_rq_init(struct request_queue *q, struct request *rq);
 extern void blk_put_request(struct request *);

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/4] block: introduce a function submit_bio_noacct_mq_direct
  2021-03-02 19:05 ` [dm-devel] " Mikulas Patocka
@ 2021-03-04  0:37   ` Jens Axboe
  -1 siblings, 0 replies; 8+ messages in thread
From: Jens Axboe @ 2021-03-04  0:37 UTC (permalink / raw)
  To: Mikulas Patocka, JeffleXu, Mike Snitzer, Heinz Mauelshagen,
	caspar, io-uring, linux-block, joseph.qi, dm-devel, hch

On 3/2/21 12:05 PM, Mikulas Patocka wrote:

There seems to be something wrong with how this series is being sent
out. I have 1/4 and 3/4, but both are just attachments.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dm-devel] [PATCH 1/4] block: introduce a function submit_bio_noacct_mq_direct
@ 2021-03-04  0:37   ` Jens Axboe
  0 siblings, 0 replies; 8+ messages in thread
From: Jens Axboe @ 2021-03-04  0:37 UTC (permalink / raw)
  To: Mikulas Patocka, JeffleXu, Mike Snitzer, Heinz Mauelshagen,
	caspar, io-uring, linux-block, joseph.qi, dm-devel, hch

On 3/2/21 12:05 PM, Mikulas Patocka wrote:

There seems to be something wrong with how this series is being sent
out. I have 1/4 and 3/4, but both are just attachments.

-- 
Jens Axboe

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/4] block: introduce a function submit_bio_noacct_mq_direct
  2021-03-04  0:37   ` [dm-devel] " Jens Axboe
@ 2021-03-04 10:14     ` Mikulas Patocka
  -1 siblings, 0 replies; 8+ messages in thread
From: Mikulas Patocka @ 2021-03-04 10:14 UTC (permalink / raw)
  To: Jens Axboe
  Cc: JeffleXu, Mike Snitzer, Heinz Mauelshagen, caspar, io-uring,
	linux-block, joseph.qi, dm-devel, hch



On Wed, 3 Mar 2021, Jens Axboe wrote:

> On 3/2/21 12:05 PM, Mikulas Patocka wrote:
> 
> There seems to be something wrong with how this series is being sent
> out. I have 1/4 and 3/4, but both are just attachments.
> 
> -- 
> Jens Axboe

I used quilt to send it. I don't know what's wrong with it - if you look 
at archives at 
https://listman.redhat.com/archives/dm-devel/2021-March/thread.html , it 
seems normal.

Mikulas


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dm-devel] [PATCH 1/4] block: introduce a function submit_bio_noacct_mq_direct
@ 2021-03-04 10:14     ` Mikulas Patocka
  0 siblings, 0 replies; 8+ messages in thread
From: Mikulas Patocka @ 2021-03-04 10:14 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Mike Snitzer, Heinz Mauelshagen, caspar, hch, linux-block,
	joseph.qi, dm-devel, JeffleXu, io-uring



On Wed, 3 Mar 2021, Jens Axboe wrote:

> On 3/2/21 12:05 PM, Mikulas Patocka wrote:
> 
> There seems to be something wrong with how this series is being sent
> out. I have 1/4 and 3/4, but both are just attachments.
> 
> -- 
> Jens Axboe

I used quilt to send it. I don't know what's wrong with it - if you look 
at archives at 
https://listman.redhat.com/archives/dm-devel/2021-March/thread.html , it 
seems normal.

Mikulas

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/4] block: introduce a function submit_bio_noacct_mq_direct
  2021-03-04 10:14     ` [dm-devel] " Mikulas Patocka
@ 2021-03-05 16:05       ` Jens Axboe
  -1 siblings, 0 replies; 8+ messages in thread
From: Jens Axboe @ 2021-03-05 16:05 UTC (permalink / raw)
  To: Mikulas Patocka
  Cc: JeffleXu, Mike Snitzer, Heinz Mauelshagen, caspar, io-uring,
	linux-block, joseph.qi, dm-devel, hch

On 3/4/21 3:14 AM, Mikulas Patocka wrote:
> 
> 
> On Wed, 3 Mar 2021, Jens Axboe wrote:
> 
>> On 3/2/21 12:05 PM, Mikulas Patocka wrote:
>>
>> There seems to be something wrong with how this series is being sent
>> out. I have 1/4 and 3/4, but both are just attachments.
>>
>> -- 
>> Jens Axboe
> 
> I used quilt to send it. I don't know what's wrong with it - if you look 
> at archives at 
> https://listman.redhat.com/archives/dm-devel/2021-March/thread.html , it 
> seems normal.

I guess the archives handle it, but it just shows up as an empty email with
an attachment. Not very conducive to review, so I do suggest you fix how
you're sending them out.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dm-devel] [PATCH 1/4] block: introduce a function submit_bio_noacct_mq_direct
@ 2021-03-05 16:05       ` Jens Axboe
  0 siblings, 0 replies; 8+ messages in thread
From: Jens Axboe @ 2021-03-05 16:05 UTC (permalink / raw)
  To: Mikulas Patocka
  Cc: Mike Snitzer, Heinz Mauelshagen, caspar, hch, linux-block,
	joseph.qi, dm-devel, JeffleXu, io-uring

On 3/4/21 3:14 AM, Mikulas Patocka wrote:
> 
> 
> On Wed, 3 Mar 2021, Jens Axboe wrote:
> 
>> On 3/2/21 12:05 PM, Mikulas Patocka wrote:
>>
>> There seems to be something wrong with how this series is being sent
>> out. I have 1/4 and 3/4, but both are just attachments.
>>
>> -- 
>> Jens Axboe
> 
> I used quilt to send it. I don't know what's wrong with it - if you look 
> at archives at 
> https://listman.redhat.com/archives/dm-devel/2021-March/thread.html , it 
> seems normal.

I guess the archives handle it, but it just shows up as an empty email with
an attachment. Not very conducive to review, so I do suggest you fix how
you're sending them out.

-- 
Jens Axboe

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-03-05 16:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-02 19:05 [PATCH 1/4] block: introduce a function submit_bio_noacct_mq_direct Mikulas Patocka
2021-03-02 19:05 ` [dm-devel] " Mikulas Patocka
2021-03-04  0:37 ` Jens Axboe
2021-03-04  0:37   ` [dm-devel] " Jens Axboe
2021-03-04 10:14   ` Mikulas Patocka
2021-03-04 10:14     ` [dm-devel] " Mikulas Patocka
2021-03-05 16:05     ` Jens Axboe
2021-03-05 16:05       ` [dm-devel] " Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.