Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp513284imm; Wed, 4 Jul 2018 00:51:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdJyarSoCtfTg1vsvqcChGjWzFBK5PfcJU51W2gFUa91YXL5GRHn0zms7XYFjkiZJXLXSDJ X-Received: by 2002:a62:700a:: with SMTP id l10-v6mr1038169pfc.71.1530690691466; Wed, 04 Jul 2018 00:51:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530690691; cv=none; d=google.com; s=arc-20160816; b=TgsfNJVGWts70wKbP7G4GNDECRE/11c+qthiNu75H00YWXalLC9hUt41hNxeCEpVFC u15yO5wWcsCnVqIYfIC8cQIaq9RWaYxatL1iziGAFKg8aIpc021QYe+HAUxrU+/6eX8G IfE1DsJItY6fbM102q8JCFpgLlr/aieNTpvvcHx1vuDNYiBUKzfpbeE74C1eE1WlBLt/ 9WqR04r1WH9l5SZvY7d7uyIUUoLviGN0H0K5YslHuK1YrQ7B2GZQQJMoC7Z7Ju4FC5iW vrLPt33eHQuT8gsf49ZxGNtgcl7+T1fEthqfm7WjSF+qoRoBJCdIknwrAyXmT/Xptmbw X75w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=p5h2hEYE7YWsUX3xZxJC/xUB1ZDlC2Pk3bQ7HiYtdTU=; b=o4pNHSDA0XqMl1AeeRiBLdpiMEVzmg9Tzbv1AV1wp8CenxJ1+kDuc7QYeIm7RFNHYJ lOX2nVFakYz1kHI3kEtgRLu3TRaNTLysojWDc8zGYbYT3cYWkMQGAF+M+fK1UBmQF/WW gwpNhFq/nifo/pZ8pFrQGsgeD/EWvJnfrZJDbDBPffSG1rkPqdrSBmr2/DkEpl/FLLBr ZKagG8ROOaROxBzLfuQ4/fKlmuOcEbK+s3tu3Tjs3In9+Lwz88irsyYrCB6UCr1aZgW+ rwMNU8nygrAN4EHsRjB0yFsM2VVLOX9UgbhMlgW6MKH1/xIBZaFyFawGgEnaP6hQre+W Lpsw== 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 v66-v6si2722613pgv.57.2018.07.04.00.51.17; Wed, 04 Jul 2018 00:51:31 -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 S933560AbeGDHtX (ORCPT + 99 others); Wed, 4 Jul 2018 03:49:23 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:53988 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932290AbeGDHtV (ORCPT ); Wed, 4 Jul 2018 03:49:21 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 397FD401DEA8; Wed, 4 Jul 2018 07:49:21 +0000 (UTC) Received: from localhost (unknown [10.43.134.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CD9BF111C4A2; Wed, 4 Jul 2018 07:49:19 +0000 (UTC) Date: Wed, 4 Jul 2018 09:49:18 +0200 From: Miroslav Lichvar To: John Stultz Cc: lkml , Thomas Gleixner , Ingo Molnar , Richard Cochran , Prarit Bhargava , Stephen Boyd , Shuah Khan , linux-kselftest@vger.kernel.org Subject: Re: [RFC][PATCH] selftest: timers: Tweak raw_skew to SKIP when ADJ_OFFSET is in progress Message-ID: <20180704074918.GE22600@localhost> References: <1530646587-12101-1-git-send-email-john.stultz@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1530646587-12101-1-git-send-email-john.stultz@linaro.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 04 Jul 2018 07:49:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 04 Jul 2018 07:49:21 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mlichvar@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 03, 2018 at 12:36:27PM -0700, John Stultz wrote: > In the past we've warned when ADJ_OFFSET was in progress, usually > caused by ntpd or some other time adjusting daemon running in non > steady sate, which can cause the skew calculations to be incorrect Good idea. > Thus, this patch sets a flag which we check when we fail so that > we don't cause false negatives. I'd suggest to check few more things to better detect when something is adjusting the clock. The offset should be zero also at the end of the test and the frequency and tick should be the same as at the beginning of the test. This will detect daemons that set the frequency of the clock directly, not using adjtime() or the PLL. Something like this: @@ -137,9 +135,10 @@ int main(int argv, char **argc) printf(" %lld.%i(act)", ppm/1000, abs((int)(ppm%1000))); if (llabs(eppm - ppm) > 1000) { - if (adj_offset_bad) { + if (tx1.offset || tx2.offset || + tx1.freq != tx2.freq || tx1.tick != tx2.tick) { printf(" [SKIP]\n"); - return ksft_exit_skip("ADJ_OFFSET in progress. Shutdown NTPd or other time steering daemons\n"); + return ksft_exit_skip("The clock was adjusted. Shutdown ntpd or other time steering daemons\n"); } printf(" [FAILED]\n"); return ksft_exit_fail(); -- Miroslav Lichvar