Re: patch: please test buildkernel

From: Nate Lawson <nate_at_root.org>
Date: Tue, 01 Feb 2005 08:53:30 -0800
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
Received on Tue Feb 01 2005 - 15:53:35 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:27 UTC