Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7470401ybl; Tue, 24 Dec 2019 03:13:24 -0800 (PST) X-Google-Smtp-Source: APXvYqwy9jUSr/n8MaAWnSRYrroFUdoDnAFqnIo4r52LPm/9BiLN4ez5VAmWdn+GxfwXXjA5KMap X-Received: by 2002:a05:6830:1112:: with SMTP id w18mr31651395otq.356.1577186004347; Tue, 24 Dec 2019 03:13:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577186004; cv=none; d=google.com; s=arc-20160816; b=ZKQWYaQk2IDsnZPxewCNZpXTTxPf+3Ak8gyyh82v+5AgKox8nnHgjcjP3AvQWrdyJX 2xK04ffrCCuGknqKFrI87xLdYfNDT2u032qSCOgjigfVIdCiiGfuGxbTkE3p/6AHfL24 qhmNWbyJ2GJpcALtpP7W9ldgT191uI/2GaPV56IuicxE/dgp+yYbykc6tx/5lj5qj6Tp ho3ZJ8BWc7Jgis/HCrpCGlxQALJNvUHAxfiXI0SFYyqtWYM7wltkC8akTgc811rbCt63 PJfRwooZ40O8hQn6k/Q97Tc3pBItKKn/6eWxspKSO1G5w4mcPomUMvMjcFPA4U1uiC+y mpzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=Bn7IZfCcqw5bT2ttt8/4pM+iuD9f7XixnnqnooPsUO8=; b=VZwCba07UCliCyrUp+FAjmNA8IWLD7jz3x5R1up7CDO5JlUDk4jQ67f2SaKgOPvmw/ MxaQrXdbhjjB4HGeXWtYpF9KyHu79m/PrwZR/j4LzSfj4irH90u3y6r7+Fo+ovc8BKJ0 BLCAoR8soHlTBMB+Rpm1rdZ75TeHcoI3CL8/zz40Cn2OBh+ZZB80EMggCbHl04jVTSKF V2HRM+RaNVbvbffGhMn0n9CI7mDzrWzzvTlTolM4ty38srnYoeB/2q+sYuh0RFCExTgz 9W30bdlgFlsqJLipyNlK1Qx7yTsWomnQ9vBa5RQ2SaSr+eASBedpDHamXAQwwWcbaejT m1/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=MvKlVWsI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r1si11400115otn.150.2019.12.24.03.13.13; Tue, 24 Dec 2019 03:13:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=MvKlVWsI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726225AbfLXLM1 (ORCPT + 99 others); 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