patch: please test buildkernel

Joseph Koshy joseph.koshy at gmail.com
Mon Jan 31 23:15:07 PST 2005


> +#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.

-- 
FreeBSD Volunteer, http://people.freebsd.org/~jkoshy


More information about the freebsd-current mailing list