Reduce minimum idle hardclock rate from 2Hz to 1Hz.

On idle 80-thread system it allows to improve package-level idle state
residency and so power consumption by several percent.

MFC after:	2 weeks
This commit is contained in:
Alexander Motin 2022-01-09 19:17:43 -05:00
parent 7ef56fb049
commit cb1f5d1136
2 changed files with 5 additions and 5 deletions

View File

@ -239,13 +239,14 @@ getnextcpuevent(int idle)
/* Handle hardclock() events, skipping some if CPU is idle. */
event = state->nexthard;
if (idle) {
hardfreq = (u_int)hz / 2;
if (tc_min_ticktock_freq > 2
if (tc_min_ticktock_freq > 1
#ifdef SMP
&& curcpu == CPU_FIRST()
#endif
)
hardfreq = hz / tc_min_ticktock_freq;
else
hardfreq = hz;
if (hardfreq > 1)
event += tick_sbt * (hardfreq - 1);
}

View File

@ -434,8 +434,7 @@ callout_process(sbintime_t now)
struct callout_cpu *cc;
struct callout_list *sc;
struct thread *td;
sbintime_t first, last, max, tmp_max;
uint32_t lookahead;
sbintime_t first, last, lookahead, max, tmp_max;
u_int firstb, lastb, nowb;
#ifdef CALLOUT_PROFILING
int depth_dir = 0, mpcalls_dir = 0, lockcalls_dir = 0;
@ -455,7 +454,7 @@ callout_process(sbintime_t now)
else if (nowb - firstb == 1)
lookahead = (SBT_1S / 8);
else
lookahead = (SBT_1S / 2);
lookahead = SBT_1S;
first = last = now;
first += (lookahead / 2);
last += lookahead;