Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp857922imm; Fri, 14 Sep 2018 07:23:39 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZQ73wdRALf7A91kVaNgyT3qx6nHlUvttPxDjwQgNgBMsUxTdYVSMdcYHzvVYbb/J6gbR6m X-Received: by 2002:a62:455b:: with SMTP id s88-v6mr12678803pfa.203.1536935019914; Fri, 14 Sep 2018 07:23:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536935019; cv=none; d=google.com; s=arc-20160816; b=N9RXral6j5BbTErGLHkZQzlM6rMwQVelRSr0jDjCWarl0d8MPZGAkisinknCVgS9tX 0TE/vFG6eYUuGgtEsT3oMJrvySi3D8uGxgwiF4Lj3qW1LWrdAJcnMJZ66+6SbwRdM/YR I0KzF0b1DS3oo2anv6ZhYOwPFgK0qGfpdo4B27HSueEYE7zW2kmqcTff3jMbWM8Re3UH y0stwRp2tKp/iQdYgQ0q0Oa7cWnC+TMZh4gLPiPnULAIchMEZnwmQIzgn5xAs6XYpp9O OrjsLK1e13Ho3fsKjnM6Ova8zQkPbhzl9gE84MwBqNDxtq8gmWX6xD6CaLfAaz8d8AVb klmQ== 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; bh=nPXqZUU1Vr4gyWfW+42/MalTHVGF0SThCedXo0TEHmo=; b=zWNhBA9lQYzWeDySzdjyq1gUK7Ve+dBrqsimA287Eh8SnBj7o3vyC1HKjkHkGCDULB 4oTq94L1NUvkOF/VfBY4TU/4dUUG1ca1i2AMHLbufzUNLa0vDYCaLPXEicpzjuvqYyBb rtWmutEa3BHrM0gOr0HrToklMDtXV+tpFUnVnRNmlQR/5SS+2p15bpYVawPUr734nvXr AH6Xem0MofEVD0QEteyPStaC2qNDGmpejPV5lQ2cCfEGMQm2+UiXAbjhXsOnYoumGWAY LZddMZShqtIzbNk9jrzNuZU63oItuJfjW0zxgM1W0KP9IBPZ+oSH52twRaWg3k9vLt6y hepQ== 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 j124-v6si7152841pfg.157.2018.09.14.07.23.15; Fri, 14 Sep 2018 07:23:39 -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 S1727818AbeINThq (ORCPT + 99 others); Fri, 14 Sep 2018 15:37:46 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:42511 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726925AbeINThp (ORCPT ); Fri, 14 Sep 2018 15:37:45 -0400 Received: by mail-qt0-f194.google.com with SMTP id z8-v6so8844863qto.9 for ; Fri, 14 Sep 2018 07:23:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nPXqZUU1Vr4gyWfW+42/MalTHVGF0SThCedXo0TEHmo=; b=iE1/M3MJeNDJQtXCKTfyTDjw6ZHgAogU4r5NuqczkQMDl1WmHV+1U+6MtAvkjDJRj2 5OyiQ2bCyU5elqEgULjr1HR4rqGe196Wth5JqBd0TEQeXS9XUrBGOSv8H3t4Ox//fCbd 2eUjBHpI4MxPYMJsWVb3JBY1eHC6e1FIeyeTbZ+S72JQQG/X5038HMCyJIpYcU8Cziqy P2CZLd4vnlg++EDlPvDGqfz5gwu9X22BxvCWF+TiNc5zAMiD+LOiAXR8Bp8rG2qyUExI 72lKvlhCeyVifT8irvzMkAV65cpwdq94/Qpshoty6XbuVLEBnnd0ESkM9wtjFRfsn98k SPyQ== X-Gm-Message-State: APzg51De1xdhkMPj/65sWr8nBN4dAMKfv3P3qwhGoaDmwDQ7gFp3cxqL fuUitvs+uYqkfc1+4UQZfuJUOCq85KYIMiBhNXo= X-Received: by 2002:a0c:a8cc:: with SMTP id h12-v6mr9343475qvc.161.1536934981161; Fri, 14 Sep 2018 07:23:01 -0700 (PDT) MIME-Version: 1.0 References: <20180914125006.349747096@linutronix.de> In-Reply-To: <20180914125006.349747096@linutronix.de> From: Arnd Bergmann Date: Fri, 14 Sep 2018 16:22:44 +0200 Message-ID: Subject: Re: [patch 00/11] x86/vdso: Cleanups, simmplifications and CLOCK_TAI support To: Thomas Gleixner Cc: Linux Kernel Mailing List , Andy Lutomirski , "the arch/x86 maintainers" , Peter Zijlstra , matt@softrans.com.au, Stephen Boyd , John Stultz , Florian Weimer , "K. Y. Srinivasan" , vkuznets@redhat.com, devel@linuxdriverproject.org, virtualization@lists.linux-foundation.org, Paolo Bonzini , Juergen Gross , Deepa Dinamani 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 Fri, Sep 14, 2018 at 2:52 PM Thomas Gleixner wrote: > > 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. No objections from my side, just a few general remarks: Deepa and I have discussed the vdso in the past for 2038. I have started a patch that I'll have to redo on top of yours, but that is fine, your cleanup is only going to help here. More generally speaking, Deepa said that she would like to see some generalization on the vdso before adding the time64_t based variants. Your series probably makes x86 diverge more from the others, which makes it harder to consolidate them again, but we might just as well use your new implementation to base the generic one on, and just move the other ones over to that. A couple of architectures (s390, ia64, riscv, powerpc, arm64) implement the vdso as assembler code at the moment, so they won't be as easy to consolidate (other than outright replacing all the code). The other five: arch/x86/entry/vdso/vclock_gettime.c arch/sparc/vdso/vclock_gettime.c arch/nds32/kernel/vdso/gettimeofday.c arch/mips/vdso/gettimeofday.c arch/arm/vdso/vgettimeofday.c are basically all minor variations of the same code base and could be consolidated to some degree. Any suggestions here? Should we plan to do that consolitdation based on your new version, or just add clock_gettime64 in arm32 and x86-32, and then be done with it? The other ones will obviously still be fast for 32-bit time_t and will have a working non-vdso sys_clock_getttime64(). I also wonder about clock_getres(): half the architectures seem to implement it in vdso, but notably arm32 and x86 don't, and I had not expected it to be performance critical given that the result is easily cached in user space. Arnd