Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp749012imm; Fri, 14 Sep 2018 05:53:59 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYDLFIruoYa6LHzXfIQIELO6Hq2m55WeYz4t6x08biczSh1qc7h4uYBenRe6B4/jiECP5P3 X-Received: by 2002:a17:902:be08:: with SMTP id r8-v6mr12243021pls.265.1536929639379; Fri, 14 Sep 2018 05:53:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536929639; cv=none; d=google.com; s=arc-20160816; b=CGvEcfXgug+v7g8473X60mHnj9RRSwuMOXAMAeAsc6s7PBSP48GkWZZi9GYgj1vtLi 4iUAt690GFXtg0ub/SYDhaYShnwVZjCUrjdOaTVv/Dc+TrwJwHsmFusn5MXMXviXh2GT BOGlxdHXhUr9itxC1coIZxpBebtDS3CDV3z+93vqZKOZRTiH1SXMHUPKmYHkJKQm/GWj WRddq11xR5ZdKGcLUtG9bLFPDcGxngsoqcOSBZiSEBL4JPex/9Je/ScRaR/nVIX6Q1DZ V5ygFLE4+KKFksXzaI5iG/Dd8ZD009U9m4ZDA8vs6JzdwnhUCwwtUH8rsYVU1mDiH95T CPTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:cc:to:from:date:user-agent :message-id; bh=vAfxtLq02aHdOlnRYvlR0PCad1GXTh0b9T+CQVWbjQU=; b=fb/J6J50MWZY1s8jOFAX4k08HoRNzH7hJXAdJSawtqhYB/7+RPb/kVB6xIEnYNLYLT VSKSsho/sGo6QZg23sna7YmaxA4a4r2qHZbly+GciVrGIwcJNCBCcxJ811niBLEVGINK qC1x5KlrhHM4TNgGj3stP8HTR/7Hn5wdgKE/MT2dXzlPn1Wx8/F+mF0vD6ropi1Z1nkW wDlmp7mkLAmQalpJs+I90V2zju0NtQ15LA/1KN8XxnfLgNN3afI7fT6MTa6fPOPpLrCg tnY5jZw+Or2EvadNEs8IKab3jnErmTAXFWz+DmaRIZfOGO8JNzo6u1K/PFaF2fYC2+z6 GNWg== 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 g7-v6si6590708plq.163.2018.09.14.05.53.44; Fri, 14 Sep 2018 05:53:59 -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 S1728185AbeINSGU (ORCPT + 99 others); Fri, 14 Sep 2018 14:06:20 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:49572 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728089AbeINSGU (ORCPT ); Fri, 14 Sep 2018 14:06:20 -0400 Received: from localhost ([127.0.0.1] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1g0nZk-0005vn-BM; Fri, 14 Sep 2018 14:51:56 +0200 Message-Id: <20180914125006.349747096@linutronix.de> User-Agent: quilt/0.65 Date: Fri, 14 Sep 2018 14:50:06 +0200 From: Thomas Gleixner To: LKML Cc: Andy Lutomirski , x86@kernel.org, Peter Zijlstra , Matt Rickard , Stephen Boyd , John Stultz , Florian Weimer , "K. Y. Srinivasan" , Vitaly Kuznetsov , devel@linuxdriverproject.org, virtualization@lists.linux-foundation.org, Paolo Bonzini , Arnd Bergmann , Juergen Gross Subject: [patch 00/11] x86/vdso: Cleanups, simmplifications and CLOCK_TAI support Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Matt attempted to add CLOCK_TAI support to the VDSO clock_gettime() implementation, which extended the clockid switch case and added yet another slightly different copy of the same code. Especially the extended switch case is problematic as the compiler tends to generate a jump table which then requires to use retpolines. If jump tables are disabled it adds yet another conditional to the existing maze. This series takes a different approach by consolidating the almost identical functions into one implementation for high resolution clocks and one for the coarse grained clock ids by storing the base data for each clock id in an array which is indexed by the clock id. This completely eliminates the switch case and allows further simplifications of the code base, which at the end all together gain a few cycles performance or at least stay on par with todays code. The resulting performance depends heavily on the micro architecture and the compiler. Thanks, tglx 8<------------------- arch/x86/Kconfig | 1 arch/x86/entry/vdso/vclock_gettime.c | 199 ++++++++------------------------ arch/x86/entry/vsyscall/vsyscall_gtod.c | 55 ++++---- arch/x86/include/asm/vgtod.h | 46 ++++--- arch/x86/kernel/time.c | 22 +++ include/linux/clocksource.h | 5 kernel/time/Kconfig | 4 kernel/time/clocksource.c | 2 8 files changed, 144 insertions(+), 190 deletions(-)