tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: would a mutex_wait be useful?
Mindaugas Rasiukevicius <rmind%NetBSD.org@localhost> wrote:
> Matt Thomas <matt%3am-software.com@localhost> wrote:
> > > Where/when do you need interruptible mutex?
> >
> > I was replacing code in arm32/mem.c with a home grown lock with
> > mutex_enter.
> > Relatively easy to do except it no longer does PCATCH.
>
> I agree with Antti that code asks for condvar(9), at least.
Actually, taken a look at arm32/mem.c again, no need for condvar(9). If there
is a contention on mm_lock, hashed locks would help. Is it worth?
You probably was intended to set the D_MPSAFE flag for mem_cdevsw. Note that
this wont be atomic then:
if (zeropage == NULL) {
zeropage = (void *)
malloc(PAGE_SIZE, M_TEMP, M_WAITOK);
memset(zeropage, 0, PAGE_SIZE);
}
--
Best regards,
Mindaugas
Home |
Main Index |
Thread Index |
Old Index