Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7084262ybl; Mon, 23 Dec 2019 17:59:29 -0800 (PST) X-Google-Smtp-Source: APXvYqx1KFMvZmw/w4bkPikfqqpqhcWII9GMp0En0mM45HsIZWh+qSz2ZyHnztsXFerMmuPLazaz X-Received: by 2002:a9d:6d10:: with SMTP id o16mr36793361otp.28.1577152769579; Mon, 23 Dec 2019 17:59:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577152769; cv=none; d=google.com; s=arc-20160816; b=iGVgcuJnoWklUylcm1k9MPITQSH69wsZqwaNK8W1+6AIjqhjC6j0Uax3XvWHHymjhZ b7dRMpqz2Mz3weH6oP8KZCWLEhPtQa1J5qCu7aI6omm2bGJlpce258/mxW25Q+vgewA8 XNX53L3ipUx64GHc8178Z2Mek2Pd3c5G7ZKg2hou5WTiFdwL/sNpckcWc08QsP68vwHk ksqthSKmHmeKz7CTTlVimnfddBqI0Z527zDChcQduJlMJJ0dnQp3xBHtYRib9koRLhBW bAzsrVxz2RqtlShYdE0k0BEUrzDwUQW0kWaaINZZDfgObe4SBQNRmbd01kYlZOTucyix Ghkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=MpGc1KEiMTbsE15i/PkUjAwEVUjmj/jtxbMDdiE40m8=; b=KQLIh0vKqZnyuk5063bZeJR6a7wgG9O3wG44h3CTTmTFrBq93Xtjc6AzoCbIddtl7N YGFpzEeNXi3Me5rDFy4yXJGF9qXdF7+n1yWd59m9F94kdStNtujTBNM82XYlnZ+dx/DV OTrYi+FU6VQMaPgcBpmAUEKivJ/VnlFuYgUJSgwinr4d+jK3XWSH8Iu1Qr3BTQWf7N4h 1M47enT3Y/dyjXBCHW2k2Yfxn2rfrhYeDZ0PqI1YvAapvCBEInNW1bjOmWEbmYgSnZEk 46ewU8OUCkzy38/eojr7yMx7bloXusKjTs9R4tkZeqssPeENr5Q/yBAQeoUJCDuMuz4P OXXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oFYra1Gn; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x21si10757813oif.250.2019.12.23.17.59.18; Mon, 23 Dec 2019 17:59:29 -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=@kernel.org header.s=default header.b=oFYra1Gn; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727145AbfLXB6j (ORCPT + 99 others); Mon, 23 Dec 2019 20:58:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:43978 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727005AbfLXB6j (ORCPT ); Mon, 23 Dec 2019 20:58:39 -0500 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 88CAC20CC7 for ; Tue, 24 Dec 2019 01:58:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577152718; bh=wrDzBWpOKSiwcb+qBm67fhEmniMtsPe08K1CDqJG+aQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=oFYra1GnrPYPW0VIb0ihhkc/X1ko+xfQht7/2IKlWIyfO6uNchY0GOmxSOCGWBnY+ oQU08j1ThgwFiIxFVbPwHNZ4a4Bg8WDDE6yE6w4LCePbFzjER6HYQqZgnlhUqcpAns WZQxExfAhEzKuKRq9E0Du+n4NTas+PLc/RJdGJLU= Received: by mail-wm1-f41.google.com with SMTP id 20so1289621wmj.4 for ; Mon, 23 Dec 2019 17:58:38 -0800 (PST) X-Gm-Message-State: APjAAAUByLzJMlpKUwqN2omunnUtwBQ+jcoRUUSYdRL1tYMs91cB2Af2 yr/V8/OJp/vRLwuiJr/3FwyuRn5AV3chaK1ObOej1g== X-Received: by 2002:a7b:cbc9:: with SMTP id n9mr1469926wmi.89.1577152716961; Mon, 23 Dec 2019 17:58:36 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Andy Lutomirski Date: Mon, 23 Dec 2019 17:58:24 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH v2 07/10] lib: vdso: don't use READ_ONCE() in __c_kernel_time() To: Christophe Leroy Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Arnd Bergmann , Thomas Gleixner , Vincenzo Frascino , Andrew Lutomirski , LKML , linuxppc-dev , linux-arm-kernel , "open list:MIPS" , X86 ML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Reviewed-by: Andy Lutomirski --Andy