Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1262184

Re: [PATCH -v2] x86: Kill notsc

From Borislav Petkov <bp@alien8.de>
Newsgroups linux.kernel
Subject Re: [PATCH -v2] x86: Kill notsc
Date 2015-11-04 11:30 +0100
Message-ID <qr3ui-7C4-29@gated-at.bofh.it> (permalink)
References <qkX8e-7NU-5@gated-at.bofh.it> <qm5Q5-1Uv-11@gated-at.bofh.it> <qm6VR-3Hx-51@gated-at.bofh.it> <qmtfJ-2HW-39@gated-at.bofh.it> <qr3ui-7C4-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Nov 04, 2015 at 11:21:45AM +0100, Thomas Gleixner wrote:
> On Thu, 22 Oct 2015, Borislav Petkov wrote:
> >  u64 native_sched_clock(void)
> >  {
> > -	if (static_branch_likely(&__use_tsc)) {
> > -		u64 tsc_now = rdtsc();
> > -
> > -		/* return the value in ns */
> > -		return cycles_2_ns(tsc_now);
> > -	}
> > -
> > +#ifdef CONFIG_X86_TSC
> > +	/* return the value in ns */
> > +	return cycles_2_ns(rdtsc());
> > +#else
> >  	/*
> > -	 * Fall back to jiffies if there's no TSC available:
> > -	 * ( But note that we still use it if the TSC is marked
> > -	 *   unstable. We do this because unlike Time Of Day,
> > -	 *   the scheduler clock tolerates small errors and it's
> > -	 *   very important for it to be as fast as the platform
> > -	 *   can achieve it. )
> > +	 * Fall back to jiffies if there's no TSC available: ( But note that we
> > +	 * still use it if the TSC is marked unstable. We do this because unlike
> > +	 * Time Of Day, the scheduler clock tolerates small errors and it's very
> > +	 * important for it to be as fast as the platform can achieve it. )
> 
> This comment does not make any sense with this modification.

Ok.

My intention was to keep the aspect that we still can use the TSC here,
even if it is marked unstable. I'll move it over rdtsc().

Thanks.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH -v2] x86: Kill notsc Thomas Gleixner <tglx@linutronix.de> - 2015-11-04 11:30 +0100
  Re: [PATCH -v2] x86: Kill notsc Borislav Petkov <bp@alien8.de> - 2015-11-04 11:30 +0100

csiph-web