From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751288AbdH1SAU (ORCPT ); Mon, 28 Aug 2017 14:00:20 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:49979 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750866AbdH1SAT (ORCPT ); Mon, 28 Aug 2017 14:00:19 -0400 Subject: Re: [PATCH v5 1/2] sched/clock: interface to allow timestamps early in boot To: Thomas Gleixner Cc: x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, peterz@infradead.org, hpa@zytor.com, douly.fnst@cn.fujitsu.com References: <1503520884-99253-1-git-send-email-pasha.tatashin@oracle.com> <1503520884-99253-2-git-send-email-pasha.tatashin@oracle.com> <2d5087a2-2aca-aaba-4608-112facbd3208@oracle.com> From: Pasha Tatashin Message-ID: Date: Mon, 28 Aug 2017 13:59:29 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> void __init timekeeping_init(void) >> { >> /* >> * We must determine boot timestamp before getting current >> * persistent clock value, because implementation of >> * read_boot_clock64() might also call the persistent >> * clock, and a leap second may occur. >> */ >> >> read_boot_clock64(&boot); >> ... >> read_persistent_clock64(&now); > > No. That's the same crap just the other way round. > > s390 can do that, because the boot timestamp is correlated with the > persistent clock. Your's not so much. > OK, how about reading the persistent clock only once, and send it's value to use for calculation of boot stamp to read_boot_clock64() via a new argument: read_boot_clock64(&now, &boot); Does this sound alright or is there a better way? I would need to update read_boot_clock64() everywhere it is declared to add the __init macro, so this extra argument is not going to increase number of line changes. Thank you, Pasha