patch: please test buildkernel
Nate Lawson
nate at root.org
Tue Feb 1 08:53:35 PST 2005
Joseph Koshy wrote:
>>+#ifdef SMP
>>+ /* Schedule ourselves on the indicated cpu. */
>>+ mtx_lock_spin(&sched_lock);
>>+ sched_bind(curthread, cpu_id);
>>+ mtx_unlock_spin(&sched_lock);
>>+#endif
>
> ...
>
>>+#ifdef SMP
>>+ mtx_lock_spin(&sched_lock);
>>+ sched_unbind(curthread);
>>+ mtx_unlock_spin(&sched_lock);
>>+#endif
>
>
> This will break if 'curthread' is already bound.
>
> I ended up solving this problem with a new interface 'sched_is_bound()':
>
> http://perforce.freebsd.org/changeView.cgi?CH=63367
>
> The cleaner alternative would probably have 'sched_bind()' return the
> previous CPU binding state.
Not a problem for me since no code in the kernel calls this interface
after sched_bind(). I agree this is a general problem that should be
solved but I think it's fine to bring in cpufreq without solving it first.
--
Nate
More information about the freebsd-current
mailing list