Re: patch: please test buildkernel

From: Joseph Koshy <joseph.koshy_at_gmail.com>
Date: Tue, 1 Feb 2005 07:15:01 +0000
> +#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
Received on Tue Feb 01 2005 - 06:15:07 UTC

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