Re: sched_pin() bug in SCHED_ULE

From: Alan Cox <alc_at_rice.edu>
Date: Wed, 01 Sep 2010 12:04:51 -0500
mdf_at_FreeBSD.org wrote:
[snip]
> I will test this patch out; thanks for the help!
>
> Two questions:
>
> 1) How does a thread get moved between CPUs when it's not running?  I
> see that we change the runqueue for non-running threads that are on a
> runqueue.  Does the code always check for THREAD_CAN_SCHED when adding
> a sleeping thread to a runqueue on wakeup?
>
> 2) I assume sched_switch() runs a lot more often than sched_pin() or
> sched_affinity(), so it would make sense to add any performance
> penalty of increased work in either of those places than in the
> scheduler.  I suppose the two memory references for THREAD_CAN_MIGRATE
> and THREAD_CAN_SCHED won't be that expensive.
>   

sched_pin() gets used a fair amount on i386 for creating temporary 
mappings in order to avoid the need for system-wide TLB shootdowns.  The 
use cases range from the fast path for pipes to page zeroing.

Alan
Received on Wed Sep 01 2010 - 15:20:07 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:06 UTC