[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 27 Oct 2022 17:54:42 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: linux-kernel@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Stephen Boyd <sboyd@...nel.org>
Subject: Re: [RFC][PATCH v2 00/31] timers: Use del_timer_shutdown() before
freeing timers
On 10/27/22 16:55, Steven Rostedt wrote:
> On Thu, 27 Oct 2022 16:24:42 -0700
> Guenter Roeck <linux@...ck-us.net> wrote:
>
>>> This is probably just missing a switch to shutdown.
>>>
>> Wild shot, and I don't really know what I am doing,
>> but I'll try
>>
>> iff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
>> index e71b3b43927c..6c1cb4a219f0 100644
>> --- a/block/blk-sysfs.c
>> +++ b/block/blk-sysfs.c
>> @@ -767,6 +767,8 @@ static void blk_release_queue(struct kobject *kobj)
>>
>> might_sleep();
>>
>> + del_timer_shutdown(&q->timeout);
>> +
>> percpu_ref_exit(&q->q_usage_counter);
>>
>> if (q->poll_stat)
>
> Or perhaps this:
>
I think you are correct. Let me give it a try.
> -- Steve
>
> diff --git a/block/blk-core.c b/block/blk-core.c
> index 17667159482e..69b1daa2e91a 100644
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -227,7 +227,7 @@ const char *blk_status_to_str(blk_status_t status)
> */
> void blk_sync_queue(struct request_queue *q)
> {
> - del_timer_sync(&q->timeout);
> + del_timer_shutdown(&q->timeout);
> cancel_work_sync(&q->timeout_work);
> }
> EXPORT_SYMBOL(blk_sync_queue);
> diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
> index e71b3b43927c..12a1e46536ed 100644
> --- a/block/blk-sysfs.c
> +++ b/block/blk-sysfs.c
> @@ -769,6 +769,8 @@ static void blk_release_queue(struct kobject *kobj)
>
> percpu_ref_exit(&q->q_usage_counter);
>
> + blk_sync_queue(q);
> +
This might not even be needed. I'll try without it first.
Thanks,
Guenter
> if (q->poll_stat)
> blk_stat_remove_callback(q, q->poll_cb);
> blk_stat_free_callback(q->poll_cb);
Powered by blists - more mailing lists