mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + kthread-mark-timer-used-by-delayed-kthread-works-as-irq-safe.patch added to -mm tree
@ 2020-02-17 22:01 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2020-02-17 22:01 UTC (permalink / raw)
  To: mm-commits, tglx, grygorii.strashko, pmladek


The patch titled
     Subject: kthread: mark timer used by delayed kthread works as IRQ safe
has been added to the -mm tree.  Its filename is
     kthread-mark-timer-used-by-delayed-kthread-works-as-irq-safe.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/kthread-mark-timer-used-by-delayed-kthread-works-as-irq-safe.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/kthread-mark-timer-used-by-delayed-kthread-works-as-irq-safe.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Petr Mladek <pmladek@suse.com>
Subject: 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/cfa886ad-e3b7-c0d2-3ff8-58d94170eab5@ti.com

Link: http://lkml.kernel.org/r/20200217120709.1974-1-pmladek@suse.com
Signed-off-by: Petr Mladek <pmladek@suse.com>
Reported-by: Grygorii Strashko <grygorii.strashko@ti.com>
Tested-by: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/kthread.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/include/linux/kthread.h~kthread-mark-timer-used-by-delayed-kthread-works-as-irq-safe
+++ a/include/linux/kthread.h
@@ -165,7 +165,8 @@ extern void __kthread_init_worker(struct
 	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);
_

Patches currently in -mm which might be from pmladek@suse.com are

kthread-mark-timer-used-by-delayed-kthread-works-as-irq-safe.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-17 22:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-17 22:01 + kthread-mark-timer-used-by-delayed-kthread-works-as-irq-safe.patch added to -mm tree akpm

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).