* [block:for-3.14/core] blk-mq: Compile fix for null_blk
@ 2014-01-09 18:54 Muthu Kumar
2014-01-09 20:58 ` Matias Bjorling
0 siblings, 1 reply; 6+ messages in thread
From: Muthu Kumar @ 2014-01-09 18:54 UTC (permalink / raw)
To: Jens Axboe, linux-kernel@vger.kernel.org
Jens,
Compiling null_blk.ko failed with error that blk_mq_free_queue() was
defined implicitly. So, moved the declaration from block/blk-mq.h to
include/linux/blk-mq.h and exported it.
Signed-off-by: Muthukumar Ratty <muthur@gmail.com>
----------------------
block/blk-mq.c | 1 +
block/blk-mq.h | 1 -
include/linux/blk-mq.h | 1 +
3 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 57039fc..3e08b87 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1422,6 +1422,7 @@ void blk_mq_free_queue(struct request_queue *q)
list_del_init(&q->all_q_node);
mutex_unlock(&all_q_mutex);
}
+EXPORT_SYMBOL(blk_mq_free_queue);
/* Basically redo blk_mq_init_queue with queue frozen */
static void blk_mq_queue_reinit(struct request_queue *q)
diff --git a/block/blk-mq.h b/block/blk-mq.h
index 5c39179..35ff4f7 100644
--- a/block/blk-mq.h
+++ b/block/blk-mq.h
@@ -28,7 +28,6 @@ void blk_mq_run_request(struct request *rq, bool
run_queue, bool async);
void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async);
void blk_mq_init_flush(struct request_queue *q);
void blk_mq_drain_queue(struct request_queue *q);
-void blk_mq_free_queue(struct request_queue *q);
/*
* CPU hotplug helpers
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index 851d34b..51109b8 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -113,6 +113,7 @@ enum {
};
struct request_queue *blk_mq_init_queue(struct blk_mq_reg *, void *);
+void blk_mq_free_queue(struct request_queue *q);
int blk_mq_register_disk(struct gendisk *);
void blk_mq_unregister_disk(struct gendisk *);
void blk_mq_init_commands(struct request_queue *, void (*init)(void
*data, struct blk_mq_hw_ctx *, struct request *, unsigned int), void
*data);
-------------------------------
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [block:for-3.14/core] blk-mq: Compile fix for null_blk
2014-01-09 18:54 [block:for-3.14/core] blk-mq: Compile fix for null_blk Muthu Kumar
@ 2014-01-09 20:58 ` Matias Bjorling
2014-01-09 21:33 ` Muthu Kumar
2014-01-11 8:24 ` Linus Torvalds
0 siblings, 2 replies; 6+ messages in thread
From: Matias Bjorling @ 2014-01-09 20:58 UTC (permalink / raw)
To: Muthu Kumar, Jens Axboe, linux-kernel@vger.kernel.org,
tom.leiming
On 01/09/2014 07:54 PM, Muthu Kumar wrote:
> Jens,
>
> Compiling null_blk.ko failed with error that blk_mq_free_queue() was
> defined implicitly. So, moved the declaration from block/blk-mq.h to
> include/linux/blk-mq.h and exported it.
>
The patch from Ming Lei is missing in -rc6
4af48694451676403188a62385dd1a2849fc05c5
block: null_blk: fix queue leak inside removing device
Its queued for -rc7. It removes the usage of blk_mq_free_queue in blk_null.
> Signed-off-by: Muthukumar Ratty <muthur@gmail.com>
>
> ----------------------
>
> block/blk-mq.c | 1 +
> block/blk-mq.h | 1 -
> include/linux/blk-mq.h | 1 +
> 3 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 57039fc..3e08b87 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -1422,6 +1422,7 @@ void blk_mq_free_queue(struct request_queue *q)
> list_del_init(&q->all_q_node);
> mutex_unlock(&all_q_mutex);
> }
> +EXPORT_SYMBOL(blk_mq_free_queue);
>
> /* Basically redo blk_mq_init_queue with queue frozen */
> static void blk_mq_queue_reinit(struct request_queue *q)
> diff --git a/block/blk-mq.h b/block/blk-mq.h
> index 5c39179..35ff4f7 100644
> --- a/block/blk-mq.h
> +++ b/block/blk-mq.h
> @@ -28,7 +28,6 @@ void blk_mq_run_request(struct request *rq, bool
> run_queue, bool async);
> void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async);
> void blk_mq_init_flush(struct request_queue *q);
> void blk_mq_drain_queue(struct request_queue *q);
> -void blk_mq_free_queue(struct request_queue *q);
>
> /*
> * CPU hotplug helpers
> diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
> index 851d34b..51109b8 100644
> --- a/include/linux/blk-mq.h
> +++ b/include/linux/blk-mq.h
> @@ -113,6 +113,7 @@ enum {
> };
>
> struct request_queue *blk_mq_init_queue(struct blk_mq_reg *, void *);
> +void blk_mq_free_queue(struct request_queue *q);
> int blk_mq_register_disk(struct gendisk *);
> void blk_mq_unregister_disk(struct gendisk *);
> void blk_mq_init_commands(struct request_queue *, void (*init)(void
> *data, struct blk_mq_hw_ctx *, struct request *, unsigned int), void
> *data);
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [block:for-3.14/core] blk-mq: Compile fix for null_blk
2014-01-09 20:58 ` Matias Bjorling
@ 2014-01-09 21:33 ` Muthu Kumar
2014-01-09 21:55 ` Matias Bjorling
2014-01-11 8:24 ` Linus Torvalds
1 sibling, 1 reply; 6+ messages in thread
From: Muthu Kumar @ 2014-01-09 21:33 UTC (permalink / raw)
To: Matias Bjorling; +Cc: Jens Axboe, linux-kernel@vger.kernel.org, tom.leiming
Thanks Matias. Yes, Ming Lei's 4th patch does make the function internal.
So, which branch has the laest patches... i am checking for-3.14/core...
Regards,
Muthu
On Thu, Jan 9, 2014 at 12:58 PM, Matias Bjorling <m@bjorling.me> wrote:
> On 01/09/2014 07:54 PM, Muthu Kumar wrote:
>>
>> Jens,
>>
>> Compiling null_blk.ko failed with error that blk_mq_free_queue() was
>> defined implicitly. So, moved the declaration from block/blk-mq.h to
>> include/linux/blk-mq.h and exported it.
>>
>
> The patch from Ming Lei is missing in -rc6
>
> 4af48694451676403188a62385dd1a2849fc05c5
> block: null_blk: fix queue leak inside removing device
>
> Its queued for -rc7. It removes the usage of blk_mq_free_queue in blk_null.
>
>
>> Signed-off-by: Muthukumar Ratty <muthur@gmail.com>
>>
>> ----------------------
>>
>> block/blk-mq.c | 1 +
>> block/blk-mq.h | 1 -
>> include/linux/blk-mq.h | 1 +
>> 3 files changed, 2 insertions(+), 1 deletions(-)
>>
>> diff --git a/block/blk-mq.c b/block/blk-mq.c
>> index 57039fc..3e08b87 100644
>> --- a/block/blk-mq.c
>> +++ b/block/blk-mq.c
>> @@ -1422,6 +1422,7 @@ void blk_mq_free_queue(struct request_queue *q)
>> list_del_init(&q->all_q_node);
>> mutex_unlock(&all_q_mutex);
>> }
>> +EXPORT_SYMBOL(blk_mq_free_queue);
>>
>> /* Basically redo blk_mq_init_queue with queue frozen */
>> static void blk_mq_queue_reinit(struct request_queue *q)
>> diff --git a/block/blk-mq.h b/block/blk-mq.h
>> index 5c39179..35ff4f7 100644
>> --- a/block/blk-mq.h
>> +++ b/block/blk-mq.h
>> @@ -28,7 +28,6 @@ void blk_mq_run_request(struct request *rq, bool
>> run_queue, bool async);
>> void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async);
>> void blk_mq_init_flush(struct request_queue *q);
>> void blk_mq_drain_queue(struct request_queue *q);
>> -void blk_mq_free_queue(struct request_queue *q);
>>
>> /*
>> * CPU hotplug helpers
>> diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
>> index 851d34b..51109b8 100644
>> --- a/include/linux/blk-mq.h
>> +++ b/include/linux/blk-mq.h
>> @@ -113,6 +113,7 @@ enum {
>> };
>>
>> struct request_queue *blk_mq_init_queue(struct blk_mq_reg *, void *);
>> +void blk_mq_free_queue(struct request_queue *q);
>> int blk_mq_register_disk(struct gendisk *);
>> void blk_mq_unregister_disk(struct gendisk *);
>> void blk_mq_init_commands(struct request_queue *, void (*init)(void
>> *data, struct blk_mq_hw_ctx *, struct request *, unsigned int), void
>> *data);
>>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [block:for-3.14/core] blk-mq: Compile fix for null_blk
2014-01-09 21:33 ` Muthu Kumar
@ 2014-01-09 21:55 ` Matias Bjorling
0 siblings, 0 replies; 6+ messages in thread
From: Matias Bjorling @ 2014-01-09 21:55 UTC (permalink / raw)
To: Muthu Kumar; +Cc: Jens Axboe, linux-kernel@vger.kernel.org, tom.leiming
On 01/09/2014 10:33 PM, Muthu Kumar wrote:
> Thanks Matias. Yes, Ming Lei's 4th patch does make the function internal.
>
> So, which branch has the laest patches... i am checking for-3.14/core...
>
Depends on what you want to do. You may use the Jens' for-linus branch
for the latest including blk patches or just cherry pick Ming's patch to
get 3.14/core nullblk to compile. It will fix itself within a week or two.
> Regards,
> Muthu
>
<snip>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [block:for-3.14/core] blk-mq: Compile fix for null_blk
2014-01-09 20:58 ` Matias Bjorling
2014-01-09 21:33 ` Muthu Kumar
@ 2014-01-11 8:24 ` Linus Torvalds
2014-01-11 14:43 ` Jens Axboe
1 sibling, 1 reply; 6+ messages in thread
From: Linus Torvalds @ 2014-01-11 8:24 UTC (permalink / raw)
To: Matias Bjorling
Cc: Muthu Kumar, Jens Axboe, linux-kernel@vger.kernel.org, Ming Lei
On Fri, Jan 10, 2014 at 3:58 AM, Matias Bjorling <m@bjorling.me> wrote:
>
> The patch from Ming Lei is missing in -rc6
>
> 4af48694451676403188a62385dd1a2849fc05c5
> block: null_blk: fix queue leak inside removing device
>
> Its queued for -rc7. It removes the usage of blk_mq_free_queue in blk_null.
Jens? I'm going to do an rc8 tomorrow, and I haven't seen any pull requests..
Linus
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [block:for-3.14/core] blk-mq: Compile fix for null_blk
2014-01-11 8:24 ` Linus Torvalds
@ 2014-01-11 14:43 ` Jens Axboe
0 siblings, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2014-01-11 14:43 UTC (permalink / raw)
To: Linus Torvalds
Cc: Matias Bjorling, Muthu Kumar, linux-kernel@vger.kernel.org,
Ming Lei
On Sat, Jan 11 2014, Linus Torvalds wrote:
> On Fri, Jan 10, 2014 at 3:58 AM, Matias Bjorling <m@bjorling.me> wrote:
> >
> > The patch from Ming Lei is missing in -rc6
> >
> > 4af48694451676403188a62385dd1a2849fc05c5
> > block: null_blk: fix queue leak inside removing device
> >
> > Its queued for -rc7. It removes the usage of blk_mq_free_queue in blk_null.
>
> Jens? I'm going to do an rc8 tomorrow, and I haven't seen any pull requests..
Sorry, between jobs and houses, and the two other patches in there were
being evaluated. If you could just apply this one directly, then that'd
be great!
commit 4af48694451676403188a62385dd1a2849fc05c5
Author: Ming Lei <tom.leiming@gmail.com>
Date: Thu Dec 26 21:31:37 2013 +0800
block: null_blk: fix queue leak inside removing device
When queue_mode is NULL_Q_MQ and null_blk is being removed,
blk_cleanup_queue() isn't called to cleanup queue, so the
queue allocated won't be freed.
This patch calls blk_cleanup_queue() for MQ to drain all
pending requests first and release the reference counter
of queue kobject, then blk_mq_free_queue() will be called
in queue kobject's release handler when queue kobject's
reference counter drops to zero.
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c
index a2e69d26266d..83a598ebb65a 100644
--- a/drivers/block/null_blk.c
+++ b/drivers/block/null_blk.c
@@ -425,10 +425,7 @@ static void null_del_dev(struct nullb *nullb)
list_del_init(&nullb->list);
del_gendisk(nullb->disk);
- if (queue_mode == NULL_Q_MQ)
- blk_mq_free_queue(nullb->q);
- else
- blk_cleanup_queue(nullb->q);
+ blk_cleanup_queue(nullb->q);
put_disk(nullb->disk);
kfree(nullb);
}
@@ -578,10 +575,7 @@ static int null_add_dev(void)
disk = nullb->disk = alloc_disk_node(1, home_node);
if (!disk) {
queue_fail:
- if (queue_mode == NULL_Q_MQ)
- blk_mq_free_queue(nullb->q);
- else
- blk_cleanup_queue(nullb->q);
+ blk_cleanup_queue(nullb->q);
cleanup_queues(nullb);
err:
kfree(nullb);
--
Jens Axboe
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-01-11 14:43 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-09 18:54 [block:for-3.14/core] blk-mq: Compile fix for null_blk Muthu Kumar
2014-01-09 20:58 ` Matias Bjorling
2014-01-09 21:33 ` Muthu Kumar
2014-01-09 21:55 ` Matias Bjorling
2014-01-11 8:24 ` Linus Torvalds
2014-01-11 14:43 ` Jens Axboe
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).