From: Thomas Gleixner <tglx@linutronix.de>
To: Alexey Makhalov <amakhalov@vmware.com>
Cc: corbet@lwn.net, time-lords@vmware.com, linux-doc@vger.kernel.org,
pv-drivers@vmware.com, x86@kernel.org,
linux-kernel@vger.kernel.org, monitor-list@vmware.com,
virtualization@lists.linux-foundation.org, mingo@redhat.com,
hpa@zytor.com, akataria@vmware.com
Subject: Re: [PATCH 3/3] x86/vmware: Add paravirt sched clock
Date: Wed, 26 Oct 2016 12:18:33 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.20.1610261213000.4983@nanos> (raw)
In-Reply-To: <20161026052640.77585-1-amakhalov@vmware.com>
On Tue, 25 Oct 2016, Alexey Makhalov wrote:
> no-vmw-sched-clock kernel parameter is added to switch back to the
> native_sched_clock() implementation.
You are not switching back. The parameter is used to disable the paravirt
sched clock.
> #ifdef CONFIG_PARAVIRT
> +static struct cyc2ns_data vmware_cyc2ns __ro_after_init;
> +
> +static int vmw_sched_clock __initdata = 1;
> +static __init int setup_vmw_sched_clock(char *s)
Please stop glueing a variable to a function w/o a new line between
them. It's just stopping the reading flow.
> +{
> + vmw_sched_clock = 0;
> + return 0;
> +}
> +early_param("no-vmw-sched-clock", setup_vmw_sched_clock);
> +
> +static unsigned long long vmware_sched_clock(void)
> +{
> + unsigned long long ns;
> +
> + ns = mul_u64_u32_shr(rdtsc(), vmware_cyc2ns.cyc2ns_mul,
> + vmware_cyc2ns.cyc2ns_shift);
> + ns -= vmware_cyc2ns.cyc2ns_offset;
> + return ns;
> +}
> +
> static void __init vmware_paravirt_ops_setup(void)
> {
> pv_info.name = "VMware";
> pv_cpu_ops.io_delay = paravirt_nop;
> +
> + if (vmware_tsc_khz && vmw_sched_clock) {
> + unsigned long long tsc_now = rdtsc();
> +
> + clocks_calc_mult_shift(&vmware_cyc2ns.cyc2ns_mul,
> + &vmware_cyc2ns.cyc2ns_shift,
> + vmware_tsc_khz,
> + NSEC_PER_MSEC, 0);
> + vmware_cyc2ns.cyc2ns_offset =
> + mul_u64_u32_shr(tsc_now, vmware_cyc2ns.cyc2ns_mul,
> + vmware_cyc2ns.cyc2ns_shift);
> +
> + pv_time_ops.sched_clock = vmware_sched_clock;
> + pr_info("vmware: using sched offset of %llu ns\n",
Please use pr_fmt instead of adding the prefix to every print.
Thanks,
tglx
next prev parent reply other threads:[~2016-10-26 10:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20161026052038.77042-1-amakhalov@vmware.com>
2016-10-26 5:20 ` [PATCH 1/3] x86/vmware: Use tsc_khz value for calibrate_cpu() Alexey Makhalov
2016-10-26 5:26 ` [PATCH 2/3] x86/vmware: Add basic paravirt ops support Alexey Makhalov
2016-10-26 5:26 ` [PATCH 3/3] x86/vmware: Add paravirt sched clock Alexey Makhalov
[not found] ` <20161026052640.77585-1-amakhalov@vmware.com>
2016-10-26 10:18 ` Thomas Gleixner [this message]
2016-10-26 16:51 ` [PATCH v2 " Alexey Makhalov
[not found] ` <20161026052600.77535-1-amakhalov@vmware.com>
2016-10-26 20:47 ` [PATCH 2/3] x86/vmware: Add basic paravirt ops support Tim Mann
[not found] ` <20161026134707.1e445c37@manzanita>
2016-10-26 20:47 ` Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.20.1610261213000.4983@nanos \
--to=tglx@linutronix.de \
--cc=akataria@vmware.com \
--cc=amakhalov@vmware.com \
--cc=corbet@lwn.net \
--cc=hpa@zytor.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=monitor-list@vmware.com \
--cc=pv-drivers@vmware.com \
--cc=time-lords@vmware.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox