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=-2.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 39964C2D0D2 for ; Tue, 24 Dec 2019 11:12:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1007220409 for ; Tue, 24 Dec 2019 11:12:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=c-s.fr header.i=@c-s.fr header.b="MvKlVWsI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726261AbfLXLM1 (ORCPT ); Tue, 24 Dec 2019 06:12:27 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:17931 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726183AbfLXLM0 (ORCPT ); Tue, 24 Dec 2019 06:12:26 -0500 Received: from localhost (mailhub1-ext [192.168.12.233]) by localhost (Postfix) with ESMTP id 47htpw3bjjz9tyXM; Tue, 24 Dec 2019 12:12:24 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=MvKlVWsI; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id DhOumcXGkzWb; Tue, 24 Dec 2019 12:12:24 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 47htpw28BKz9tyXL; Tue, 24 Dec 2019 12:12:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1577185944; bh=Bn7IZfCcqw5bT2ttt8/4pM+iuD9f7XixnnqnooPsUO8=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=MvKlVWsI0nhGXz1jiEzJgtsO3vre9b9taOd50nQEl4NtQ8XZ3gLcegD4mGQBWSKK2 TTyqxkgAFFOLrKfmRrtzeuOO6v+SE4+x6E4aUxR22pmu3jsA79yAvhgE5ex0ylbUmL FwCieuRAWn5hiSJ/qG7Zj3Zqlf5cj4c53n1w9sSA= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 6C3B18B783; Tue, 24 Dec 2019 12:12:25 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id ZGl4WaMQ75fX; Tue, 24 Dec 2019 12:12:25 +0100 (CET) Received: from [192.168.232.53] (unknown [192.168.232.53]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 685338B782; Tue, 24 Dec 2019 12:12:24 +0100 (CET) Subject: Re: [RFC PATCH v2 07/10] lib: vdso: don't use READ_ONCE() in __c_kernel_time() To: Andy Lutomirski Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Arnd Bergmann , Thomas Gleixner , Vincenzo Frascino , LKML , linuxppc-dev , linux-arm-kernel , "open list:MIPS" , X86 ML References: From: christophe leroy Message-ID: Date: Tue, 24 Dec 2019 12:12:23 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit X-Antivirus: Avast (VPS 191223-0, 23/12/2019), Outbound message X-Antivirus-Status: Not-Tested Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 24/12/2019 à 02:58, Andy Lutomirski a écrit : > On Mon, Dec 23, 2019 at 6:31 AM Christophe Leroy > wrote: >> >> READ_ONCE() forces the read of the 64 bit value of >> vd[CS_HRES_COARSE].basetime[CLOCK_REALTIME].sec allthough >> only the lower part is needed. > > Seems reasonable and very unlikely to be harmful. That being said, > this function really ought to be considered deprecated -- 32-bit > time_t is insufficient. > > Do you get even better code if you move the read into the if statement? Euh ... How can you return t when time pointer is NULL if you read t only when time pointer is not NULL ? Christophe