All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] time: Revert to calling clock_was_set_delayed() while in irq context
@ 2014-03-27 23:30 John Stultz
  2014-03-28  7:07 ` Ingo Molnar
  2014-03-28  8:37 ` [tip:timers/urgent] time: Revert to calling clock_was_set_delayed () " tip-bot for John Stultz
  0 siblings, 2 replies; 3+ messages in thread
From: John Stultz @ 2014-03-27 23:30 UTC (permalink / raw)
  To: LKML; +Cc: John Stultz, Thomas Gleixner, Ingo Molnar, Linus Torvalds

Ingo,

After testing a patch queued for 3.15, I noticed there was a WARNON
message that I realized was triggered by one of my patches that came
in the 3.14 merge window. I'm not very happy to find this now, but
sadly here it is. The fix is luckily fairly simple and just falls
back to previous behavior.

For tip/timers/urgent.

thanks
-john

In commit 47a1b796306356f35 (tick/timekeeping: Call update_wall_time
outside the jiffies lock), we moved to calling clock_was_set() due
to the fact that we were no longer holding the timekeeping or jiffies
lock.

However, there is still the problem that clock_was_set() triggers
an IPI, which cannot be done from the timer's hard irq context,
and will generate WARN_ON warnings.

Apparently in my earlier testing, I'm guessing I didn't bump the dmesg
log level, so I somehow missed the WARN_ONs.

Thus we need to revert back to calling clock_was_set_delayed().

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
---
 kernel/time/timekeeping.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 0aa4ce8..5b40279 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1435,7 +1435,8 @@ void update_wall_time(void)
 out:
 	raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
 	if (clock_set)
-		clock_was_set();
+		/* Have to call _delayed version, since in irq context*/
+		clock_was_set_delayed();
 }
 
 /**
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] time: Revert to calling clock_was_set_delayed() while in irq context
  2014-03-27 23:30 [PATCH] time: Revert to calling clock_was_set_delayed() while in irq context John Stultz
@ 2014-03-28  7:07 ` Ingo Molnar
  2014-03-28  8:37 ` [tip:timers/urgent] time: Revert to calling clock_was_set_delayed () " tip-bot for John Stultz
  1 sibling, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2014-03-28  7:07 UTC (permalink / raw)
  To: John Stultz; +Cc: LKML, Thomas Gleixner, Linus Torvalds


* John Stultz <john.stultz@linaro.org> wrote:

> Ingo,
> 
> After testing a patch queued for 3.15, I noticed there was a WARNON 
> message that I realized was triggered by one of my patches that came 
> in the 3.14 merge window. I'm not very happy to find this now, but 
> sadly here it is. The fix is luckily fairly simple and just falls 
> back to previous behavior.
> 
> For tip/timers/urgent.

No problem - I've applied your fix to timers/urgent and will get it to 
Linus later today, after a bit of testing.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:timers/urgent] time: Revert to calling clock_was_set_delayed () while in irq context
  2014-03-27 23:30 [PATCH] time: Revert to calling clock_was_set_delayed() while in irq context John Stultz
  2014-03-28  7:07 ` Ingo Molnar
@ 2014-03-28  8:37 ` tip-bot for John Stultz
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for John Stultz @ 2014-03-28  8:37 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, john.stultz, hpa, mingo, torvalds, tglx

Commit-ID:  cab5e127eef040399902caa8e1510795583fa03a
Gitweb:     http://git.kernel.org/tip/cab5e127eef040399902caa8e1510795583fa03a
Author:     John Stultz <john.stultz@linaro.org>
AuthorDate: Thu, 27 Mar 2014 16:30:49 -0700
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 28 Mar 2014 08:07:07 +0100

time: Revert to calling clock_was_set_delayed() while in irq context

In commit 47a1b796306356f35 ("tick/timekeeping: Call
update_wall_time outside the jiffies lock"), we moved to calling
clock_was_set() due to the fact that we were no longer holding
the timekeeping or jiffies lock.

However, there is still the problem that clock_was_set()
triggers an IPI, which cannot be done from the timer's hard irq
context, and will generate WARN_ON warnings.

Apparently in my earlier testing, I'm guessing I didn't bump the
dmesg log level, so I somehow missed the WARN_ONs.

Thus we need to revert back to calling clock_was_set_delayed().

Signed-off-by: John Stultz <john.stultz@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1395963049-11923-1-git-send-email-john.stultz@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/time/timekeeping.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 0aa4ce8..5b40279 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1435,7 +1435,8 @@ void update_wall_time(void)
 out:
 	raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
 	if (clock_set)
-		clock_was_set();
+		/* Have to call _delayed version, since in irq context*/
+		clock_was_set_delayed();
 }
 
 /**

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-28  8:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-27 23:30 [PATCH] time: Revert to calling clock_was_set_delayed() while in irq context John Stultz
2014-03-28  7:07 ` Ingo Molnar
2014-03-28  8:37 ` [tip:timers/urgent] time: Revert to calling clock_was_set_delayed () " tip-bot for John Stultz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.