stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] block: fix bio-cache for passthru IO" failed to apply to 6.1-stable tree
@ 2023-05-28  7:28 gregkh
       [not found] ` <CGME20230529121959epcas5p1817b7f018f3b60495a8374d58b5fec01@epcas5p1.samsung.com>
  0 siblings, 1 reply; 4+ messages in thread
From: gregkh @ 2023-05-28  7:28 UTC (permalink / raw)
  To: anuj20.g, axboe, joshi.k; +Cc: stable


The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 46930b7cc7727271c9c27aac1fdc97a8645e2d00
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2023052844-splatter-emphasize-8de2@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..

Possible dependencies:

46930b7cc772 ("block: fix bio-cache for passthru IO")
7e2e355dd9c9 ("block: extend bio-cache for non-polled requests")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 46930b7cc7727271c9c27aac1fdc97a8645e2d00 Mon Sep 17 00:00:00 2001
From: Anuj Gupta <anuj20.g@samsung.com>
Date: Tue, 23 May 2023 16:47:09 +0530
Subject: [PATCH] block: fix bio-cache for passthru IO

commit <8af870aa5b847> ("block: enable bio caching use for passthru IO")
introduced bio-cache for passthru IO. In case when nr_vecs are greater
than BIO_INLINE_VECS, bio and bvecs are allocated from mempool (instead
of percpu cache) and REQ_ALLOC_CACHE is cleared. This causes the side
effect of not freeing bio/bvecs into mempool on completion.

This patch lets the passthru IO fallback to allocation using bio_kmalloc
when nr_vecs are greater than BIO_INLINE_VECS. The corresponding bio
is freed during call to blk_mq_map_bio_put during completion.

Cc: stable@vger.kernel.org # 6.1
fixes <8af870aa5b847> ("block: enable bio caching use for passthru IO")

Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
Link: https://lore.kernel.org/r/20230523111709.145676-1-anuj20.g@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

diff --git a/block/blk-map.c b/block/blk-map.c
index 04c55f1c492e..46eed2e627c3 100644
--- a/block/blk-map.c
+++ b/block/blk-map.c
@@ -248,7 +248,7 @@ static struct bio *blk_rq_map_bio_alloc(struct request *rq,
 {
 	struct bio *bio;
 
-	if (rq->cmd_flags & REQ_ALLOC_CACHE) {
+	if (rq->cmd_flags & REQ_ALLOC_CACHE && (nr_vecs <= BIO_INLINE_VECS)) {
 		bio = bio_alloc_bioset(NULL, nr_vecs, rq->cmd_flags, gfp_mask,
 					&fs_bio_set);
 		if (!bio)


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

* FAILED: patch "[PATCH] block: fix bio-cache for passthru IO" failed to apply to 6.1-stable tree
@ 2023-05-28  7:48 gregkh
  0 siblings, 0 replies; 4+ messages in thread
From: gregkh @ 2023-05-28  7:48 UTC (permalink / raw)
  To: anuj20.g, axboe, joshi.k; +Cc: stable


The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 46930b7cc7727271c9c27aac1fdc97a8645e2d00
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2023052842-facedown-sliceable-49ca@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..

Possible dependencies:

46930b7cc772 ("block: fix bio-cache for passthru IO")
7e2e355dd9c9 ("block: extend bio-cache for non-polled requests")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 46930b7cc7727271c9c27aac1fdc97a8645e2d00 Mon Sep 17 00:00:00 2001
From: Anuj Gupta <anuj20.g@samsung.com>
Date: Tue, 23 May 2023 16:47:09 +0530
Subject: [PATCH] block: fix bio-cache for passthru IO

commit <8af870aa5b847> ("block: enable bio caching use for passthru IO")
introduced bio-cache for passthru IO. In case when nr_vecs are greater
than BIO_INLINE_VECS, bio and bvecs are allocated from mempool (instead
of percpu cache) and REQ_ALLOC_CACHE is cleared. This causes the side
effect of not freeing bio/bvecs into mempool on completion.

This patch lets the passthru IO fallback to allocation using bio_kmalloc
when nr_vecs are greater than BIO_INLINE_VECS. The corresponding bio
is freed during call to blk_mq_map_bio_put during completion.

Cc: stable@vger.kernel.org # 6.1
fixes <8af870aa5b847> ("block: enable bio caching use for passthru IO")

Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
Link: https://lore.kernel.org/r/20230523111709.145676-1-anuj20.g@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

diff --git a/block/blk-map.c b/block/blk-map.c
index 04c55f1c492e..46eed2e627c3 100644
--- a/block/blk-map.c
+++ b/block/blk-map.c
@@ -248,7 +248,7 @@ static struct bio *blk_rq_map_bio_alloc(struct request *rq,
 {
 	struct bio *bio;
 
-	if (rq->cmd_flags & REQ_ALLOC_CACHE) {
+	if (rq->cmd_flags & REQ_ALLOC_CACHE && (nr_vecs <= BIO_INLINE_VECS)) {
 		bio = bio_alloc_bioset(NULL, nr_vecs, rq->cmd_flags, gfp_mask,
 					&fs_bio_set);
 		if (!bio)


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

* [PATCH 6.1.y] block: fix bio-cache for passthru IO
       [not found] ` <CGME20230529121959epcas5p1817b7f018f3b60495a8374d58b5fec01@epcas5p1.samsung.com>
