mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Kacur <jkacur@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	lkml <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>
Cc: Clark Williams <williams@redhat.com>, John Kacur <jkacur@redhat.com>
Subject: [PATCH 15/26] clocksource: Convert watchdog_lock to raw_spinlock
Date: Mon, 11 Jan 2010 22:26:45 +0100	[thread overview]
Message-ID: <1263245216-14754-16-git-send-email-jkacur@redhat.com> (raw)
In-Reply-To: <1263245216-14754-15-git-send-email-jkacur@redhat.com>

Convert locks that cannot sleep in preempt-rt to raw-spinlocks.

See also fea886ed3f18a93ab76fbeed13f1f73c97bd8982

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 kernel/time/clocksource.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index e85c234..ffcb48f 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -183,7 +183,7 @@ static LIST_HEAD(watchdog_list);
 static struct clocksource *watchdog;
 static struct timer_list watchdog_timer;
 static DECLARE_WORK(watchdog_work, clocksource_watchdog_work);
-static DEFINE_SPINLOCK(watchdog_lock);
+static DEFINE_RAW_SPINLOCK(watchdog_lock);
 static cycle_t watchdog_last;
 static int watchdog_running;
 
@@ -233,13 +233,13 @@ void clocksource_mark_unstable(struct clocksource *cs)
 {
 	unsigned long flags;
 
-	spin_lock_irqsave(&watchdog_lock, flags);
+	raw_spin_lock_irqsave(&watchdog_lock, flags);
 	if (!(cs->flags & CLOCK_SOURCE_UNSTABLE)) {
 		if (list_empty(&cs->wd_list))
 			list_add(&cs->wd_list, &watchdog_list);
 		__clocksource_unstable(cs);
 	}
-	spin_unlock_irqrestore(&watchdog_lock, flags);
+	raw_spin_unlock_irqrestore(&watchdog_lock, flags);
 }
 
 static void clocksource_watchdog(unsigned long data)
@@ -249,7 +249,7 @@ static void clocksource_watchdog(unsigned long data)
 	int64_t wd_nsec, cs_nsec;
 	int next_cpu;
 
-	spin_lock(&watchdog_lock);
+	raw_spin_lock(&watchdog_lock);
 	if (!watchdog_running)
 		goto out;
 
@@ -308,7 +308,7 @@ static void clocksource_watchdog(unsigned long data)
 	watchdog_timer.expires += WATCHDOG_INTERVAL;
 	add_timer_on(&watchdog_timer, next_cpu);
 out:
-	spin_unlock(&watchdog_lock);
+	raw_spin_unlock(&watchdog_lock);
 }
 
 static inline void clocksource_start_watchdog(void)
@@ -343,16 +343,16 @@ static void clocksource_resume_watchdog(void)
 {
 	unsigned long flags;
 
-	spin_lock_irqsave(&watchdog_lock, flags);
+	raw_spin_lock_irqsave(&watchdog_lock, flags);
 	clocksource_reset_watchdog();
-	spin_unlock_irqrestore(&watchdog_lock, flags);
+	raw_spin_unlock_irqrestore(&watchdog_lock, flags);
 }
 
 static void clocksource_enqueue_watchdog(struct clocksource *cs)
 {
 	unsigned long flags;
 
-	spin_lock_irqsave(&watchdog_lock, flags);
+	raw_spin_lock_irqsave(&watchdog_lock, flags);
 	if (cs->flags & CLOCK_SOURCE_MUST_VERIFY) {
 		/* cs is a clocksource to be watched. */
 		list_add(&cs->wd_list, &watchdog_list);
@@ -370,7 +370,7 @@ static void clocksource_enqueue_watchdog(struct clocksource *cs)
 	}
 	/* Check if the watchdog timer needs to be started. */
 	clocksource_start_watchdog();
-	spin_unlock_irqrestore(&watchdog_lock, flags);
+	raw_spin_unlock_irqrestore(&watchdog_lock, flags);
 }
 
 static void clocksource_dequeue_watchdog(struct clocksource *cs)
@@ -378,7 +378,7 @@ static void clocksource_dequeue_watchdog(struct clocksource *cs)
 	struct clocksource *tmp;
 	unsigned long flags;
 
-	spin_lock_irqsave(&watchdog_lock, flags);
+	raw_spin_lock_irqsave(&watchdog_lock, flags);
 	if (cs->flags & CLOCK_SOURCE_MUST_VERIFY) {
 		/* cs is a watched clocksource. */
 		list_del_init(&cs->wd_list);
@@ -397,7 +397,7 @@ static void clocksource_dequeue_watchdog(struct clocksource *cs)
 	cs->flags &= ~CLOCK_SOURCE_WATCHDOG;
 	/* Check if the watchdog timer needs to be stopped. */
 	clocksource_stop_watchdog();
-	spin_unlock_irqrestore(&watchdog_lock, flags);
+	raw_spin_unlock_irqrestore(&watchdog_lock, flags);
 }
 
 static int clocksource_watchdog_kthread(void *data)
@@ -407,7 +407,7 @@ static int clocksource_watchdog_kthread(void *data)
 	LIST_HEAD(unstable);
 
 	mutex_lock(&clocksource_mutex);
