From patchwork Tue Feb 28 00:29:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 6957 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 6EC4A23E4A for ; Tue, 28 Feb 2012 00:29:51 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 3766DA1875C for ; Tue, 28 Feb 2012 00:29:51 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so310163iag.11 for ; Mon, 27 Feb 2012 16:29:51 -0800 (PST) Received: from mr.google.com ([10.50.12.170]) by 10.50.12.170 with SMTP id z10mr766159igb.55.1330388991059 (num_hops = 1); Mon, 27 Feb 2012 16:29:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.12.170 with SMTP id z10mr663616igb.55.1330388990959; Mon, 27 Feb 2012 16:29:50 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.11.10 with SMTP id r10csp13067ibr; Mon, 27 Feb 2012 16:29:50 -0800 (PST) Received: by 10.68.136.4 with SMTP id pw4mr22099052pbb.131.1330388989618; Mon, 27 Feb 2012 16:29:49 -0800 (PST) Received: from e2.ny.us.ibm.com (e2.ny.us.ibm.com. [32.97.182.142]) by mx.google.com with ESMTPS id u10si19305573pbv.142.2012.02.27.16.29.48 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 27 Feb 2012 16:29:49 -0800 (PST) Received-SPF: pass (google.com: domain of jstultz@us.ibm.com designates 32.97.182.142 as permitted sender) client-ip=32.97.182.142; Authentication-Results: mx.google.com; spf=pass (google.com: domain of jstultz@us.ibm.com designates 32.97.182.142 as permitted sender) smtp.mail=jstultz@us.ibm.com Received: from /spool/local by e2.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 27 Feb 2012 19:29:48 -0500 Received: from d01dlp02.pok.ibm.com (9.56.224.85) by e2.ny.us.ibm.com (192.168.1.102) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 27 Feb 2012 19:29:45 -0500 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 59D036E804A; Mon, 27 Feb 2012 19:29:44 -0500 (EST) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q1S0TiQW303336; Mon, 27 Feb 2012 19:29:44 -0500 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q1S0TiKt002490; Mon, 27 Feb 2012 21:29:44 -0300 Received: from kernel.beaverton.ibm.com (kernel.beaverton.ibm.com [9.47.67.96]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q1S0Tiaa002484; Mon, 27 Feb 2012 21:29:44 -0300 Received: by kernel.beaverton.ibm.com (Postfix, from userid 1056) id 73FA1C03C5; Mon, 27 Feb 2012 16:29:42 -0800 (PST) From: John Stultz To: lkml Cc: John Stultz , Thomas Gleixner , Eric Dumazet , Richard Cochran Subject: [PATCH 7/7] time: Convert the timekeeper's wlock to a raw_spin_lock Date: Mon, 27 Feb 2012 16:29:34 -0800 Message-Id: <1330388974-27793-8-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.7.3.2.146.gca209 In-Reply-To: <1330388974-27793-1-git-send-email-john.stultz@linaro.org> References: <1330388974-27793-1-git-send-email-john.stultz@linaro.org> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12022800-5112-0000-0000-000005A9FC02 X-Gm-Message-State: ALoCoQkcyFj9eZi+dBMH6r86j1hkAoNaLfI0JR7R0pFRdJnQd748Br0WbfHuFYkPkRmnPTpzvEJS Convert the wlock to raw spin lock. CC: Thomas Gleixner CC: Eric Dumazet CC: Richard Cochran Signed-off-by: John Stultz --- kernel/time/timekeeping.c | 36 ++++++++++++++++++------------------ 1 files changed, 18 insertions(+), 18 deletions(-) diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 5a444b8..0a4decb 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -74,7 +74,7 @@ struct timekeeper { /* locks for timekeeper structure */ seqcount_t rlock; /* This seqcount serializes readers from updates */ - spinlock_t wlock; /* This spinlock serializes updaters */ + raw_spinlock_t wlock; /* This spinlock serializes updaters */ }; static struct timekeeper timekeeper; @@ -225,13 +225,13 @@ void timekeeping_leap_insert(int leapsecond) { unsigned long flags; - spin_lock_irqsave(&timekeeper.wlock, flags); + raw_spin_lock_irqsave(&timekeeper.wlock, flags); write_seqcount_begin(&timekeeper.rlock); timekeeper.xtime_sec += leapsecond; timekeeper.wall_to_monotonic.tv_sec -= leapsecond; timekeeping_update(&timekeeper, false); write_seqcount_end(&timekeeper.rlock); - spin_unlock_irqrestore(&timekeeper.wlock, flags); + raw_spin_unlock_irqrestore(&timekeeper.wlock, flags); } @@ -423,7 +423,7 @@ int do_settimeofday(const struct timespec *tv) if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC) return -EINVAL; - spin_lock_irqsave(&timekeeper.wlock, flags); + raw_spin_lock_irqsave(&timekeeper.wlock, flags); write_seqcount_begin(&timekeeper.rlock); timekeeping_forward_now(); @@ -440,7 +440,7 @@ int do_settimeofday(const struct timespec *tv) timekeeping_update(&timekeeper, true); write_seqcount_end(&timekeeper.rlock); - spin_unlock_irqrestore(&timekeeper.wlock, flags); + raw_spin_unlock_irqrestore(&timekeeper.wlock, flags); /* signal hrtimers about time change */ clock_was_set(); @@ -464,7 +464,7 @@ int timekeeping_inject_offset(struct timespec *ts) if ((unsigned long)ts->tv_nsec >= NSEC_PER_SEC) return -EINVAL; - spin_lock_irqsave(&timekeeper.wlock, flags); + raw_spin_lock_irqsave(&timekeeper.wlock, flags); write_seqcount_begin(&timekeeper.rlock); timekeeping_forward_now(); @@ -477,7 +477,7 @@ int timekeeping_inject_offset(struct timespec *ts) timekeeping_update(&timekeeper, true); write_seqcount_end(&timekeeper.rlock); - spin_unlock_irqrestore(&timekeeper.wlock, flags); + raw_spin_unlock_irqrestore(&timekeeper.wlock, flags); /* signal hrtimers about time change */ clock_was_set(); @@ -638,10 +638,10 @@ void __init timekeeping_init(void) read_boot_clock(&boot); seqcount_init(&timekeeper.rlock); - spin_lock_init(&timekeeper.wlock); + raw_spin_lock_init(&timekeeper.wlock); ntp_init(); - spin_lock_irqsave(&timekeeper.wlock, flags); + raw_spin_lock_irqsave(&timekeeper.wlock, flags); write_seqcount_begin(&timekeeper.rlock); clock = clocksource_default_clock(); @@ -661,7 +661,7 @@ void __init timekeeping_init(void) timekeeper.total_sleep_time.tv_nsec = 0; write_seqcount_end(&timekeeper.rlock); - spin_unlock_irqrestore(&timekeeper.wlock, flags); + raw_spin_unlock_irqrestore(&timekeeper.wlock, flags); } @@ -711,7 +711,7 @@ void timekeeping_inject_sleeptime(struct timespec *delta) if (!(ts.tv_sec == 0 && ts.tv_nsec == 0)) return; - spin_lock_irqsave(&timekeeper.wlock, flags); + raw_spin_lock_irqsave(&timekeeper.wlock, flags); write_seqcount_begin(&timekeeper.rlock); timekeeping_forward_now(); @@ -721,7 +721,7 @@ void timekeeping_inject_sleeptime(struct timespec *delta) timekeeping_update(&timekeeper, true); write_seqcount_end(&timekeeper.rlock); - spin_unlock_irqrestore(&timekeeper.wlock, flags); + raw_spin_unlock_irqrestore(&timekeeper.wlock, flags); /* signal hrtimers about time change */ clock_was_set(); @@ -744,7 +744,7 @@ static void timekeeping_resume(void) clocksource_resume(); - spin_lock_irqsave(&timekeeper.wlock, flags); + raw_spin_lock_irqsave(&timekeeper.wlock, flags); write_seqcount_begin(&timekeeper.rlock); if (timespec_compare(&ts, &timekeeping_suspend_time) > 0) { @@ -758,7 +758,7 @@ static void timekeeping_resume(void) timekeeping_suspended = 0; write_seqcount_end(&timekeeper.rlock); - spin_unlock_irqrestore(&timekeeper.wlock, flags); + raw_spin_unlock_irqrestore(&timekeeper.wlock, flags); touch_softlockup_watchdog(); @@ -776,7 +776,7 @@ static int timekeeping_suspend(void) read_persistent_clock(&timekeeping_suspend_time); - spin_lock_irqsave(&timekeeper.wlock, flags); + raw_spin_lock_irqsave(&timekeeper.wlock, flags); write_seqcount_begin(&timekeeper.rlock); timekeeping_forward_now(); @@ -804,7 +804,7 @@ static int timekeeping_suspend(void) } write_seqcount_end(&timekeeper.rlock); - spin_unlock_irqrestore(&timekeeper.wlock, flags); + raw_spin_unlock_irqrestore(&timekeeper.wlock, flags); clockevents_notify(CLOCK_EVT_NOTIFY_SUSPEND, NULL); clocksource_suspend(); @@ -1061,7 +1061,7 @@ static void update_wall_time(void) unsigned long flags; s64 remainder; - spin_lock_irqsave(&timekeeper.wlock, flags); + raw_spin_lock_irqsave(&timekeeper.wlock, flags); /* Make sure we're fully resumed: */ if (unlikely(timekeeping_suspended)) @@ -1156,7 +1156,7 @@ static void update_wall_time(void) write_seqcount_end(&timekeeper.rlock); out: - spin_unlock_irqrestore(&timekeeper.wlock, flags); + raw_spin_unlock_irqrestore(&timekeeper.wlock, flags); }