From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F168C1B0D9 for ; Mon, 7 Dec 2020 12:49:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3C0D323403 for ; Mon, 7 Dec 2020 12:49:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726077AbgLGMtW (ORCPT ); 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