-	spin_lock_irqsave(&watchdog_lock, flags);
+	raw_spin_lock_irqsave(&watchdog_lock, flags);
 	list_for_each_entry_safe(cs, tmp, &watchdog_list, wd_list)
 		if (cs->flags & CLOCK_SOURCE_UNSTABLE) {
 			list_del_init(&cs->wd_list);
@@ -415,7 +415,7 @@ static int clocksource_watchdog_kthread(void *data)
 		}
 	/* Check if the watchdog timer needs to be stopped. */
 	clocksource_stop_watchdog();
-	spin_unlock_irqrestore(&watchdog_lock, flags);
+	raw_spin_unlock_irqrestore(&watchdog_lock, flags);
 
 	/* Needs to be done outside of watchdog lock */
 	list_for_each_entry_safe(cs, tmp, &unstable, wd_list) {
-- 
1.6.5.2


  reply	other threads:[~2010-01-11 21:27 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-11 21:26 [PATCH 00/26] Convert locks that can't sleep in -rt " John Kacur
2010-01-11 21:26 ` [PATCH 01/26] xtime_lock: Convert atomic_seqlock to raw_seqlock, fix up all users John Kacur
2010-01-11 21:26   ` [PATCH 02/26] seqlock: Create raw_seqlock John Kacur
2010-01-11 21:26     ` [PATCH 03/26] x86: Convert tlbstate_lock to raw_spinlock John Kacur
2010-01-11 21:26       ` [PATCH 04/26] sched: Convert thread_group_cputimer lock " John Kacur
2010-01-11 21:26         ` [PATCH 05/26] x86: Convert ioapic_lock and vector_lock to raw_spinlocks John Kacur
2010-01-11 21:26           ` [PATCH 06/26] x86: Convert i8259A_lock to raw_spinlock John Kacur
2010-01-11 21:26             ` [PATCH 07/26] x86: Convert pci_config_lock " John Kacur
2010-01-11 21:26               ` [PATCH 08/26] i8253: Convert i8253_lock " John Kacur
2010-01-11 21:26                 ` [PATCH 09/26] x86: Convert set_atomicity_lock " John Kacur
2010-01-11 21:26                   ` [PATCH 10/26] ACPI: Convert c3_lock " John Kacur
2010-01-11 21:26                     ` [PATCH 11/26] rtmutex: Convert wait_lock and pi_lock " John Kacur
2010-01-11 21:26                       ` [PATCH 12/26] printk: Convert lock " John Kacur
2010-01-11 21:26                         ` [PATCH 13/26] genirq: Convert locks to raw_spinlocks John Kacur
2010-01-11 21:26                           ` [PATCH 14/26] trace: Convert various locks to raw_spinlock John Kacur
2010-01-11 21:26                             ` John Kacur [this message]
2010-01-11 21:26                               ` [PATCH 16/26] timer_stats: Convert to raw_spinlocks John Kacur
2010-01-11 21:26                                 ` [PATCH 17/26] x86: kvm: Convert i8254/i8259 locks to raw_spinlock John Kacur
2010-01-11 21:26                                   ` [PATCH 18/26] x86 - nmi: Convert nmi_lock " John Kacur
2010-01-11 21:26                                     ` [PATCH 19/26] cgroups: Convert cgroups release_list_lock " John Kacur
2010-01-11 21:26                                       ` [PATCH 20/26] proportions: Convert spinlocks to raw_spinlocks John Kacur
2010-01-11 21:26                                         ` [PATCH 21/26] percpu_counter: Convert to raw_spinlock John Kacur
2010-01-11 21:26                                           ` [PATCH 22/26] oprofile: " John Kacur
2010-01-11 21:26                                             ` [PATCH 23/26] vgacon: Convert vga console lock " John Kacur
2010-01-11 21:26                                               ` [PATCH 24/26] pci-access: Convert pci_lock " John Kacur
2010-01-11 21:26                                                 ` [PATCH 25/26] kprobes: Convert to raw_spinlocks John Kacur
2010-01-11 21:26                                                   ` [PATCH 26/26] softlockup: " John Kacur
2010-01-12  3:54                                                   ` [PATCH 25/26] kprobes: " Frederic Weisbecker
2010-01-11 21:50                                       ` [PATCH 19/26] cgroups: Convert cgroups release_list_lock to raw_spinlock Paul Menage
2010-01-11 22:11                                         ` John Kacur
2010-01-12  3:39                             ` [PATCH 14/26] trace: Convert various locks " Frederic Weisbecker
2010-01-13 15:28                               ` Steven Rostedt
2010-01-13 15:36                                 ` John Kacur
2010-01-13 15:41                                   ` Steven Rostedt
2010-01-13 18:09                                     ` John Kacur
2010-01-17 13:00                                       ` Frederic Weisbecker
2010-01-12  3:24 ` [PATCH 00/26] Convert locks that can't sleep in -rt " Frederic Weisbecker
2010-01-12  3:49   ` Frederic Weisbecker

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=1263245216-14754-16-git-send-email-jkacur@redhat.com \
    --to=jkacur@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=williams@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome