Re: FreeBSD memguard + spinlocks

2009-04-13 Thread John Baldwin
On Saturday 11 April 2009 5:03:58 pm Andrew Brampton wrote: > 2009/4/11 Robert Watson : > > On Sat, 11 Apr 2009, Andrew Brampton wrote: > > > > Your understanding is mostly right.  The missing bit is this: there are two > > kinds of interrupt contexts -- fast/filter interrupt handlers, which borr

Re: FreeBSD memguard + spinlocks

2009-04-11 Thread Robert Watson
On Sat, 11 Apr 2009, Andrew Brampton wrote: Thanks very much for your detailed reply. I'm slowly understanding how everything in FreeBSD fits together, and I appreciate your help. I've been given a project to take over, and all of the design decisions were made before I started working on it

Re: FreeBSD memguard + spinlocks

2009-04-11 Thread Andrew Brampton
2009/4/11 Robert Watson : > On Sat, 11 Apr 2009, Andrew Brampton wrote: > > Your understanding is mostly right.  The missing bit is this: there are two > kinds of interrupt contexts -- fast/filter interrupt handlers, which borrow > the stack and execution context of the kernel thread they preempt,

Re: FreeBSD memguard + spinlocks

2009-04-11 Thread Robert Watson
On Sat, 11 Apr 2009, Andrew Brampton wrote: I'm having a problem with memguard(9) on FreeBSD 7.1 but before I ask about that I just need to check my facts about malloc. When in interrupt context malloc must be called with M_NOWAIT, this is because I can't sleep inside a interrupt. Now when I

FreeBSD memguard + spinlocks

2009-04-10 Thread Andrew Brampton
Hi, I'm having a problem with memguard(9) on FreeBSD 7.1 but before I ask about that I just need to check my facts about malloc. When in interrupt context malloc must be called with M_NOWAIT, this is because I can't sleep inside a interrupt. Now when I hold a spinlock (MTX_SPIN) I am also not allo