* [PATCH] block: use put_io_context_active() to disassociate bio from a task
@ 2017-03-03 7:01 Hou Tao
2017-03-03 19:12 ` Tejun Heo
0 siblings, 1 reply; 2+ messages in thread
From: Hou Tao @ 2017-03-03 7:01 UTC (permalink / raw)
To: linux-block; +Cc: axboe, tj
bio_associate_current() invokes get_io_context_active() to tell
CFQ scheduler that the current io_context is still issuing IOs
by increasing active_ref. When the bio is done, we also need
to invoke put_io_context_active() to decrease active_ref else
the associated io_context will always be active.
Signed-off-by: Hou Tao <houtao1@huawei.com>
---
block/bio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/bio.c b/block/bio.c
index 5eec5e0..d8ed36f 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -2072,7 +2072,7 @@ EXPORT_SYMBOL_GPL(bio_associate_current);
void bio_disassociate_task(struct bio *bio)
{
if (bio->bi_ioc) {
- put_io_context(bio->bi_ioc);
+ put_io_context_active(bio->bi_ioc);
bio->bi_ioc = NULL;
}
if (bio->bi_css) {
--
2.5.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] block: use put_io_context_active() to disassociate bio from a task
2017-03-03 7:01 [PATCH] block: use put_io_context_active() to disassociate bio from a task Hou Tao
@ 2017-03-03 19:12 ` Tejun Heo
0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2017-03-03 19:12 UTC (permalink / raw)
To: Hou Tao; +Cc: linux-block, axboe
Hello,
On Fri, Mar 03, 2017 at 03:01:10PM +0800, Hou Tao wrote:
> bio_associate_current() invokes get_io_context_active() to tell
> CFQ scheduler that the current io_context is still issuing IOs
> by increasing active_ref. When the bio is done, we also need
> to invoke put_io_context_active() to decrease active_ref else
> the associated io_context will always be active.
>
> Signed-off-by: Hou Tao <houtao1@huawei.com>
Can you please explain how you noticed issue and verified the patch?
Also, the patch will need the following.
Fixes: 852c788f8365 ("block: implement bio_associate_current()")
Cc: stable@vger.kernel.org # v3.5+
I think the failure mode isn't severe. We'll be carrying around ioc's
longer than necessary but that's about it. I wonder whether the logic
can be simplified in general. Anyways, please feel free to add
Acked-by: Tejun Heo <tj@kernel.org>
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-03 19:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-03 7:01 [PATCH] block: use put_io_context_active() to disassociate bio from a task Hou Tao
2017-03-03 19:12 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox