Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2130731ybc; Wed, 20 Nov 2019 09:20:42 -0800 (PST) X-Google-Smtp-Source: APXvYqyUfYiVUDAto9E8r/zdWHMuX1R4yG/ukltXuFs6iOmzmx1LFEcNWgL3JUwdjeRGx65gqxbe X-Received: by 2002:a17:906:70e:: with SMTP id y14mr6676710ejb.70.1574270442620; Wed, 20 Nov 2019 09:20:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574270442; cv=none; d=google.com; s=arc-20160816; b=EudrVg/kV0R8rrVwMq4SFoBunmuEGhJrnzSmny1T6usDwETRB3biTSuZ2StGjSKTz2 mXf3LQabPv9opwpUV6oBCViihvD4SFVADUuceEgmsgmQRtDSRVjTBjN4vB2fhdFTsUww e35iEv0DOG0u7ICjfJpz/l7w5jPvvYLDgvJc180H3SE2AU62QAF+6tTGM97iMgZzPH7N WFgDpUiC4EmJ9seyuw6Q158EfGEbNUtrrnzbZ8AA3kK7+6wMdk9LFzGc8iVypbiVStq/ d7JoXiWORr2HZdXxXowrc10qrhWuj5l3yRUFLdpFnHo/vNtJ87auds4pDkJQQidqWcCh 3Llw== 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-disposition:mime-version:user-agent:in-reply-to:references :subject:cc:to:from:message-id:date; bh=RkcHYu99e5wct8gM1oV0Kgg9r4Re5dq2fDZWJ+CwFQg=; b=oxD2xt9uxcWMOZBdJdaCA3xThvoTVQSqt5jqrvR9xNCdki/hnOdC6yQhexyalOtrv0 6YWMauz3dMnvEb7SkJ1XKvjXv2aMuMOio5/024e4caI9bKkK4HDrFMBsnXHa/dpxuOwa gQWTFKA15ZOJwFJQOkbybqr1tWYyWhJ347ndGgfKB90Yq89WXPnA5KfpT/g22G5G7rk5 2JLxeRZOzIXrMulH0dzB78xNCOZ9nawqsLDMfWE+FBTyMwAmqypicVw+uHnRayYao05W 19svJy082UJIcYJj/djbit5U/NVVNsBQ/cwAH1PxwIzzYW2oGT8rBN+z53zG/PFZIVsl ps1Q== ARC-Authentication-Results: i=1; mx.google.com; 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 g2si8330977eja.146.2019.11.20.09.20.17; Wed, 20 Nov 2019 09:20:42 -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; 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 S1729347AbfKTPRm convert rfc822-to-8bit (ORCPT + 99 others); Wed, 20 Nov 2019 10:17:42 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:12128 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729006AbfKTPRm (ORCPT ); Wed, 20 Nov 2019 10:17:42 -0500 Received: from localhost (mailhub1-ext [192.168.12.233]) by localhost (Postfix) with ESMTP id 47J5sY6tDmz9v2Xl; Wed, 20 Nov 2019 16:17:37 +0100 (CET) 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 b9WuW4-B4Uio; Wed, 20 Nov 2019 16:17:37 +0100 (CET) Received: from vm-hermes.si.c-s.fr (vm-hermes.si.c-s.fr [192.168.25.253]) by pegase1.c-s.fr (Postfix) with ESMTP id 47J5sY5ysFz9v2Xk; Wed, 20 Nov 2019 16:17:37 +0100 (CET) Received: by vm-hermes.si.c-s.fr (Postfix, from userid 33) id 49EB08D6; Wed, 20 Nov 2019 16:17:41 +0100 (CET) Received: from 37-172-92-181.coucou-networks.fr (37-172-92-181.coucou-networks.fr [37.172.92.181]) by messagerie.si.c-s.fr (Horde Framework) with HTTP; Wed, 20 Nov 2019 16:17:41 +0100 Date: Wed, 20 Nov 2019 16:17:41 +0100 Message-ID: <20191120161741.Horde.zNDnbMKk_BJpkUOkWeRMsQ1@messagerie.si.c-s.fr> From: Christophe Leroy To: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Paul Mackerras , Benjamin Herrenschmidt Subject: Re: [PATCH v3 2/8] powerpc/vdso32: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE References: <4644ccc9b4da78639ae9424db878c48711abf05a.1572342582.git.christophe.leroy@c-s.fr> <87eey2btxi.fsf@mpe.ellerman.id.au> In-Reply-To: <87eey2btxi.fsf@mpe.ellerman.id.au> User-Agent: Internet Messaging Program (IMP) H5 (6.2.3) Content-Type: text/plain; charset=UTF-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Michael Ellerman a écrit : > Christophe Leroy writes: >> This is copied and adapted from commit 5c929885f1bb ("powerpc/vdso64: >> Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE") >> from Santosh Sivaraj >> >> Benchmark from vdsotest-all: >> clock-gettime-realtime: syscall: 3601 nsec/call >> clock-gettime-realtime: libc: 1072 nsec/call >> clock-gettime-realtime: vdso: 931 nsec/call >> clock-gettime-monotonic: syscall: 4034 nsec/call >> clock-gettime-monotonic: libc: 1213 nsec/call >> clock-gettime-monotonic: vdso: 1076 nsec/call >> clock-gettime-realtime-coarse: syscall: 2722 nsec/call >> clock-gettime-realtime-coarse: libc: 805 nsec/call >> clock-gettime-realtime-coarse: vdso: 668 nsec/call >> clock-gettime-monotonic-coarse: syscall: 2949 nsec/call >> clock-gettime-monotonic-coarse: libc: 882 nsec/call >> clock-gettime-monotonic-coarse: vdso: 745 nsec/call >> >> Additional test passed with: >> vdsotest -d 30 clock-gettime-monotonic-coarse verify > > This broke on 64-bit big endian, which uses the 32-bit VDSO, with errors > like: > > clock-gettime-monotonic-coarse/verify: 10 failures/inconsistencies > encountered > timestamp obtained from libc/vDSO not normalized: > [-1574202155, 1061008673] > timestamp obtained from libc/vDSO predates timestamp > previously obtained from kernel: > [74, 261310747] (kernel) > [-1574202155, 1061008673] (vDSO) > timestamp obtained from libc/vDSO not normalized: > [-1574202155, 1061008673] > timestamp obtained from libc/vDSO predates timestamp > previously obtained from kernel: > [74, 261310747] (kernel) > [-1574202155, 1061008673] (vDSO) > timestamp obtained from libc/vDSO not normalized: > [-1574202155, 1061008673] > timestamp obtained from libc/vDSO predates timestamp > previously obtained from kernel: > [74, 261310747] (kernel) > [-1574202155, 1061008673] (vDSO) > timestamp obtained from libc/vDSO not normalized: > [-1574202155, 1061008673] > timestamp obtained from libc/vDSO predates timestamp > previously obtained from kernel: > [74, 261310747] (kernel) > [-1574202155, 1061008673] (vDSO) > timestamp obtained from libc/vDSO not normalized: > [-1574202155, 1061008673] > timestamp obtained from libc/vDSO predates timestamp > previously obtained from kernel: > [74, 261310747] (kernel) > [-1574202155, 1061008673] (vDSO) > Failure threshold (10) reached; stopping test. > > > The diff below seems to fix it, but I'm not sure it's correct. ie. we > just ignore the top part of the values, how does that work? Your change makes sense, it is consistent with other functions using STAMP_XTIME. It works because nanoseconds are max 999999999, it fits 32 bits regs. Christophe