Received: by 10.213.65.68 with SMTP id h4csp1025839imn; Wed, 14 Mar 2018 07:28:46 -0700 (PDT) X-Google-Smtp-Source: AG47ELv91EV2i2BnC83jpJMDmDrwRr0Def+HDFsP6rrvWqzrHJcRCInIj+fH9E28+wBacaBqgPAw X-Received: by 2002:a17:902:2f:: with SMTP id 44-v6mr4317146pla.187.1521037726893; Wed, 14 Mar 2018 07:28:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521037726; cv=none; d=google.com; s=arc-20160816; b=m8wamjhXXBv6rso0Ue92qreOPCd1fi1Nb6dQ0bngdCTDsRcPZ5GYUIioiJEPEU6kDC lyxEh+ecyOK0r3Eoj5KXDTYfVwtBLxfItmEPb2kpkQno3I2kj33NVpBXbtI2BnN3kG2e Ee2kx0d5XDs/UxwJg8B1CVUEMZSPTvzTRKhB4Moz35mngPuwfdfm5JRXrvhbAy5GovjA m+Dh1vGWAmUkjkZyV6fE/fAQ/WwtU3xISgoY3AFPJU8bz6EO+9FrL3e+facKTD8abiaM Z9kT0/xc/Lq3wyxMyUn4bpEYwvf14zaZZ9sZp5zhwN+/umLjJMrtAcDYErN6SPRFXpln k3DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=6aH3pcf5ycsDVHoD8kkT7ZiLNwI6C869elObfrytECI=; b=kBMGWnSuFE0ozYKiBZOX3tsFoTeptBS1VZOKsuJ3lF/Zyy94DcH0KJE+eEjt4QH+zs yQGMqvd8uNFF90uAkLZ9EFNZf+17S2gMEJqUI1DT1MABRTBSYvErfmmTWYk/maJvUBd5 lwdkLpEQmrH6Gn68PpBzbpAoKYVAKNmBUf+y+pSFXYEOCDLcwZ8xbX+kdT+/mLcoJ5cQ 9pWROO7D5KOyzBCbWQF4uzM4JoK0Sr7sznzx9NUe4T7FZaK26p3Qtuk3Iok/X6CrEJob ZZvwV1uBH6U5S/A5/fwbeuDPG4UVSqT6ETipkA5H4F/63MEuGOCgcjnS37U/GmAgEZWT DOWw== 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 g88si2178318pfk.65.2018.03.14.07.28.29; Wed, 14 Mar 2018 07:28:46 -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 S1751402AbeCNO1b (ORCPT + 99 others); Wed, 14 Mar 2018 10:27:31 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:51396 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750779AbeCNO1a (ORCPT ); Wed, 14 Mar 2018 10:27:30 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([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 1ew7NH-00039q-Hv; Wed, 14 Mar 2018 15:27:27 +0100 Date: Wed, 14 Mar 2018 15:27:27 +0100 (CET) From: Thomas Gleixner To: jason.vas.dias@gmail.com cc: linux-kernel@vger.kernel.org, x86@kernel.org, mingo@kernel.org, peterz@infradead.org, andi@firstfloor.org Subject: Re: [PATCH v4.16-rc5 1/3] x86/vdso: on Intel, VDSO should handle CLOCK_MONOTONIC_RAW In-Reply-To: <1521001222-10712-2-git-send-email-jason.vas.dias@gmail.com> Message-ID: References: <1521001222-10712-1-git-send-email-jason.vas.dias@gmail.com> <1521001222-10712-2-git-send-email-jason.vas.dias@gmail.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 Jason, On Wed, 14 Mar 2018, jason.vas.dias@gmail.com wrote: this subject line is not really what it should be. [PATCH v4.16-rc5 1/3] x86/vdso: on Intel, VDSO should handle CLOCK_MONOTONIC_RAW Documentation clearly says: The canonical patch subject line is:: Subject: [PATCH 001/123] subsystem: summary phrase The ``summary phrase`` in the email's Subject should concisely describe the patch which that email contains. The ``summary phrase`` should not be a filename. Do not use the same ``summary phrase`` for every patch in a whole patch series (where a ``patch series`` is an ordered sequence of multiple, related patches). Aside of that the text body of the patch lacks: 1) A description of the patch 2) Your Signed-off-by. Again: checkpatch.pl complains for a reason. Is it really that hard to comply with the established and documented proceedures? > diff --git a/arch/x86/entry/vdso/vclock_gettime.c b/arch/x86/entry/vdso/vclock_gettime.c > index f19856d..fbc7371 100644 > --- a/arch/x86/entry/vdso/vclock_gettime.c > +++ b/arch/x86/entry/vdso/vclock_gettime.c > @@ -182,6 +182,18 @@ notrace static u64 vread_tsc(void) > return last; > } > > +notrace static u64 vread_tsc_raw(void) > +{ > + u64 tsc > + , last = gtod->raw_cycle_last; This is hardly kernel coding style. > + > + tsc = rdtsc_ordered(); and these spaces are pointless. > + if (likely(tsc >= last)) > + return tsc; > + asm volatile (""); > + return last; > +} As I explained to you before: This function is not required because gtod->cycle_last and gtod->raw_cycle_last are the same value. > notrace static inline u64 vgetsns(int *mode) > { > u64 v; > @@ -203,6 +215,27 @@ notrace static inline u64 vgetsns(int *mode) > return v * gtod->mult; > } > > +notrace static inline u64 vgetsns_raw(int *mode) > +{ > + u64 v; > + cycles_t cycles; > + > + if (gtod->vclock_mode == VCLOCK_TSC) > + cycles = vread_tsc_raw(); > +#ifdef CONFIG_PARAVIRT_CLOCK > + else if (gtod->vclock_mode == VCLOCK_PVCLOCK) > + cycles = vread_pvclock(mode); > +#endif > +#ifdef CONFIG_HYPERV_TSCPAGE > + else if (gtod->vclock_mode == VCLOCK_HVCLOCK) > + cycles = vread_hvclock(mode); > +#endif > + else > + return 0; > + v = (cycles - gtod->raw_cycle_last) & gtod->raw_mask; gtod->raw_mask is the same as gtod->mask for obvious reasons. So the whole thing can be simplified by extending vgetns() with a mult argument, which is handed in from the call sites. > > + vdata->raw_cycle_last = tk->tkr_raw.cycle_last; > + vdata->raw_mask = tk->tkr_raw.mask; > + vdata->raw_mult = tk->tkr_raw.mult; > + vdata->raw_shift = tk->tkr_raw.shift; Only the raw_mult/shift value needs to be stored. Thanks, tglx