Date: Tue, 1 Feb 2005 07:15:01 +0000 From: Joseph Koshy <joseph.koshy@gmail.com> To: Nate Lawson <nate@root.org> Cc: FreeBSD Current <freebsd-current@freebsd.org> Subject: Re: patch: please test buildkernel Message-ID: <84dead720501312315319a5647@mail.gmail.com> In-Reply-To: <41FF280F.1050102@root.org> References: <41FF280F.1050102@root.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> +#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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?84dead720501312315319a5647>