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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 0219AC31E4B for ; Fri, 14 Jun 2019 14:13:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D2BA821537 for ; Fri, 14 Jun 2019 14:13:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728585AbfFNONy (ORCPT ); Fri, 14 Jun 2019 10:13:54 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:38272 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727698AbfFNONy (ORCPT ); Fri, 14 Jun 2019 10:13:54 -0400 Received: from [5.158.153.52] (helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hbmxQ-0007Cp-4N; Fri, 14 Jun 2019 16:13:32 +0200 Date: Fri, 14 Jun 2019 16:13:31 +0200 (CEST) From: Thomas Gleixner To: Dmitry Safonov cc: linux-kernel@vger.kernel.org, Andrei Vagin , Adrian Reber , Andrei Vagin , Andy Lutomirski , Arnd Bergmann , Christian Brauner , Cyrill Gorcunov , Dmitry Safonov <0x7f454c46@gmail.com>, "Eric W. Biederman" , "H. Peter Anvin" , Ingo Molnar , Jann Horn , Jeff Dike , Oleg Nesterov , Pavel Emelyanov , Shuah Khan , Vincenzo Frascino , containers@lists.linux-foundation.org, criu@openvz.org, linux-api@vger.kernel.org, x86@kernel.org Subject: Re: [PATCHv4 26/28] x86/vdso: Align VDSO functions by CPU L1 cache line In-Reply-To: <20190612192628.23797-27-dima@arista.com> Message-ID: References: <20190612192628.23797-1-dima@arista.com> <20190612192628.23797-27-dima@arista.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 12 Jun 2019, Dmitry Safonov wrote: > From: Andrei Vagin > > After performance testing VDSO patches a noticeable 20% regression was > found on gettime_perf selftest with a cold cache. > As it turns to be, before time namespaces introduction, VDSO functions > were quite aligned to cache lines, but adding a new code to adjust > timens offset inside namespace created a small shift and vdso functions > become unaligned on cache lines. > > Add align to vdso functions with gcc option to fix performance drop. > > Coping the resulting numbers from cover letter: > > Hot CPU cache (more gettime_perf.c cycles - the better): > | before | CONFIG_TIME_NS=n | host | inside timens > --------|------------|------------------|-------------|------------- > cycles | 139887013 | 139453003 | 139899785 | 128792458 > diff (%)| 100 | 99.7 | 100 | 92 Why is CONFIG_TIME_NS=n behaving worse than current mainline and worse than 'host' mode? > Cold cache (lesser tsc per gettime_perf_cold.c cycle - the better): > | before | CONFIG_TIME_NS=n | host | inside timens > --------|------------|------------------|-------------|------------- > tsc | 6748 | 6718 | 6862 | 12682 > diff (%)| 100 | 99.6 | 101.7 | 188 Weird, now CONFIG_TIME_NS=n is better than current mainline and 'host' mode drops. Either I'm misreading the numbers or missing something or I'm just confused as usual :) Thanks, tglx