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=-12.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,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 361D1C64E7C for ; Wed, 2 Dec 2020 15:38:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C7A7D20B1F for ; Wed, 2 Dec 2020 15:38:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730520AbgLBPia (ORCPT ); Wed, 2 Dec 2020 10:38:30 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:57188 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728509AbgLBPi3 (ORCPT ); Wed, 2 Dec 2020 10:38:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606923423; 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=Jw9C2pIBkb46imqaOeqQcBQrINKPfV8SYykjuGj6PxI=; b=AQol1xHLTElAiU2w1JOL0xE4u6QCV2mQ6btFYqaposb9xjot+BjVr9RvkzBEMJDNzf5G9Y nrkMsYTkM/19zwICOxVMiKs4QoaivZduK8+lZ+4A+KhQ0L6jhco84FTR2CSebRpnaZBhpp +PKUdGFCeLL45g83RMK0TAidlepbsA0= 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-147-IfRnQ6GXMkmomM3kViRYzg-1; Wed, 02 Dec 2020 10:37:00 -0500 X-MC-Unique: IfRnQ6GXMkmomM3kViRYzg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 86947805727; Wed, 2 Dec 2020 15:36:59 +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 49CB319C47; Wed, 2 Dec 2020 15:36:58 +0000 (UTC) Date: Wed, 2 Dec 2020 16:36:56 +0100 From: Miroslav Lichvar To: Thomas Gleixner Cc: Jason Gunthorpe , linux-kernel@vger.kernel.org, John Stultz , Prarit Bhargava Subject: Re: [PATCH] rtc: adapt allowed RTC update error Message-ID: <20201202153656.GC2231584@localhost> References: <20201201143835.2054508-1-mlichvar@redhat.com> <20201201161224.GF5487@ziepe.ca> <20201201171420.GN1900232@localhost> <20201201173540.GH5487@ziepe.ca> <87mtywe2zu.fsf@nanos.tec.linutronix.de> <20201202150725.GA2231584@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201202150725.GA2231584@localhost> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 02, 2020 at 04:07:28PM +0100, Miroslav Lichvar wrote: > On Wed, Dec 02, 2020 at 02:44:53PM +0100, Thomas Gleixner wrote: > > Something like the completely untested below should make this reliable > > and only needs to retry when the work is running late (busy machine), > > but the wakeup will be on time or at max 1 jiffie off when high > > resolution timers are not available or disabled. > > It seems to work nicely. In my test most of the updates succeeded on > the first attempt hitting the right tick, the rest succeeding on the > second attempt. Only when the clock was set to run 10% faster, it > needed few more attempts to converge to the target time. I noticed an observable change wrt adjtimex() calls though. It seems it now reschedules the RTC update, i.e. there can be more than one update per 11 minutes. Was this intended? > @@ -629,7 +618,7 @@ void ntp_notify_cmos_timer(void) > > if (IS_ENABLED(CONFIG_GENERIC_CMOS_UPDATE) || > IS_ENABLED(CONFIG_RTC_SYSTOHC)) > - queue_delayed_work(system_power_efficient_wq, &sync_work, 0); > + queue_work(system_power_efficient_wq, &sync_work); > } -- Miroslav Lichvar