All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Artem Savkov <artem.savkov@gmail.com>
Cc: mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org,
	konrad.wilk@oracle.com, john.stultz@linaro.org,
	xen-devel@lists.xen.org, david.vrabel@citrix.com
Subject: Re: [tip:timers/core] hrtimers: Support resuming with two or more CPUs online (but stopped)
Date: Fri, 5 Jul 2013 12:09:18 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.02.1307051204270.11637@ionos.tec.linutronix.de> (raw)
In-Reply-To: <20130705093003.GA4033@cpv436-motbuntu>

On Fri, 5 Jul 2013, Artem Savkov wrote:

> This commit brings up a warning about a potential deadlock in
> smp_call_function_many() discussed previously:
> https://lkml.org/lkml/2013/4/18/546

> On Fri, Jun 28, 2013 at 02:18:37PM -0700, tip-bot for David Vrabel wrote:
> > Commit-ID:  7c4c3a0f18ba57ea2a2985034532303d2929902a

It's not caused by this commit. The problem was there before. We call
clock_was_set() from softirq context because we cannot call it from
the timer interrupt.

So that new WARN on in the smp code requires us to move that call out
from softirq context.

Does the patch below fix it ?

Thanks,

	tglx

---
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index e86827e..24c6f3b 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -721,6 +721,18 @@ static int hrtimer_switch_to_hres(void)
 	return 1;
 }
 
