Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2364093pxu; Mon, 7 Dec 2020 04:53:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJwYEFV+iZaOEaxb788IFQZTYtZV+44JvK254SjyqUPbbG+JPl5E4C9Q8kgUF9Wddwz2qCFy X-Received: by 2002:a17:906:134f:: with SMTP id x15mr19009330ejb.278.1607345622540; Mon, 07 Dec 2020 04:53:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607345622; cv=none; d=google.com; s=arc-20160816; b=STUE39OEh1Tq6+X5ug3wvudJ/LDLQfazlQFsqvw0TowDJp3TS6vLHkC5qgp/wqtgY3 e5F3kx0yFiqaizMYjlPBxghvAUM6Tv8rslgQ2tOnDBjXNCf+/K1FqgTa+J+nsdO70JkW aHXrD3A+bWsPVciJssa3LmZ5PCveDZbAQkH6rsPcxhchMXphDDedXU1nXcsbL3xOvEHF Mas+G86yNnTd1FBBguRsAMZJNjnINfexVM+FxRc2EuD6m0kRpZDLZZmq4x0rhZUgxO2p 4+pUs0X7dLHsBqizipr+haIyeIfP0tex0jDyoiRiJfA5Dmm3Itk89bMI+4pkuVPDVr3D NkXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pYipuZr0KAd/BhmaUO/qQb5XFs2sYSqccrlAuXRJ48w=; b=gA79SfZK2M5q7AwZukI4kGa7IVh8HX5wMwJZYN1CMYN3MOrv0tb8w7t6JFUBdRxv9m ZRrBsypUNbBMv3KTtCHJesOVKs66NQmAHUbrMfl9znf3ffw4Z/m/MBlsycxCqTBYlqwd RFmhBA7fvAnwBUXLKy5VVwo/r1k7PDOnvnn2ig7bw2sarJ2hyLf/pjPO3eQ+7ScIfuFx 7K1o6//Dvn3cra9bvRQlVFFL0SEjm4cgfvTAEm3AxrcP+0A1iC/SA54zlqyYT4V4fAqo 9W8ihdKCAo8i1JtqhPt9imdn52vCeWEkTTeNttTTqet6Av4rfzqBYRYo2VJ2mwF58y3g VN0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fK33hkBo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t27si6612382ejb.240.2020.12.07.04.53.19; Mon, 07 Dec 2020 04:53:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fK33hkBo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726073AbgLGMtW (ORCPT + 99 others); Mon, 7 Dec 2020 07:49:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:35860 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726035AbgLGMtV (ORCPT ); Mon, 7 Dec 2020 07:49:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607345275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pYipuZr0KAd/BhmaUO/qQb5XFs2sYSqccrlAuXRJ48w=; b=fK33hkBouGZDbClF2qdS850Yu/ZugCcF/WIQUt4pgTF5qjozHuuc/UtufdwCQPX3x82hmC +z4x1C9L74ezVt7+eoy6Sara19mToB70CcER8POjrYKaLmXbLpJ2cs7vhUTXosGOYOBqmu Ee614Ptp4+Udmd0ErE4L+j8Nvx99/ck= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-552--CPdcpaQPRy3huS1qcWC0g-1; Mon, 07 Dec 2020 07:47:53 -0500 X-MC-Unique: -CPdcpaQPRy3huS1qcWC0g-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C665A809DC3; Mon, 7 Dec 2020 12:47:51 +0000 (UTC) Received: from localhost (holly.tpb.lab.eng.brq.redhat.com [10.43.134.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8FBCA5D6B1; Mon, 7 Dec 2020 12:47:49 +0000 (UTC) Date: Mon, 7 Dec 2020 13:47:49 +0100 From: Miroslav Lichvar To: Thomas Gleixner Cc: LKML , Alexandre Belloni , Jason Gunthorpe , John Stultz , Prarit Bhargava , Alessandro Zummo , linux-rtc@vger.kernel.org, Peter Zijlstra Subject: Re: [patch 5/8] ntp: Make the RTC synchronization more reliable Message-ID: <20201207124749.GH2352378@localhost> References: <20201206214613.444124194@linutronix.de> <20201206220542.062910520@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201206220542.062910520@linutronix.de> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Dec 06, 2020 at 10:46:18PM +0100, Thomas Gleixner wrote: > Switch it to an hrtimer instead which schedules the actual update work. The > hrtimer will expire precisely (max 1 jiffie delay when high resolution > timers are not available). The actual scheduling delay of the work is the > same as before. It works well in my tests. > This becomes now: > > if (ntp_synced() && !hrtimer_is_queued(&sync_hrtimer)) > queue_work(system_power_efficient_wq, &sync_work, 0); > > which is racy when the hrtimer has expired and the work is currently > executed and has not yet managed to rearm the hrtimer. > > Not a big problem as it just schedules work for nothing. No more unexpected updates of the RTC observed. Tested-by: Miroslav Lichvar Thanks, -- Miroslav Lichvar