From patchwork Fri Mar 2 07:12:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 7060 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 3F68323E4A for ; Fri, 2 Mar 2012 07:13:40 +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 F2B91A18497 for ; Fri, 2 Mar 2012 07:13:39 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so2587506iag.11 for ; Thu, 01 Mar 2012 23:13:39 -0800 (PST) Received: from mr.google.com ([10.50.170.41]) by 10.50.170.41 with SMTP id aj9mr861950igc.0.1330672419828 (num_hops = 1); Thu, 01 Mar 2012 23:13:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.170.41 with SMTP id aj9mr712974igc.0.1330672419790; Thu, 01 Mar 2012 23:13:39 -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 k18csp3362ibg; Thu, 1 Mar 2012 23:13:39 -0800 (PST) Received: by 10.68.129.136 with SMTP id nw8mr10194568pbb.121.1330672419096; Thu, 01 Mar 2012 23:13:39 -0800 (PST) Received: from e33.co.us.ibm.com (e33.co.us.ibm.com. [32.97.110.151]) by mx.google.com with ESMTPS id e6si6892413pbj.180.2012.03.01.23.13.38 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 01 Mar 2012 23:13:39 -0800 (PST) Received-SPF: pass (google.com: domain of jstultz@us.ibm.com designates 32.97.110.151 as permitted sender) client-ip=32.97.110.151; Authentication-Results: mx.google.com; spf=pass (google.com: domain of jstultz@us.ibm.com designates 32.97.110.151 as permitted sender) smtp.mail=jstultz@us.ibm.com Received: from /spool/local by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 2 Mar 2012 00:13:37 -0700 Received: from d01dlp03.pok.ibm.com (9.56.224.17) by e33.co.us.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 2 Mar 2012 00:13:03 -0700 Received: from d01relay07.pok.ibm.com (d01relay07.pok.ibm.com [9.56.227.147]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 3A224C90052; Fri, 2 Mar 2012 02:13:02 -0500 (EST) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q227D1Ae3133580; Fri, 2 Mar 2012 02:13:01 -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 q227D0WO004056; Fri, 2 Mar 2012 04:13:01 -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 q227D0Ba004041; Fri, 2 Mar 2012 04:13:00 -0300 Received: by kernel.beaverton.ibm.com (Postfix, from userid 1056) id F2302C03E7; Thu, 1 Mar 2012 23:12:58 -0800 (PST) From: John Stultz To: lkml Cc: John Stultz , Ingo Molnar , Thomas Gleixner , Eric Dumazet , Richard Cochran Subject: [PATCH 6/9] time: Reduce timekeeper read lock hold time Date: Thu, 1 Mar 2012 23:12:45 -0800 Message-Id: <1330672368-32290-7-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-2398-0000-0000-000004B6F362 X-Gm-Message-State: ALoCoQl1reyhWWAYa5jp9H90ZxeEzeuRuNEKa4Mt6OyAVtX6o5o02Nysjaby1UZAEy26u2FSv9Jx Now that timekeeper updates are done with a shadow copy, we can reduce the readlock hold time to only the update. CC: Ingo Molnar CC: Thomas Gleixner CC: Eric Dumazet CC: Richard Cochran Signed-off-by: John Stultz --- kernel/time/timekeeping.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index ed8cb51..97982b1 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -1071,7 +1071,6 @@ static void update_wall_time(void) s64 remainder; spin_lock_irqsave(&timekeeper_wlock, flags); - write_seqcount_begin(&timekeeper_rlock); /* Make sure we're fully resumed: */ if (unlikely(timekeeping_suspended)) @@ -1155,13 +1154,13 @@ static void update_wall_time(void) second_overflow(); } - + write_seqcount_begin(&timekeeper_rlock); timekeeper = shadow_tk; timekeeper.clock->cycle_last = timekeeper.cycle_last; timekeeping_update(&timekeeper, false); + write_seqcount_end(&timekeeper_rlock); out: - write_seqcount_end(&timekeeper_rlock); spin_unlock_irqrestore(&timekeeper_wlock, flags); }