Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp1767457imd; Thu, 1 Nov 2018 23:40:56 -0700 (PDT) X-Google-Smtp-Source: AJdET5dyD+Xrb1gFU9vKLvxSGfuaiy8CfUnH5rQ93Pc+EN4fGTsb1xd/ZlgNTgHK9a/Le3dczoe5 X-Received: by 2002:a17:902:bcc4:: with SMTP id o4-v6mr6046212pls.13.1541140856059; Thu, 01 Nov 2018 23:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541140856; cv=none; d=google.com; s=arc-20160816; b=jHsvB80kgHGmRFSTlHfDsOW9Tl8mKRVg63RD5Q5ISAdB0CvBDzDEUPwF7Ecpk7MvGb c/IrcrcmSVcw6czNAtC/n4a8D7Mkim1mUnuw6FPtpgyL9+qR2F1OqMRQBpBcYNl8ajyf QR9uPwfWJevtc0Yw/0JFO1PDUdYcjq1gJmrGDy9jUJo/BIecjaXM4BFMX+uk1gpD/H4t Y50+KoVzrbOo73KvHqBNQxMl/MUFj8ljkb0z3pqzy1dR4jMC3vwt14a0Cr+uyJiurIeT BKccSduPC5hKsc7irBdJ2obnEDmNaLXpL1Ggq/KN9bHegO9eZQo+CrY/5WxKb+3KveaJ RBxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version; bh=ND9oIeCB2F32D0IPWhQHkiX172YcQysCXSZRS7US7M0=; b=F9qdBXmDRb3KRXSFl5IfkU+KEQeg/bf40VX3m3JPC+3giptVA0ciJim0DNNMgaGwxg EgZkEKwvQamIw2ZefTFcwB9opHj6pKaCY274X4e4zmFE4eEGAzazUL+UT67rH6wZuhDD fa6u4nlWebpvzj/pQ7/yKn4m+betoI2othsnFChkkyauo1jnip/tNYGogm5M702MP9R3 ng/4BDHP3lOpjFsWxxtEaNdsAzgXI5Md1dFzZGZQbyIiYB2Lo+sitt7mI6qN5xsv3Ghz V0qfX0gN6iYxGRLfcd2c9Ab1yC2xnzDuYpmuwoJ8ubf5mull0iFMO2aMtxDE13nQ18xT pGVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y12-v6si7496015pgg.158.2018.11.01.23.40.41; Thu, 01 Nov 2018 23:40:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728382AbeKBPqR (ORCPT + 99 others); Fri, 2 Nov 2018 11:46:17 -0400 Received: from mail-ot1-f49.google.com ([209.85.210.49]:41202 "EHLO mail-ot1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727745AbeKBPqR (ORCPT ); Fri, 2 Nov 2018 11:46:17 -0400 Received: by mail-ot1-f49.google.com with SMTP id c32so818709otb.8 for ; Thu, 01 Nov 2018 23:40:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ND9oIeCB2F32D0IPWhQHkiX172YcQysCXSZRS7US7M0=; b=GbLCA+X/X3R3edxCf/lbVr8M3f6mhdnHblO26F1Wcxh+4zuiDEDnFX4apXjsh+EDkQ pnkXeVwZCyQfQPOzgbJi9Sv+p3HNr+6xIgc1CKj4IXL0924h/spDirT/QdXc43JghWFw l4aob+mbZ60OQeyzPrme761BXSIe7L1l55bgCDqO6PZEORKJTQp5q+OInxE+0uN/z6Jc d4G5eyX0XQtTxsQbvzA0EI02e4PAKyVeIB0AjRIRs2TsGb7/Qlj3pLO1Mx9Tj+0u+5PO cg8ednsF95YcabeXVjS/AREDCA8KUB9gUhqxii3UnXWRsz6YCAGmqXfohd7Bck6OGNjm UJyg== X-Gm-Message-State: AGRZ1gL+VMYmiKZhmwNbF795k+j+tu9CyoJc/WIp7jSN/oOED1TPyzdF Ja7d9lKGXg+iIdBEr/aGogWRXHLavtM0PRlK2sZKgQ== X-Received: by 2002:a9d:7043:: with SMTP id x3mr5972568otj.173.1541140811588; Thu, 01 Nov 2018 23:40:11 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:faf:0:0:0:0:0 with HTTP; Thu, 1 Nov 2018 23:40:10 -0700 (PDT) In-Reply-To: References: <1541085133-32534-1-git-send-email-neelx@redhat.com> From: Daniel Vacek Date: Fri, 2 Nov 2018 07:40:10 +0100 Message-ID: Subject: Re: [PATCH] tsc: make calibration refinement more robust To: Thomas Gleixner Cc: x86@kernel.org, Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , LKML , Peter Zijlstra Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thomas, thanks for checking. On Thu, Nov 1, 2018 at 4:34 PM, Thomas Gleixner wrote: > Daniel, > > On Thu, 1 Nov 2018, Daniel Vacek wrote: > > Please use 'x86/tsc:' as prefix. git log path/to/file usually gives you a > reasonable hint about prefixes. Oh, sure thing. The dmesg always prints 'tsc:' - I somehow sticked to it... >> -#define MAX_RETRIES 5 >> -#define SMI_TRESHOLD 50000 >> +#define MAX_RETRIES 5 >> +#define TSC_THRESHOLD (tsc_khz >> 5) > > This breaks pit_hpet_ptimer_calibrate_cpu() because at that point tsc_hkz is 0. That did not show up with my testing, sorry. I guess pit_calibrate_tsc() never failed for me. Hmm, actually it looks like quick_pit_calibrate() does the job for me so pit_hpet_ptimer_calibrate_cpu() is likely not even called. Would this: #define TSC_THRESHOLD (tsc_khz? tsc_khz >> 5: 0x20000) work for you instead? Or alternatively at some point when chasing this down I used: #define TSC_THRESHOLD (0x10000 + (tsc_khz >> 6)) The first one seems better though. I can send v2 next week if you like it. --nX > Thanks, > > tglx