kthread: Mark timer used by delayed kthread works as IRQ safe
Subsystems (2)
PATCH 1/1 kthread: Mark timer used by delayed kthread works as IRQ safe
The timer used by delayed kthread works are IRQ safe because the used kthread_delayed_work_timer_fn() is IRQ safe.
It is properly marked when initialized by KTHREAD_DELAYED_WORK_INIT(). But TIMER_IRQSAFE flag is missing when initialized by kthread_init_delayed_work().
The missing flag might trigger invalid warning from del_timer_sync() when kthread_mod_delayed_work() is called with interrupts disabled.
---
This patch is result of a discussion about using the API, see
https://lkml.kernel.org/r/[email protected]
include/linux/kthread.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/linux/kthread.h +2 -1
@@ -165,7 +165,8 @@ extern void __kthread_init_worker(struct kthread_worker *worker,do { \kthread_init_work (&(dwork)->work, (fn)); \timer_setup (&(dwork)->timer, \ - kthread_delayed_work_timer_fn,0 ); \ + kthread_delayed_work_timer_fn, \ +TIMER_IRQSAFE ); \ } while (0)int kthread_worker_fn (void *worker_ptr);
Signature · 1 line
2.16.4
Quoted 7 lines · Petr Mladek
The timer used by delayed kthread works are IRQ safe because the used
kthread_delayed_work_timer_fn()is IRQ safe.It is properly marked when initialized by
KTHREAD_DELAYED_WORK_INIT(). ButTIMER_IRQSAFEflag is missing when initialized bykthread_init_delayed_work().
Quoted 6 lines
The missing flag might trigger invalid warning from
del_timer_sync()whenkthread_mod_delayed_work()is called with interrupts disabled.Reported-by Grygorii Strashko <[email protected]>Signed-off-by Petr Mladek <[email protected]>Tested-by Grygorii Strashko <[email protected]>
Thanks.
Signature · 1 line
tejun
Hi Petr,
Quoted 8 lines · Tejun Heo
Quoted 7 lines · Petr Mladek
The timer used by delayed kthread works are IRQ safe because the used
kthread_delayed_work_timer_fn()is IRQ safe.It is properly marked when initialized by
KTHREAD_DELAYED_WORK_INIT(). ButTIMER_IRQSAFEflag is missing when initialized bykthread_init_delayed_work().
Quoted 8 lines
Quoted 6 lines
The missing flag might trigger invalid warning from
del_timer_sync()whenkthread_mod_delayed_work()is called with interrupts disabled.Reported-by Grygorii Strashko <[email protected]>Signed-off-by Petr Mladek <[email protected]>Tested-by Grygorii Strashko <[email protected]>Acked-by Tejun Heo <[email protected]>
I'm worry shouldn't this patch have "fixes" tag?
Signature · 7 lines
Best regards, grygorii _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Hi All,
Quoted 14 lines · Grygorii Strashko
Hi Petr,
Quoted 11 lines · Tejun Heo
Quoted 10 lines · Petr Mladek
The timer used by delayed kthread works are IRQ safe because the used
kthread_delayed_work_timer_fn()is IRQ safe.It is properly marked when initialized by
KTHREAD_DELAYED_WORK_INIT(). ButTIMER_IRQSAFEflag is missing when initialized bykthread_init_delayed_work().The missing flag might trigger invalid warning from
del_timer_sync()whenkthread_mod_delayed_work()is called with interrupts disabled.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Reported-by Grygorii Strashko <[email protected]>Signed-off-by Petr Mladek <[email protected]>Tested-by Grygorii Strashko <[email protected]>Acked-by Tejun Heo <[email protected]>I'm worry shouldn't this patch have "fixes" tag?
Sorry, the I'm disturbing you, but I have dependency from this path [1]. I can see it in -next: commit d7c8c7de96de ("kthread: mark timer used by delayed kthread works as IRQ safe"), but it does not present in net-next.
Any way this can be resolved?
[1] https://patchwork.ozlabs.org/cover/1259207/
Signature · 2 lines
Best regards, grygorii