Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Feb 2017 01:11:29 +0800
From:      Jia-Shiun Li <jiashiun@gmail.com>
To:        freebsd-current <freebsd-current@freebsd.org>, John Baldwin <jhb@freebsd.org>, Konstantin Belousov <kib@freebsd.org>
Subject:   Re: TSC as timecounter makes system lag
Message-ID:  <CAHNYxxN7xF3S71E%2BZpvzKNiMr%2B2F9hov6v2Yq_dqm1aAbZt3xw@mail.gmail.com>
In-Reply-To: <CAHNYxxMfeAyQXuMaS8auQc_mHtK%2Bun7ZHZe7EbdFSzXJkUt=hQ@mail.gmail.com>
References:  <CAHNYxxPy4K37jKzw0%2Bs_AX8ha9yeB_S3dK46s4EuXjdNbULCmQ@mail.gmail.com> <20170113120534.GC2349@kib.kiev.ua> <CAHNYxxNN3p4KGvAnQ0aYUFmucGBKKj4JWgATNYZS2n0WTMY78g@mail.gmail.com> <20170115202008.GL2349@kib.kiev.ua> <CAHNYxxNxJp6jVmS0petqMmhdMe0Bam%2BtgUzufFVYWnSSxeGxoA@mail.gmail.com> <20170116120021.GQ2349@kib.kiev.ua> <CAHNYxxO7jeMFCkzQy-J2odu1yZS2UMO36kS58AQAUkXAHqVCPg@mail.gmail.com> <5f814a7a-5e46-057e-62ad-dde0a61bc1c8@selasky.org> <CAHNYxxOJ=dgX5%2Bu%2BSCaE%2Bhv0TXWLfijeh6cnOuK68Fu%2BZRO39A@mail.gmail.com> <CAHNYxxMfeAyQXuMaS8auQc_mHtK%2Bun7ZHZe7EbdFSzXJkUt=hQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I got the impression that TSC was not preferred timecounter
if it is not C-state invariant. But this apparenly is not the case now.
Dig a bit and found r277900 chose to prefer TSC over saving power
by disabling C2 state when TSC is selected as timecounter.

But with EARLY_AP_STARTUP, and TSC as timecounter,
CPU still enters C2 state.
(Observed by sysctl dev.cpu.0.cx_usage_counters)
With nooptions EARLY_AP_STARTUP, CPU correctly stays 100%
in C1 and no lower.

I added a printf in tc_windup() to check. With EARLY_AP_STARTUP,
cpu_disable_c2_sleep is never increased, so it can not prevent CPU
from entering C2.

Guess there's some kind of race or init order issue, but it is
beyond my understanding for now.


-Jia-Shiun.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAHNYxxN7xF3S71E%2BZpvzKNiMr%2B2F9hov6v2Yq_dqm1aAbZt3xw>