tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kthread with kpause or callout



Andrew Doran wrote:

>> I'm just unsure about using mutexes during the callout. I have an
>> IPL_NONE-kmutex which locks register access (my chip supports several
>> register banks, so I need to make sure they are not switched). May I
>> acquire this mutex during a callout (which is a softint, as I
>> understand)? Will the softint sleep or busy-wait?
>
> Yes, you can take an IPL_NONE (adaptive) mutex from a softint /
> callout. Whether it sleeps or spins is a decision that the kernel makes
> at runtime. It tries to spin. If that would deadlock the system, it
> sleeps. This is the only time a callout/softint can sleep - for a
> mutex/rwlock.

Thanks. Good to know.

In the meantime I had to upgrade to an IPL_VM mutex, because the chip
registers will have to be accessed from a VM-level interrupt too. I already
discussed that with Martin in private and I guess it will have the effect
that a process or softint holding the mutex will lock out any IPL_VM
interrupt during this time?

-- 
Frank Wille



Home | Main Index | Thread Index | Old Index