Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6101519ybl; Tue, 14 Jan 2020 21:55:36 -0800 (PST) X-Google-Smtp-Source: APXvYqyKpP6MTDIlTMkbZ/uhHE6k/nf+FR0K3y9aEBTfW6nDMclvFXa445Hl2uwLfgfa1RX4dfQ7 X-Received: by 2002:a05:6830:1185:: with SMTP id u5mr1510988otq.147.1579067736474; Tue, 14 Jan 2020 21:55:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579067736; cv=none; d=google.com; s=arc-20160816; b=hw2YXI9f79mrokCvgLGFQ75AXlH/Y753w43CvWTnybcA7nuicOYK4WGLIFWEmNgJ0f EttN2SgC+XFV/1rqPiVxcY83vCO4fQu40VsfKiIkX6oCNr4jHVKkZ56HXmlbuuOvXk6y GAQKwBLHoiMixf2u8DyDPfa35m4q2GykzJIry2RE8c2y70OdQJqlYUyuenX0dFCKTeNm hxMthTn2zgihy9FYBwe48zNC2CYvY5mwgiB96qEFvV6I6RnclfcwTUpnlGWB/uMDDd60 ngo0bShQzmymZ8W6YiTUGi546b/e8CS6MqKsrWNr7zkjM7jmalUtUQ8Sh9ergknN58Oh 60Dg== 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:dkim-signature; bh=wbSdI9HItOrxYVyTAN11WYXVXCt/akBxl4BYEVnadHA=; b=jhlPc3xlUdnSbDTgaxv0uixHHUX4vIhXgbYFqjcqfPw3qEEHxhwldgu80+POjYykGC Efh3XeT8IlUcr3JIYKDvRGPlRzxAh4j27Zp/eBrF7eb/Rf7O4HG2cTXEgu1Pu0Z7RG6S IO9jiAn3vLc5crXRh9j9Z+n575HH65/cHeQO3NLeNF9uIa0yZxGgp15SQNYSYGKeMwX5 eAtiq76/VK6iG2rmAiRstBCkzgY4dnnBFeA5aj2OPzi5cnLHwUsPAb/KScauPS5RHApH xe8U1EBZuoarS5OwTZtrlPdSPzmp9B/EgBJLmAndFvhY05a+y9KH1aYBZ1F78kZjwII6 0YVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=eJDgCUne; 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 o13si10417279otp.27.2020.01.14.21.55.24; Tue, 14 Jan 2020 21:55:36 -0800 (PST) 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; dkim=pass header.i=@c-s.fr header.s=mail header.b=eJDgCUne; 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 S1726408AbgAOFy2 (ORCPT + 99 others); Wed, 15 Jan 2020 00:54:28 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:37566 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725962AbgAOFy1 (ORCPT ); Wed, 15 Jan 2020 00:54:27 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 47yGjs0BBsz9vJB3; Wed, 15 Jan 2020 06:54:25 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=eJDgCUne; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id kPi0Z_OddoC8; Wed, 15 Jan 2020 06:54:24 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 47yGjr61ldz9vJB2; Wed, 15 Jan 2020 06:54:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1579067664; bh=wbSdI9HItOrxYVyTAN11WYXVXCt/akBxl4BYEVnadHA=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=eJDgCUne5jXjWmp5hzOZIoLnjINbHoblYv6LNNQhoBlLfP4B8bSXIHCVN1u6wH7Ke akuDZ+Uf1rWyYuA3M8/PcmMK3by6mM90WBA0ZizDasL9QuCUH6luda29vIIizcbzCV wJf2Yc+2q5Y2vdqfOC3mogBl5OCxRXrw+TAWh0ZU= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 991358B77E; Wed, 15 Jan 2020 06:54:25 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id Ky73qmDsAd-G; Wed, 15 Jan 2020 06:54:25 +0100 (CET) Received: from [172.25.230.100] (po15451.idsi0.si.c-s.fr [172.25.230.100]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 58BCF8B774; Wed, 15 Jan 2020 06:54:25 +0100 (CET) Subject: Re: [patch 14/15] lib/vdso: Avoid highres update if clocksource is not VDSO capable To: Thomas Gleixner , LKML Cc: x86@kernel.org, John Stultz , Vincenzo Frascino , Andy Lutomirski , Paolo Bonzini , Boris Ostrovsky , Juergen Gross , Haiyang Zhang , Sasha Levin , Ralf Baechle , Paul Burton , James Hogan , Russell King , Catalin Marinas , Will Deacon , Mark Rutland , Marc Zyngier References: <20200114185237.273005683@linutronix.de> <20200114185947.996078385@linutronix.de> From: Christophe Leroy Message-ID: <665c43c3-7f53-90d1-ac43-2fb7691d6b12@c-s.fr> Date: Wed, 15 Jan 2020 06:54:25 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <20200114185947.996078385@linutronix.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 14/01/2020 à 19:52, Thomas Gleixner a écrit : > If the current clocksource is not VDSO capable there is no point in > updating the high resolution parts of the VDSO data. > > Replace the architecture specific check with a check for a VDSO capable > clocksource and skip the update if there is none. > > Signed-off-by: Thomas Gleixner > --- > arch/arm/include/asm/vdso/vsyscall.h | 7 ------- > include/asm-generic/vdso/vsyscall.h | 7 ------- > kernel/time/vsyscall.c | 14 +++++++------- > 3 files changed, 7 insertions(+), 21 deletions(-) > > --- a/arch/arm/include/asm/vdso/vsyscall.h > +++ b/arch/arm/include/asm/vdso/vsyscall.h > @@ -22,13 +22,6 @@ struct vdso_data *__arm_get_k_vdso_data( > #define __arch_get_k_vdso_data __arm_get_k_vdso_data > > static __always_inline > -bool __arm_update_vdso_data(void) > -{ > - return cntvct_ok; > -} > -#define __arch_update_vdso_data __arm_update_vdso_data > - > -static __always_inline > void __arm_sync_vdso_data(struct vdso_data *vdata) > { > flush_dcache_page(virt_to_page(vdata)); > --- a/include/asm-generic/vdso/vsyscall.h > +++ b/include/asm-generic/vdso/vsyscall.h > @@ -11,13 +11,6 @@ static __always_inline struct vdso_data > } > #endif /* __arch_get_k_vdso_data */ > > -#ifndef __arch_update_vdso_data > -static __always_inline bool __arch_update_vdso_data(void) > -{ > - return true; > -} > -#endif /* __arch_update_vdso_data */ > - > #ifndef __arch_update_vsyscall > static __always_inline void __arch_update_vsyscall(struct vdso_data *vdata, > struct timekeeper *tk) > --- a/kernel/time/vsyscall.c > +++ b/kernel/time/vsyscall.c > @@ -71,15 +71,15 @@ void update_vsyscall(struct timekeeper * > { > struct vdso_data *vdata = __arch_get_k_vdso_data(); > struct vdso_timestamp *vdso_ts; > + s32 clock_mode; > u64 nsec; > - s32 mode; Can we name is clock_mode in patch 9 instead of changing name here ? Christophe > > /* copy vsyscall data */ > vdso_write_begin(vdata); > > - mode = tk->tkr_mono.clock->vdso_clock_mode; > - vdata[CS_HRES_COARSE].clock_mode = mode; > - vdata[CS_RAW].clock_mode = mode; > + clock_mode = tk->tkr_mono.clock->vdso_clock_mode; > + vdata[CS_HRES_COARSE].clock_mode = clock_mode; > + vdata[CS_RAW].clock_mode = clock_mode; > > /* CLOCK_REALTIME also required for time() */ > vdso_ts = &vdata[CS_HRES_COARSE].basetime[CLOCK_REALTIME]; > @@ -105,10 +105,10 @@ void update_vsyscall(struct timekeeper * > WRITE_ONCE(vdata[CS_HRES_COARSE].hrtimer_res, hrtimer_resolution); > > /* > - * Architectures can opt out of updating the high resolution part > - * of the VDSO. > + * If the current clocksource is not VDSO capable, then spare the > + * update of the high reolution parts. > */ > - if (__arch_update_vdso_data()) > + if (clock_mode != VDSO_CLOCKMODE_NONE) > update_vdso_data(vdata, tk); > > __arch_update_vsyscall(vdata, tk); >