Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Nov 2004 15:50:25 -0500
From:      John Baldwin <jhb@FreeBSD.org>
To:        Andre Oppermann <andre@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/i386/i386 pmap.c
Message-ID:  <200411021550.25945.jhb@FreeBSD.org>
In-Reply-To: <41874ED1.662A02@freebsd.org>
References:  <200410291910.i9TJAlNf089795@repoman.freebsd.org> <200411011434.28141.jhb@FreeBSD.org> <41874ED1.662A02@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 02 November 2004 04:09 am, Andre Oppermann wrote:
> John Baldwin wrote:
> > That's very easy, it's just critical_enter/exit() without the
> > cpu_critical_*().  As mentioned in the SMP "design doc", the
> > cpu_critical_*() are only needed for spin mutexes that are used in both
> > top-half and bottom-half code (where ithreads are top-half, but "fast"
> > interrupts and the code that schedules ithreads are bottom-half).  I've
> > thought about shoving cpu_critical_*() off into another API that spin
> > mutexes would use, but that not all critical sections would use, this
> > would give us critical sections that don't block interrupts, but just
> > block preempting.  For idle page zeroing though, I'm not sure we really
> > want to use even a cheap critical section since it would still defer an
> > ithread from running, and ithreads are more important than idle page
> > zeroing.
> >
> > Note that you can easily pin the current thread to its current CPU via
> > sched_pin/unpin() and that that works across preemptions.
>
> Does this involve any mutexes or so?  This is very interesting for a couple
> of cases in the network stack which uses a lot of heavy-weight mutexes at
> the moment.

No, pin/unpin just bounce a per-thread private counter with no locks needed.

-- 
John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200411021550.25945.jhb>