From patchwork Thu Jan 2 23:11:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 22874 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AD2A8218DC for ; Thu, 2 Jan 2014 23:11:22 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id g10sf44185135pdj.9 for ; Thu, 02 Jan 2014 15:11:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=JMZ9E77mMNvMA2DlhoouTKYPenDbAGWJ19TVw9Z1t1U=; b=UiImIP5R8/XgeBgiGbYgUeB8LaH23A3EkKFC3hcZod1zDp9AFNMgFJ8NP5F21xsBfQ O9fP7bZFiEx0U/tVpDVHgexNICXmNpW+lnPlE6VdAlaC42WPSE6ntLvodoYdrlc4nv6a OwN9fkeepJqLVibu82RcGG6DiFO2DdTdj7b3UWq5YORsVnvCGGWD1dfO/YrlP6XcPjgo URF4MvJ0HN2/bvGJrSGJY2VT2vBVcKH7zGsT5ZhmkGG49cp5de2x6j7TwtffbUr5kWRP i7cfDKjvX7l9paPDNrpw6p1TfkWj3d7EWkNcr9iq4qqN1ePF8dsUqQgRb18tRZn8MUDH E2Gw== X-Gm-Message-State: ALoCoQlnD+NDIw99IK9VsJLeSZf1vw2ZW0qiI+GQai9DxxUZhGeW+nUlDUnogGt79kPsX7oCVKuV X-Received: by 10.66.66.163 with SMTP id g3mr34219180pat.3.1388704281831; Thu, 02 Jan 2014 15:11:21 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.47.9 with SMTP id z9ls4674833qem.79.gmail; Thu, 02 Jan 2014 15:11:21 -0800 (PST) X-Received: by 10.58.67.9 with SMTP id j9mr49508151vet.3.1388704281699; Thu, 02 Jan 2014 15:11:21 -0800 (PST) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id sp7si12080314vdc.112.2014.01.02.15.11.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 Jan 2014 15:11:21 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id ks9so7558158vcb.12 for ; Thu, 02 Jan 2014 15:11:21 -0800 (PST) X-Received: by 10.58.208.130 with SMTP id me2mr50288359vec.13.1388704281620; Thu, 02 Jan 2014 15:11:21 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp797290ved; Thu, 2 Jan 2014 15:11:20 -0800 (PST) X-Received: by 10.68.130.103 with SMTP id od7mr31686129pbb.87.1388704280427; Thu, 02 Jan 2014 15:11:20 -0800 (PST) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by mx.google.com with ESMTPS id yd9si43897293pab.31.2014.01.02.15.11.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 Jan 2014 15:11:20 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.46 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.220.46; Received: by mail-pa0-f46.google.com with SMTP id kp14so13057942pab.5 for ; Thu, 02 Jan 2014 15:11:20 -0800 (PST) X-Received: by 10.66.197.135 with SMTP id iu7mr25971203pac.149.1388704279991; Thu, 02 Jan 2014 15:11:19 -0800 (PST) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id g6sm136823533pat.2.2014.01.02.15.11.18 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 Jan 2014 15:11:19 -0800 (PST) From: John Stultz To: LKML Cc: John Stultz , =?UTF-8?q?Krzysztof=20Ha=C5=82asa?= , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Willy Tarreau , Ingo Molnar , Peter Zijlstra , Stephen Boyd , Linus Torvalds , linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/2] sched_clock: Disable seqlock lockdep usage in sched_clock Date: Thu, 2 Jan 2014 15:11:14 -0800 Message-Id: <1388704274-5278-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1388704274-5278-1-git-send-email-john.stultz@linaro.org> References: <52C5E675.80701@linaro.org> <1388704274-5278-1-git-send-email-john.stultz@linaro.org> MIME-Version: 1.0 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Unforunately the seqlock lockdep enablmenet can't be used in sched_clock, since the lockdep infrastructure eventually calls into sched_clock, which causes a deadlock. Thus, this patch changes all generic sched_clock usage to use the raw_* methods. Cc: Krzysztof Hałasa Cc: Uwe Kleine-König Cc: Willy Tarreau Cc: Ingo Molnar , Cc: Peter Zijlstra Cc: Stephen Boyd Cc: Linus Torvalds Cc: linux-arm-kernel@lists.infradead.org Reported-by: Krzysztof Hałasa Signed-off-by: John Stultz --- kernel/time/sched_clock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/time/sched_clock.c b/kernel/time/sched_clock.c index 68b7993..0abb364 100644 --- a/kernel/time/sched_clock.c +++ b/kernel/time/sched_clock.c @@ -74,7 +74,7 @@ unsigned long long notrace sched_clock(void) return cd.epoch_ns; do { - seq = read_seqcount_begin(&cd.seq); + seq = raw_read_seqcount_begin(&cd.seq); epoch_cyc = cd.epoch_cyc; epoch_ns = cd.epoch_ns; } while (read_seqcount_retry(&cd.seq, seq)); @@ -99,10 +99,10 @@ static void notrace update_sched_clock(void) cd.mult, cd.shift); raw_local_irq_save(flags); - write_seqcount_begin(&cd.seq); + raw_write_seqcount_begin(&cd.seq); cd.epoch_ns = ns; cd.epoch_cyc = cyc; - write_seqcount_end(&cd.seq); + raw_write_seqcount_end(&cd.seq); raw_local_irq_restore(flags); }