aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjohn stultz <johnstul@us.ibm.com>2007-07-21 07:37:35 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-21 20:49:15 -0400
commit3704540b48295253bd9c87a5e7ff545f9d47a3b8 (patch)
tree081647bba6b901bfaa7e7216ed2f23c42ecee75d
parent5590a536c0bc403fc73908c66c1c88cbed735ecb (diff)
tick management: spread timer interrupt
After discussing w/ Thomas over IRC, it seems the issue is the sched tick fires on every cpu at the same time, causing extra lock contention. This smaller change, adds an extra offset per cpu so the ticks don't line up. This patch also drops the idle latency from 40us down to under 20us. Signed-off-by: john stultz <johnstul@us.ibm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--kernel/time/tick-sched.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 52db9e3c52..b416995b97 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -546,6 +546,7 @@ void tick_setup_sched_timer(void)
546{ 546{
547 struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched); 547 struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched);
548 ktime_t now = ktime_get(); 548 ktime_t now = ktime_get();
549 u64 offset;
549 550
550 /* 551 /*
551 * Emulate tick processing via per-CPU hrtimers: 552 * Emulate tick processing via per-CPU hrtimers:
@@ -554,8 +555,12 @@ void tick_setup_sched_timer(void)
554 ts->sched_timer.function = tick_sched_timer; 555 ts->sched_timer.function = tick_sched_timer;
555 ts->sched_timer.cb_mode = HRTIMER_CB_IRQSAFE_NO_SOFTIRQ; 556 ts->sched_timer.cb_mode = HRTIMER_CB_IRQSAFE_NO_SOFTIRQ;
556 557
557 /* Get the next period */ 558 /* Get the next period (per cpu) */
558 ts->sched_timer.expires = tick_init_jiffy_update(); 559 ts->sched_timer.expires = tick_init_jiffy_update();
560 offset = ktime_to_ns(tick_period) >> 1;
561 do_div(offset, NR_CPUS);
562 offset *= smp_processor_id();
563 ts->sched_timer.expires = ktime_add_ns(ts->sched_timer.expires, offset);
559 564
560 for (;;) { 565 for (;;) {
561 hrtimer_forward(&ts->sched_timer, now, tick_period); 566 hrtimer_forward(&ts->sched_timer, now, tick_period);
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517




































































































































































































































































































































































































































































































































                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
%PDF-1.4
%쏢
5 0 obj
<</Length 6 0 R/Filter /FlateDecode>>
stream
x[--s;dz;@U/`Xu<ϯ???_'x2J)o_!}RJ[>%?2>)?ʟ*ϓW)c$;QBTfĔqPf㜫WU'1z[2(Z3QBqL
(k?1)
Q|%j(Dy15B5/u@L̟R(WC!*反D
>
Q%~CyL'=AC Ƅ3bgӫ''BwZ35Bg@L4gĤS<i(DSL
^P.̌{3bLT34l0'*DvU[5@
Q}%j(DՆ0_l?&RBT1OUf?	Ux,Du(S>͹l,SBO5Kpf^BTտQBT;'j(D꛹y
Z}Pf*<hܿ
Q>QC!V?Ϲ\mÜWa6SBT@OPhFUJ
k(DyJmQCs*Ds_(Ur9_BT15zW!*|
)5$`SoU*hPf*=^(@E?3] Ʃ7x<~P
h
QQP>>PR_*DT~ԫe
Qn׫jO*DyBT@O
Q-?~(D%BT>W!bLG}ez3W!Ֆ?PBTϫ
Q-?k(D%D
U;GPx4dW¿f,~”COTWdǸMJ\0
S?Q]a*'+Le4Du"UxCxLu