Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp4038891ybd; Tue, 25 Jun 2019 12:56:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqz8j/lKOugnBMpLd0A9nAOTh+mX9EnfZ5lxjkEHhNfKCoDh1GNAU6i6BmlgMusT8gxq3f/o X-Received: by 2002:a63:fb17:: with SMTP id o23mr40313099pgh.362.1561492613635; Tue, 25 Jun 2019 12:56:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561492613; cv=none; d=google.com; s=arc-20160816; b=mQ0EFAWZv9dR/MY8lyrcCwGJP/o6yhjge8LuGhNEivMrK1ahNT6Rd30khJwSsgVVp7 FeuoKwZ2fuPMPoG/RLUEHxO8tuYPpSnjt1h854xN/5VBT1oHhhiwYkmvJ8gWwHU6odJ3 KnWIFOYLvFBOmXw2RY4sqQO5vGStvR92gl+EmBzODTJX/EIXzeVh/zLeWgFn6nn3TUO+ mAeSlZ1yQ8Eu18n+kBKk8sQCrPIyWiqzOkdlonWBBhtjCuuXePpXLYeO5gFZTmnREUVa 6BW2WTR+uim6dn/jfBRKLIi3AluCr+GDBMTqn6ifKSBN3IuEN3p8OlB0iRptL0VmdXri MxVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=yvz7GxqS45ep7Jp2yQHJOYPwvYks5eZ0klQDRU4N1Yc=; b=ttKN7+4ofreZeyGa0UZ++fDp12wgMGUZlz3ZgOtb1pOiOi2efBu5KShno1pC9EHjG/ gLLWPO/f/FHTxjRCoPvhccZbDvLwIPrynTLtVToMJpUjZO9RXEZaILAq4nrgAjJWylYX mOefrG8qREO/XJRjBMayu02WbvrtX+AP6LEy4EibYKki/4MEKmSxG7J8BUZD6GLKwrF9 gBp5lYmsBm6/9NIzUDZKlN+YVYFHUWnU9ivuLOc/I2VYZ6kB7CZosdzaVXWwRjNID9qk gi75WHApIDGd/wKQnrop3WqL0V1ulduvIMIxTJJUMOBM19PXwFf9Mn8ZZszXi6kOU1Oh 9ing== 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 36si13941176pgn.174.2019.06.25.12.56.38; Tue, 25 Jun 2019 12:56:53 -0700 (PDT) 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 S1732965AbfFYS1U (ORCPT + 99 others); Tue, 25 Jun 2019 14:27:20 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:44234 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727138AbfFYS1U (ORCPT ); Tue, 25 Jun 2019 14:27:20 -0400 Received: from p5b06daab.dip0.t-ipconnect.de ([91.6.218.171] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hfq9y-0005oZ-Q8; Tue, 25 Jun 2019 20:27:14 +0200 Date: Tue, 25 Jun 2019 20:27:13 +0200 (CEST) From: Thomas Gleixner To: Vincenzo Frascino cc: linux-arch@vger.kernel.org, LAK , LKML , linux-mips@vger.kernel.org, linux-kselftest@vger.kernel.org, catalin.marinas@arm.com, Will Deacon , Arnd Bergmann , linux@armlinux.org.uk, Ralf Baechle , paul.burton@mips.com, Daniel Lezcano , salyzyn@android.com, pcc@google.com, shuah@kernel.org, 0x7f454c46@gmail.com, linux@rasmusvillemoes.dk, huw@codeweavers.com, sthotton@marvell.com, andre.przywara@arm.com, Andy Lutomirski , Peter Zijlstra Subject: Re: [PATCH 1/3] lib/vdso: Delay mask application in do_hres() In-Reply-To: Message-ID: References: <20190624133607.GI29497@fuggles.cambridge.arm.com> <20190625161804.38713-1-vincenzo.frascino@arm.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 25 Jun 2019, Thomas Gleixner wrote: > On Tue, 25 Jun 2019, Vincenzo Frascino wrote: > > CC+ Andy > > > do_hres() in the vDSO generic library masks the hw counter value > > immediately after reading it. > > > > Postpone the mask application after checking if the syscall fallback is > > enabled, in order to be able to detect a possible fallback for the > > architectures that have masks smaller than ULLONG_MAX. > > Right. This only worked on x86 because the mask is there ULLONG_MAX for all > VDSO capable clocksources, i.e. that ever worked just by chance. > > As we talked about that already yesterday, I tested this on a couple of > machines and as expected the outcome is uarch dependent. Minimal deviations > to both sides and some machines do not show any change at all. I doubt it's > possible to come up with a solution which makes all uarchs go faster > magically. > > Though, thinking about it, we could remove the mask operation completely on > X86. /me runs tests Unsurprisingly the results vary. Two uarchs do not care, but they did not care about moving the mask either. The other two gain performance and the last one falls back to the state before moving the mask. So in general it looks like a worthwhile optimization. Thanks, tglx