From patchwork Fri Mar 2 07:12:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 7056 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 735B823E4A for ; Fri, 2 Mar 2012 07:13:18 +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 3B2EEA1849E for ; Fri, 2 Mar 2012 07:13:18 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so2587506iag.11 for ; Thu, 01 Mar 2012 23:13:18 -0800 (PST) Received: from mr.google.com ([10.50.187.168]) by 10.50.187.168 with SMTP id ft8mr659555igc.55.1330672398071 (num_hops = 1); Thu, 01 Mar 2012 23:13:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.187.168 with SMTP id ft8mr548110igc.55.1330672398006; Thu, 01 Mar 2012 23:13:18 -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.53.18 with SMTP id k18csp3351ibg; Thu, 1 Mar 2012 23:13:17 -0800 (PST) Received: by 10.236.182.36 with SMTP id n24mr9310666yhm.111.1330672397252; Thu, 01 Mar 2012 23:13:17 -0800 (PST) Received: from e3.ny.us.ibm.com (e3.ny.us.ibm.com. [32.97.182.143]) by mx.google.com with ESMTPS id d9si5413981yhn.135.2012.03.01.23.13.16 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 01 Mar 2012 23:13:17 -0800 (PST) Received-SPF: pass (google.com: domain of jstultz@us.ibm.com designates 32.97.182.143 as permitted sender) client-ip=32.97.182.143; Authentication-Results: mx.google.com; spf=pass (google.com: domain of jstultz@us.ibm.com designates 32.97.182.143 as permitted sender) smtp.mail=jstultz@us.ibm.com Received: from /spool/local by e3.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 2 Mar 2012 02:13:16 -0500 Received: from d01dlp02.pok.ibm.com (9.56.224.85) by e3.ny.us.ibm.com (192.168.1.103) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 2 Mar 2012 02:13:05 -0500 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id BF2E76E804B; Fri, 2 Mar 2012 02:13:04 -0500 (EST) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q227D4kj226518; Fri, 2 Mar 2012 02:13:04 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q227D15v001320; Fri, 2 Mar 2012 04:13:03 -0300 Received: from kernel.beaverton.ibm.com (kernel.beaverton.ibm.com [9.47.67.96]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q227D0PC001278; Fri, 2 Mar 2012 04:13:00 -0300 Received: by kernel.beaverton.ibm.com (Postfix, from userid 1056) id 0B958C03E8; Thu, 1 Mar 2012 23:12:59 -0800 (PST) From: John Stultz To: lkml Cc: John Stultz , Ingo Molnar , Thomas Gleixner , Eric Dumazet , Richard Cochran Subject: [PATCH 7/9] time: Convert the timekeeper's wlock to a raw_spin_lock Date: Thu, 1 Mar 2012 23:12:46 -0800 Message-Id: <1330672368-32290-8-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.7.3.2.146.gca209 In-Reply-To: <1330672368-32290-1-git-send-email-john.stultz@linaro.org> References: <1330672368-32290-1-git-send-email-john.stultz@linaro.org> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12030207-8974-0000-0000-000006E1F4CE X-Gm-Message-State: ALoCoQmSAw9+U33+7eCJkHHp1VFksP2WayqPiWqraobB32ikHCECD2wCYZCR13YlE8rdvfoLtXTw Convert the wlock to raw spin lock. CC: Ingo Molnar 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 97982b1..2ceee24 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -81,7 +81,7 @@ static struct timekeeper shadow_tk; /* This seqcount serializes readers from updates */ static seqcount_t timekeeper_rlock; /* This spinlock serializes updaters */ -static spinlock_t timekeeper_wlock; +static raw_spinlock_t timekeeper_wlock; /* * This read-write spinlock protects us from races in SMP while @@ -236,13 +236,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); } @@ -434,7 +434,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(&timekeeper); @@ -451,7 +451,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(); @@ -475,7 +475,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(&timekeeper); @@ -488,7 +488,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(); @@ -649,10 +649,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(); @@ -672,7 +672,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); } @@ -722,7 +722,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(&timekeeper); @@ -732,7 +732,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(); @@ -755,7 +755,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) { @@ -769,7 +769,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(); @@ -787,7 +787,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(&timekeeper); @@ -814,7 +814,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(); @@ -1070,7 +1070,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)) @@ -1161,7 +1161,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); }