- Timestamp:
- 02/28/12 00:55:15 (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/linux/universal/linux-3.2/arch/x86/kernel/process_64.c
r18171 r18579 382 382 struct tss_struct *tss = &per_cpu(init_tss, cpu); 383 383 unsigned fsindex, gsindex; 384 bool preload_fpu; 385 386 /* 387 * If the task has used fpu the last 5 timeslices, just do a full 388 * restore of the math state immediately to avoid the trap; the 389 * chances of needing FPU soon are obviously high now 390 */ 391 preload_fpu = tsk_used_math(next_p) && next_p->fpu_counter > 5; 392 393 /* we're going to use this soon, after a few expensive things */ 394 if (preload_fpu) 395 prefetch(next->fpu.state); 384 fpu_switch_t fpu; 385 386 fpu = switch_fpu_prepare(prev_p, next_p); 396 387 397 388 /* … … 422 413 423 414 load_TLS(next, cpu); 424 425 /* Must be after DS reload */426 __unlazy_fpu(prev_p);427 428 /* Make sure cpu is ready for new context */429 if (preload_fpu)430 clts();431 415 432 416 /* … … 470 454 prev->gsindex = gsindex; 471 455 456 switch_fpu_finish(next_p, fpu); 457 472 458 /* 473 459 * Switch the PDA and FPU contexts. … … 487 473 task_thread_info(prev_p)->flags & _TIF_WORK_CTXSW_PREV)) 488 474 __switch_to_xtra(prev_p, next_p, tss); 489 490 /*491 * Preload the FPU context, now that we've determined that the492 * task is likely to be using it.493 */494 if (preload_fpu)495 __math_state_restore();496 475 497 476 return prev_p;
Note: See TracChangeset
for help on using the changeset viewer.
