From patchwork Tue Jun 17 12:42:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 32026 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 74725206A0 for ; Tue, 17 Jun 2014 12:42:39 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id l6sf17428031qcy.10 for ; Tue, 17 Jun 2014 05:42:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:in-reply-to:references :date:message-id:subject:from:to:cc:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=3zMySHV9syhrddRRMbWw1pTCrTvJMeLumqtLXb4dVSY=; b=dQlztQzXI8i0joSvEhcRg5r1YcxqnehvfzFf0R9i5OXC6U/uZJ8TbJa5/zliAeB7gd z7lz4pAR+vbMu0Y/WYbQSHPGgkzNBGsBwWFcS/zuoNWiGoOrFj0Wmf5jAFvAopf3lPD6 ug40CnCouiYG+9ufXnPWtAizlMvt6StVYi3nek//E9PpeOGNx8srYdQRz7wsG6i0O3H5 z9Jn+OA7WNm9ur/5vXIOZyPfNhQVRbRQEonhttM39YrH0GNSXXcFE5NxGhHiAPtpFjvn dd00l6/pXlV66Mmy/+rhNmPDfIgM2BHd7qE7AFqeTUB5s6OcdH4Utpqehm2vKX4VB1kQ Nn5A== X-Gm-Message-State: ALoCoQmZg2J/3SvMjzeAngYehaCpF4SQmRRvA2REF5tpgIIzx8WniNLFxrzi/TWupttty7FHwBLB X-Received: by 10.58.195.162 with SMTP id if2mr1582047vec.21.1403008959142; Tue, 17 Jun 2014 05:42:39 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.38.133 with SMTP id t5ls4762183qgt.43.gmail; Tue, 17 Jun 2014 05:42:39 -0700 (PDT) X-Received: by 10.58.122.196 with SMTP id lu4mr157030veb.52.1403008959022; Tue, 17 Jun 2014 05:42:39 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id az8si5388038vdc.26.2014.06.17.05.42.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Jun 2014 05:42:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.171 as permitted sender) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id jz11so7493343veb.16 for ; Tue, 17 Jun 2014 05:42:38 -0700 (PDT) X-Received: by 10.221.7.71 with SMTP id on7mr21638510vcb.18.1403008958888; Tue, 17 Jun 2014 05:42:38 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp206393vcb; Tue, 17 Jun 2014 05:42:38 -0700 (PDT) X-Received: by 10.68.194.229 with SMTP id hz5mr31723156pbc.91.1403008958046; Tue, 17 Jun 2014 05:42:38 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zz3si17197789pac.115.2014.06.17.05.42.37 for ; Tue, 17 Jun 2014 05:42:37 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932967AbaFQMm3 (ORCPT + 26 others); Tue, 17 Jun 2014 08:42:29 -0400 Received: from mail-oa0-f45.google.com ([209.85.219.45]:56969 "EHLO mail-oa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932694AbaFQMm2 (ORCPT ); Tue, 17 Jun 2014 08:42:28 -0400 Received: by mail-oa0-f45.google.com with SMTP id o6so8356040oag.18 for ; Tue, 17 Jun 2014 05:42:27 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.46.229 with SMTP id y5mr26800847oem.7.1403008947539; Tue, 17 Jun 2014 05:42:27 -0700 (PDT) Received: by 10.182.45.196 with HTTP; Tue, 17 Jun 2014 05:42:27 -0700 (PDT) In-Reply-To: <20140617121535.GY6758@twins.programming.kicks-ass.net> References: <20131212140835.729222186@infradead.org> <20131212141655.238445339@infradead.org> <20140617121535.GY6758@twins.programming.kicks-ass.net> Date: Tue, 17 Jun 2014 18:12:27 +0530 Message-ID: Subject: Re: [PATCH 11/15] x86: Rewrite cyc2ns to avoid the need to disable IRQs From: Viresh Kumar To: Peter Zijlstra Cc: Arjan van de Ven , Len Brown , "Rafael J. Wysocki" , Eliezer Tamir , Zhang Rui , jacob.jun.pan@linux.intel.com, Mike Galbraith , Ingo Molnar , "H. Peter Anvin" , Paul McKenney , Thomas Gleixner , John Stultz , Andy Lutomirski , "linux-kernel@vger.kernel.org" , registosites@hotmail.com, "Srivatsa S. Bhat" Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On 17 June 2014 17:45, Peter Zijlstra wrote: > Ah, just a freeze? As per what he reported and his screen dumps, looks like yes a freeze. IOW, no prints at all on terminal, even the ones issued before reaching set_cyc2ns_scale().. >> CPUs: Only two CPUs, sharing clock line > > What's specific to this particular CPU? You meant why I mentioned this information? Nothing specific actually, just mentioned it to make all information available that might be useful .. Probably its not :) > So what you can try is force a cyc2ns read before the write in > set_cyc2ns_scale(). I think its possible that if we do not do the read, > the write will wait for a 'free' slot indefinitely. Hmm, I see. Thanks for your quick response. Are you suggesting something like this ? : @Mauro: Please try this once Peter confirms. --- viresh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 57e5ce1..290ac03 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c @@ -249,6 +249,9 @@ static void set_cyc2ns_scale(unsigned long cpu_khz, int cpu) if (!cpu_khz) goto done; + data = cyc2ns_read_begin(); + cyc2ns_read_end(data); + data = cyc2ns_write_begin(cpu); rdtscll(tsc_now);