+static void clock_was_set_work(struct work_struct *work)
+{
+	clock_was_set();
+}
+
+static DECLARE_WORK(hrtimer_work, clock_was_set_work);
+
+static void softirq_clock_was_set(void)
+{
+	schedule_work(&hrtimer_work);
+}
+
 /*
  * Called from timekeeping code to reprogramm the hrtimer interrupt
  * device. If called from the timer interrupt context we defer it to
@@ -748,7 +760,10 @@ static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer,
 }
 static inline void hrtimer_init_hres(struct hrtimer_cpu_base *base) { }
 static inline void retrigger_next_event(void *arg) { }
-
+static void softirq_clock_was_set(void)
+{
+	clock_was_set();
+}
 #endif /* CONFIG_HIGH_RES_TIMERS */
 
 /*
@@ -1445,7 +1460,7 @@ static void run_hrtimer_softirq(struct softirq_action *h)
 
 	if (cpu_base->clock_was_set) {
 		cpu_base->clock_was_set = 0;
-		clock_was_set();
+		softirq_clock_was_set();
 	}
 
 	hrtimer_peek_ahead_timers();



  parent reply	other threads:[~2013-07-05 10:09 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-27 10:35 [PATCHv6 0/5] xen: maintain an accurate persistent clock in more cases David Vrabel
2013-06-27 10:35 ` [PATCH 1/5] hrtimers: support resuming with two or more CPUs online (but stopped) David Vrabel
2013-06-27 10:35 ` David Vrabel
2013-06-28 21:18   ` [tip:timers/core] hrtimers: Support " tip-bot for David Vrabel
2013-06-28 21:18   ` tip-bot for David Vrabel
2013-07-05  9:30     ` Artem Savkov
2013-07-05 10:07       ` David Vrabel
2013-07-05 10:07       ` David Vrabel
2013-07-05 10:10         ` Thomas Gleixner
2013-07-05 10:10         ` Thomas Gleixner
2013-07-05 10:25         ` Thomas Gleixner
2013-07-05 10:25         ` Thomas Gleixner
2013-07-05 10:36           ` Thomas Gleixner
2013-07-05 10:36           ` Thomas Gleixner
2013-07-05 10:45             ` Artem Savkov
2013-07-05 10:45             ` Artem Savkov
2013-07-05 13:26               ` Thomas Gleixner
2013-07-05 13:26               ` Thomas Gleixner
2013-07-05 10:38           ` Artem Savkov
2013-07-05 10:38           ` Artem Savkov
2013-07-05 13:46           ` David Vrabel
2013-07-05 13:51             ` Thomas Gleixner
2013-07-05 13:51             ` Thomas Gleixner
2013-07-05 13:46           ` David Vrabel
2013-07-05 10:09       ` Thomas Gleixner [this message]
2013-07-05 10:09       ` Thomas Gleixner
2013-07-05  9:30     ` Artem Savkov
2013-06-28 21:18   ` [tip:timers/core] xen: Remove clock_was_set() call in the resume path tip-bot for David Vrabel
2013-06-28 21:18   ` tip-bot for David Vrabel
2013-06-27 10:35 ` [PATCH 2/5] time: pass flags instead of multiple bools to timekeeping_update() David Vrabel
2013-06-27 17:39   ` John Stultz
2013-06-27 17:39   ` John Stultz
2013-06-28 21:18   ` [tip:timers/core] timekeeping: Pass " tip-bot for David Vrabel
2013-06-28 21:18   ` tip-bot for David Vrabel
2013-06-27 10:35 ` [PATCH 2/5] time: pass " David Vrabel
2013-06-27 10:35 ` [PATCH 3/5] time: indicate that the clock was set in the pvclock gtod notifier chain David Vrabel
2013-06-27 10:35   ` David Vrabel
2013-06-27 17:37   ` John Stultz
2013-06-27 17:37   ` John Stultz
2013-06-28 10:20     ` David Vrabel
2013-06-28 10:20     ` David Vrabel
2013-06-28 21:19   ` [tip:timers/core] timekeeping: Indicate that clock was set in the pvclock gtod notifier tip-bot for David Vrabel
2013-06-28 21:19   ` tip-bot for David Vrabel
2013-06-27 10:35 ` [PATCH 4/5] x86/xen: sync the wallclock when the system time is set David Vrabel
2013-06-28 21:19   ` [tip:timers/core] x86: xen: Sync " tip-bot for David Vrabel
2013-06-28 21:19   ` tip-bot for David Vrabel
2013-06-27 10:35 ` [PATCH 4/5] x86/xen: sync " David Vrabel
2013-06-27 10:35 ` [PATCH 5/5] x86/xen: sync the CMOS RTC as well as the Xen wallclock David Vrabel
2013-06-28 15:38   ` Thomas Gleixner
2013-06-28 15:49     ` David Vrabel
2013-06-28 15:49     ` David Vrabel
2013-06-28 16:09       ` Thomas Gleixner
2013-06-28 16:51         ` David Vrabel
2013-06-28 20:41           ` Thomas Gleixner
2013-06-28 20:41           ` Thomas Gleixner
2013-06-28 16:51         ` David Vrabel
2013-06-28 16:09       ` Thomas Gleixner
2013-06-28 15:38   ` Thomas Gleixner
2013-06-28 21:19   ` [tip:timers/core] x86: xen: Sync " tip-bot for David Vrabel
2013-06-28 21:19   ` tip-bot for David Vrabel
2013-06-27 10:35 ` [PATCH 5/5] x86/xen: sync " David Vrabel
2013-06-28 13:14 ` [PATCHv6 0/5] xen: maintain an accurate persistent clock in more cases Thomas Gleixner
2013-06-28 13:14 ` Thomas Gleixner
2013-06-28 15:01   ` Konrad Rzeszutek Wilk
2013-06-28 15:01   ` Konrad Rzeszutek Wilk
2013-06-28 15:12     ` Thomas Gleixner
2013-06-28 15:12     ` Thomas Gleixner
2013-06-28 16:19       ` Konrad Rzeszutek Wilk
2013-06-28 16:19       ` Konrad Rzeszutek Wilk
2013-06-28 18:58         ` Thomas Gleixner
2013-06-28 18:58           ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.02.1307051204270.11637@ionos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=artem.savkov@gmail.com \
    --cc=david.vrabel@citrix.com \
    --cc=hpa@zytor.com \
    --cc=john.stultz@linaro.org \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.