@ 2023-05-29 12:16   ` Kanchan Joshi
  2023-06-01  9:47     ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Kanchan Joshi @ 2023-05-29 12:16 UTC (permalink / raw)
  To: stable; +Cc: Anuj Gupta, Kanchan Joshi, Jens Axboe

From: Anuj Gupta <anuj20.g@samsung.com>

commit <8af870aa5b847> ("block: enable bio caching use for passthru IO")
introduced bio-cache for passthru IO. In case when nr_vecs are greater
than BIO_INLINE_VECS, bio and bvecs are allocated from mempool (instead
of percpu cache) and REQ_ALLOC_CACHE is cleared. This causes the side
effect of not freeing bio/bvecs into mempool on completion.

This patch lets the passthru IO fallback to allocation using bio_kmalloc
when nr_vecs are greater than BIO_INLINE_VECS. The corresponding bio
is freed during call to blk_mq_map_bio_put during completion.

Cc: stable@vger.kernel.org # 6.1
fixes <8af870aa5b847> ("block: enable bio caching use for passthru IO")

Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
Link: https://lore.kernel.org/r/20230523111709.145676-1-anuj20.g@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
(cherry picked from commit 46930b7cc7727271c9c27aac1fdc97a8645e2d00)
---
 block/blk-map.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-map.c b/block/blk-map.c
index 34735626b00f..66da9e2b19ab 100644
--- a/block/blk-map.c
+++ b/block/blk-map.c
@@ -246,7 +246,7 @@ static struct bio *blk_rq_map_bio_alloc(struct request *rq,
 {
 	struct bio *bio;
 
-	if (rq->cmd_flags & REQ_POLLED) {
+	if (rq->cmd_flags & REQ_POLLED && (nr_vecs <= BIO_INLINE_VECS)) {
 		blk_opf_t opf = rq->cmd_flags | REQ_ALLOC_CACHE;
 
 		bio = bio_alloc_bioset(NULL, nr_vecs, opf, gfp_mask,
-- 
2.25.1


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

* Re: [PATCH 6.1.y] block: fix bio-cache for passthru IO
  2023-05-29 12:16   ` [PATCH 6.1.y] block: fix bio-cache for passthru IO Kanchan Joshi
@ 2023-06-01  9:47     ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2023-06-01  9:47 UTC (permalink / raw)
  To: Kanchan Joshi; +Cc: stable, Anuj Gupta, Jens Axboe

On Mon, May 29, 2023 at 05:46:30PM +0530, Kanchan Joshi wrote:
> From: Anuj Gupta <anuj20.g@samsung.com>
> 
> commit <8af870aa5b847> ("block: enable bio caching use for passthru IO")
> introduced bio-cache for passthru IO. In case when nr_vecs are greater
> than BIO_INLINE_VECS, bio and bvecs are allocated from mempool (instead
> of percpu cache) and REQ_ALLOC_CACHE is cleared. This causes the side
> effect of not freeing bio/bvecs into mempool on completion.
> 
> This patch lets the passthru IO fallback to allocation using bio_kmalloc
> when nr_vecs are greater than BIO_INLINE_VECS. The corresponding bio
> is freed during call to blk_mq_map_bio_put during completion.
> 
> Cc: stable@vger.kernel.org # 6.1
> fixes <8af870aa5b847> ("block: enable bio caching use for passthru IO")
> 
> Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
> Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
> Link: https://lore.kernel.org/r/20230523111709.145676-1-anuj20.g@samsung.com
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> (cherry picked from commit 46930b7cc7727271c9c27aac1fdc97a8645e2d00)
> ---
>  block/blk-map.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Now queued up, thanks.

greg k-h

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

end of thread, other threads:[~2023-06-01  9:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-28  7:28 FAILED: patch "[PATCH] block: fix bio-cache for passthru IO" failed to apply to 6.1-stable tree gregkh
     [not found] ` <CGME20230529121959epcas5p1817b7f018f3b60495a8374d58b5fec01@epcas5p1.samsung.com>
2023-05-29 12:16   ` [PATCH 6.1.y] block: fix bio-cache for passthru IO Kanchan Joshi
2023-06-01  9:47     ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2023-05-28  7:48 FAILED: patch "[PATCH] block: fix bio-cache for passthru IO" failed to apply to 6.1-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).