Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp412049pxu; Tue, 1 Dec 2020 14:38:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJwzy9jic1RRNFA6f5014l+FqtsT6UypNheE9N/RTd2Ax0qt0Ccm1UoTYxQ+8edBRzBKi8CG X-Received: by 2002:a50:9518:: with SMTP id u24mr5265069eda.333.1606862308245; Tue, 01 Dec 2020 14:38:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606862308; cv=none; d=google.com; s=arc-20160816; b=l2NscsHUACKWWymwjxuhSfzudPalB4C3DZ3JYLuB0DpmrdqEFK1PhjiELf2eqWm2c9 oD1tMqN65p4e96BtctIf3VnH3ie45hN8LXu5Ldkxt900+OGX718eqbnmfKEffIHSi5GR 0JrVDiBSYy7SrwdmHx+xDCu4BQNueMuc4h2puNp31/4x2AyRVPKD8igdG5Scnbb2vP3p EYxfhG/kEAsFrGyqDn6z+0a95zweYrweBi82JZe35a+X3ZMG9pEY+hojciYPMn/lgybB mptzpRVZV1SDZUJFu18baSi4px2BywRaP2rXf7wv1dPi/XXN2ruv6nP+/PtWsSCK8EQC y4UA== 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=yYhw/vZvk8MrQ/Lit7Nmq+GciopS/YLhUVtcN0QEwlo=; b=0fNPIsxpchaOGUIVf3jh5YfKOPwJkWTcn4FfgEmyZXwyqzK2qNvMfxwtB95TUNK+ye yqLQCjLiVgvhJmAWYJjwiTGCDBlJrUvzmU3/SkAplPyaPqhW0FQ4j1avbqlUq/GTt/cw aGTvs5PQsvhdGUSp2sAKpOKyZwFTAG09wIZThdvK9uzNVSp4rjP8vhUI88e7qlIhK+/Q B0+8yfnYbZUBQvcm/87JCVr0hAkY3kp6+IgVrcZAWXn0JngQYJ/4HuCwWgqNZdxsuTpC IHbxPUYT7hL6ko9u3pnS1SWMjipGZhsDYV9tcGaEWS8ahGtknxYH1QOtm/J56cH0RoD8 3g6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=V8QtFnyj; 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 eb10si795912ejc.405.2020.12.01.14.38.05; Tue, 01 Dec 2020 14:38:28 -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=V8QtFnyj; 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 S2387884AbgLARPy (ORCPT + 99 others); Tue, 1 Dec 2020 12:15:54 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56138 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726303AbgLARPy (ORCPT ); Tue, 1 Dec 2020 12:15:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606842868; 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=yYhw/vZvk8MrQ/Lit7Nmq+GciopS/YLhUVtcN0QEwlo=; b=V8QtFnyj3KfR94hvAq/lOA8iaxi/f31+FpD4ygzEMwpN53REO39rJddLZS2/wOMZK/bePe ZSCFUfClkcl/L/T87HfiCCaoJJWmcOPJkSYWBqYqejtbTGa0B9UZj/BSDCMX5O3J9S5ZRD EEueWmCBOSNiIMu7LgEmZduLWiO6bBQ= 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-115-idkHgwGTPw6nOt4-Uxp9Uw-1; Tue, 01 Dec 2020 12:14:24 -0500 X-MC-Unique: idkHgwGTPw6nOt4-Uxp9Uw-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 4DE31805BED; Tue, 1 Dec 2020 17:14:23 +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 2AC1019C44; Tue, 1 Dec 2020 17:14:21 +0000 (UTC) Date: Tue, 1 Dec 2020 18:14:20 +0100 From: Miroslav Lichvar To: Jason Gunthorpe Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , John Stultz , Prarit Bhargava Subject: Re: [PATCH] rtc: adapt allowed RTC update error Message-ID: <20201201171420.GN1900232@localhost> References: <20201201143835.2054508-1-mlichvar@redhat.com> <20201201161224.GF5487@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201201161224.GF5487@ziepe.ca> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 01, 2020 at 12:12:24PM -0400, Jason Gunthorpe wrote: > On Tue, Dec 01, 2020 at 03:38:35PM +0100, Miroslav Lichvar wrote: > > + unsigned long time_set_nsec_fuzz; > > + static unsigned int attempt; > > Adding a static value instide a static inline should not be done Well, grepping through the other header files in include/linux, this would not be the first case. > I'm not sure using a static like this is the best idea anyhow, if you > want something like this it should be per-rtc, not global If there are multiple RTCs, are they all updated in this 11-minute sync? > Did you look at why time has become so in-accurate in your system? 5 > jiffies is usually a pretty long time? I found no good explanation. It seems to depend on what system is doing, if it's idle, etc. I suspect it's a property of the workqueues that they cannot generally guarantee the jobs to run exactly on time. I tried switching to the non-power-efficient and high priority workqueues and it didn't seem to make a big difference. -- Miroslav Lichvar