From owner-freebsd-current@FreeBSD.ORG Tue Feb 1 07:15:07 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3C69116A4CF for ; Tue, 1 Feb 2005 07:15:07 +0000 (GMT) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id 86F4743D2D for ; Tue, 1 Feb 2005 07:15:05 +0000 (GMT) (envelope-from joseph.koshy@gmail.com) Received: by rproxy.gmail.com with SMTP id a36so941634rnf for ; Mon, 31 Jan 2005 23:15:02 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=B5nUpZr5i+nNHRs8TsgDWnL0320y1jW3Ls1wHoxm2xLcekotbUpceTYBHQBwvK1CvrZcvE7OmkH8zXo70WhK066VNd5kJvRTiConX1/LSu045Tc7DXZjVA0I5v+xu/2bAGB6XTTvBd8PRV9kIAfSxdgoCYFpSG9+J63iy0MB//o= Received: by 10.39.3.48 with SMTP id f48mr221682rni; Mon, 31 Jan 2005 23:15:01 -0800 (PST) Received: by 10.38.209.12 with HTTP; Mon, 31 Jan 2005 23:15:01 -0800 (PST) Message-ID: <84dead720501312315319a5647@mail.gmail.com> Date: Tue, 1 Feb 2005 07:15:01 +0000 From: Joseph Koshy To: Nate Lawson In-Reply-To: <41FF280F.1050102@root.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <41FF280F.1050102@root.org> cc: FreeBSD Current Subject: Re: patch: please test buildkernel X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Joseph Koshy List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Feb 2005 07:15:07 -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