Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5330096ybi; Tue, 4 Jun 2019 05:09:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJ/7H/Ufm15iR8lN5cj0kpQPGfTrLlr+GI1FwLPy1NLASqbko20KT9j+mphSrd/aKeFmV5 X-Received: by 2002:a17:90b:d8b:: with SMTP id bg11mr4747763pjb.30.1559650156373; Tue, 04 Jun 2019 05:09:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559650156; cv=none; d=google.com; s=arc-20160816; b=ZfNzIXaIENXV1qAuMfNhiTD42ItgePdWUv0N3k5FehAtxDwRIACg40H2C7Y+voYqhI 1R1FOcQKhOEi7F1WfdY4i6+CnAvLQ/GHWupCT2gZoGu2rbW5e7qr7X8jA0XpqfWDdQL2 iIcj42BP9u8XQ9j3em+uwc/1OZqCMa1Fs0OOp9dvO+OklW2/7WcJQ/yiYuavm4R2Nn7r NziihlAGyWuAdsUkBA9S358i+6roR6n8wR3U747r1c4RZNzMmFOEzh1b9MsW+sEkzN19 XgkjBO72ZBXMWvtHiPaxeiwuKRIzUr/eniYnCHF0/rwe02B533lbrUCYva5F2A9nLwrg n+9g== 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-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=c6VGPZ9FmtHVEnhPzyhx13BKiUI/MeU/aHcgrLg/F0A=; b=ERTPebKDj2PhxiH4SMjffOYPzamIZxU9xcrdhBULZoH3b+2w5rewatd1vfVX2ed2S8 RPY/EOaWyzuk6xBwOeKYu+wF3t4lfHizjdzCop3JvhoqA68RRXpgADNngj+2VdZ67nb7 NLnr8nPeIuyc5kd9l7oTQ4csQLE+rGDtMvES1EawqFy77X1ZkmqS/aFbwAZbUNkqJ8MS zMAEOEnsgSPVpRW3GPSMxLVwrep2c/PNp+NIeobM8TZg+rHMNGFNtF3OnD4d1Ag700HG tidizj6rg6qX9RNbSPvLMlAwYOD0PVWa6sS9CR140WojH2o50nMKfeFnqXrk+bnzlQqy Zcvw== 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 r2si3772785pfh.85.2019.06.04.05.08.58; Tue, 04 Jun 2019 05:09:16 -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 S1727659AbfFDMFE (ORCPT + 99 others); Tue, 4 Jun 2019 08:05:04 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:41426 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727250AbfFDMFD (ORCPT ); Tue, 4 Jun 2019 08:05:03 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2AF3280D; Tue, 4 Jun 2019 05:05:03 -0700 (PDT) Received: from [10.1.196.72] (e119884-lin.cambridge.arm.com [10.1.196.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 348353F690; Tue, 4 Jun 2019 05:05:00 -0700 (PDT) Subject: Re: [PATCH v6 00/19] Unify vDSOs across more architectures To: Arnd Bergmann Cc: linux-arch , Linux ARM , Linux Kernel Mailing List , linux-mips@vger.kernel.org, "open list:KERNEL SELFTEST FRAMEWORK" , Catalin Marinas , Will Deacon , Russell King , Ralf Baechle , Paul Burton , Daniel Lezcano , Thomas Gleixner , Mark Salyzyn , Peter Collingbourne , Shuah Khan , Dmitry Safonov <0x7f454c46@gmail.com>, Rasmus Villemoes , Huw Davies References: <20190530141531.43462-1-vincenzo.frascino@arm.com> From: Vincenzo Frascino Message-ID: Date: Tue, 4 Jun 2019 13:04:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, thank you for your review. On 31/05/2019 09:46, Arnd Bergmann wrote: > On Thu, May 30, 2019 at 4:15 PM Vincenzo Frascino > wrote: >> >> vDSO (virtual dynamic shared object) is a mechanism that the Linux >> kernel provides as an alternative to system calls to reduce where >> possible the costs in terms of cycles. >> This is possible because certain syscalls like gettimeofday() do >> not write any data and return one or more values that are stored >> in the kernel, which makes relatively safe calling them directly >> as a library function. > > Hi Vincento, > > I've very happy with how this turned out overall, and as far as I can > tell you have addressed all my previous comments. I had another > look through the series and only noticed a few very minor issues. > Thanks! I agree with what you pointed out in the single patches, I will wait for Thomas to review them as well and then will address all the comments in v7. ... > > One open question I touched in my review is whether we want to > have a vdso version of clock_getres() in all architectures or not. > I'd prefer to leave it out because there is very little advantage to > it over the system call (the results don't change at runtime and > can easily be cached by libc if performance ever matters), and > it takes up a small amount of memory for the implementation. > I thought about it and I ended up with what proposed in this patchset mainly for symmetry across all the architectures since in the end they use the same common code. It seems also that there is some performance impact (i.e.): clock-getres-monotonic: libc(system call): 296 nsec/call clock-getres-monotonic: libc(vdso): 5 nsec/call I agree with you though when you say that caching it in the libc is a possibility to overcome the performance impact. > We shouldn't just need it for consistency because all callers > would require implementing a fallback to the system call > anyway, to deal with old kernels. > A way to address this issue would be to use versioning, which seems supported in the vdso library (i.e. arch/x86/entry/vdso/vdso32/vdso32.lds.S). For example for x86 (vdso32) we would have something like: VERSION { LINUX_5.3 (being optimistic here :) ) { global: __vdso_clock_getres; __vdso_clock_gettime64; }; LINUX_2.6 { global: __vdso_clock_gettime; __vdso_gettimeofday; __vdso_time; }; LINUX_2.5 { global: __kernel_vsyscall; __kernel_sigreturn; __kernel_rt_sigreturn; local: *; }; } What do you think? Would this be a viable solution? > If anyone comes up with a good reason why it should be added > after all, let me know and I'll stop mentioning it. > > Arnd > -- Regards, Vincenzo