public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] x86: Hyper-V: Mark the Hyper-V clocksource as being high resolution
@ 2015-07-03 23:37 K. Y. Srinivasan
  2015-07-04  8:10 ` Thomas Gleixner
  0 siblings, 1 reply; 3+ messages in thread
From: K. Y. Srinivasan @ 2015-07-03 23:37 UTC (permalink / raw)
  To: x86, gregkh, linux-kernel, devel, olaf, apw, jasowang, tglx
  Cc: Vivek yadav, K. Y. Srinivasan

From: Vivek yadav <vyadav@microsoft.com>

By design, alternative clock sources listed are based on the resolution of
current clock source. Once you set a  high resolution clock,
only high resolution sources are returned.
Mark Hyper-V clock source as a high resolution clock source.

Signed-off-by: Vivek yadav <vyadav@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 arch/x86/kernel/cpu/mshyperv.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index 9b5d7b5..0e507a0 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -151,7 +151,8 @@ static struct clocksource hyperv_cs = {
 	.rating		= 400, /* use this when running on Hyperv*/
 	.read		= read_hv_clock,
 	.mask		= CLOCKSOURCE_MASK(64),
-	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
+	.flags		= CLOCK_SOURCE_IS_CONTINUOUS |
+			  CLOCK_SOURCE_VALID_FOR_HRES,
 };
 
 static void __init ms_hyperv_init_platform(void)
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] x86: Hyper-V: Mark the Hyper-V clocksource as being high resolution
  2015-07-03 23:37 [PATCH 1/1] x86: Hyper-V: Mark the Hyper-V clocksource as being high resolution K. Y. Srinivasan
@ 2015-07-04  8:10 ` Thomas Gleixner
  2015-07-04 16:11   ` KY Srinivasan
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Gleixner @ 2015-07-04  8:10 UTC (permalink / raw)
  To: K. Y. Srinivasan
  Cc: x86, gregkh, linux-kernel, devel, olaf, apw, jasowang,
	Vivek yadav

On Fri, 3 Jul 2015, K. Y. Srinivasan wrote:
> From: Vivek yadav <vyadav@microsoft.com>
> 
> By design, alternative clock sources listed are based on the resolution of
> current clock source. Once you set a  high resolution clock,
> only high resolution sources are returned.
> Mark Hyper-V clock source as a high resolution clock source.
> 
> Signed-off-by: Vivek yadav <vyadav@microsoft.com>
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> ---
>  arch/x86/kernel/cpu/mshyperv.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
> index 9b5d7b5..0e507a0 100644
> --- a/arch/x86/kernel/cpu/mshyperv.c
> +++ b/arch/x86/kernel/cpu/mshyperv.c
> @@ -151,7 +151,8 @@ static struct clocksource hyperv_cs = {
>  	.rating		= 400, /* use this when running on Hyperv*/
>  	.read		= read_hv_clock,
>  	.mask		= CLOCKSOURCE_MASK(64),
> -	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
> +	.flags		= CLOCK_SOURCE_IS_CONTINUOUS |
> +			  CLOCK_SOURCE_VALID_FOR_HRES,

No, this is wrong. The CLOCK_SOURCE_VALID_FOR_HRES flag is managed by
the core code and set when a clocksource fulfils the criteria.

The changelog above is not explaining what problem you are trying to
solve.

Thanks,

	tglx



^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH 1/1] x86: Hyper-V: Mark the Hyper-V clocksource as being high resolution
  2015-07-04  8:10 ` Thomas Gleixner
@ 2015-07-04 16:11   ` KY Srinivasan
  0 siblings, 0 replies; 3+ messages in thread
From: KY Srinivasan @ 2015-07-04 16:11 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: x86@kernel.org, gregkh@linuxfoundation.org,
	linux-kernel@vger.kernel.org, devel@linuxdriverproject.org,
	olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com,
	Vivek Yadav



> -----Original Message-----
> From: Thomas Gleixner [mailto:tglx@linutronix.de]
> Sent: Saturday, July 4, 2015 1:11 AM
> To: KY Srinivasan
> Cc: x86@kernel.org; gregkh@linuxfoundation.org; linux-
> kernel@vger.kernel.org; devel@linuxdriverproject.org; olaf@aepfle.de;
> apw@canonical.com; jasowang@redhat.com; Vivek Yadav
> Subject: Re: [PATCH 1/1] x86: Hyper-V: Mark the Hyper-V clocksource as
> being high resolution
> 
> On Fri, 3 Jul 2015, K. Y. Srinivasan wrote:
> > From: Vivek yadav <vyadav@microsoft.com>
> >
> > By design, alternative clock sources listed are based on the resolution of
> > current clock source. Once you set a  high resolution clock,
> > only high resolution sources are returned.
> > Mark Hyper-V clock source as a high resolution clock source.
> >
> > Signed-off-by: Vivek yadav <vyadav@microsoft.com>
> > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> > ---
> >  arch/x86/kernel/cpu/mshyperv.c |    3 ++-
> >  1 files changed, 2 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/x86/kernel/cpu/mshyperv.c
> b/arch/x86/kernel/cpu/mshyperv.c
> > index 9b5d7b5..0e507a0 100644
> > --- a/arch/x86/kernel/cpu/mshyperv.c
> > +++ b/arch/x86/kernel/cpu/mshyperv.c
> > @@ -151,7 +151,8 @@ static struct clocksource hyperv_cs = {
> >  	.rating		= 400, /* use this when running on Hyperv*/
> >  	.read		= read_hv_clock,
> >  	.mask		= CLOCKSOURCE_MASK(64),
> > -	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
> > +	.flags		= CLOCK_SOURCE_IS_CONTINUOUS |
> > +			  CLOCK_SOURCE_VALID_FOR_HRES,
> 
> No, this is wrong. The CLOCK_SOURCE_VALID_FOR_HRES flag is managed by
> the core code and set when a clocksource fulfils the criteria.
> 
> The changelog above is not explaining what problem you are trying to
> solve.
> 

I think the problem Vivek was trying to solve is that after the Hyper-V clocxk was
installed, if the user switched to another clocksource,  say tsc, the hyper-V clock source would not
listed. I will investigate this further and let you know. Thanks for the feedback.

Regards,

K. Y 
> 
> 	tglx
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-05 13:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-03 23:37 [PATCH 1/1] x86: Hyper-V: Mark the Hyper-V clocksource as being high resolution K. Y. Srinivasan
2015-07-04  8:10 ` Thomas Gleixner
2015-07-04 16:11   ` KY Srinivasan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox