cvs commit: src/sys/kern tty.c

Attilio Rao attilio at freebsd.org
Wed Dec 20 04:42:36 PST 2006


2006/12/20, Martin Blapp <mb at imp.ch>:
>
> Hi,
>
> > Since proctree_lock is a sx lock which uses 2 condition variables,
> > they alredy drop Giant (DROP_GIANT()) before sleeping. Are you secure
> > it is the right thing to do here?
>
> Yes I am.
>
> sx_slock() can call cv_wait() which later can call cv_wait_unlock ...
> if there is already a lock we need to share ... After a possible
> sleep cv_wait_unlock looks like:
>
> cv_wait_unlock(struct cv *cvp, struct mtx *mp)
>
> [...]
>         sleepq_lock(cvp);
>
>         cvp->cv_waiters++;
>         DROP_GIANT();
>         mtx_unlock(mp);
>
> [...]
>
> It can call DROP_GIANT for a short amount of time. This was the race.

No, it drops Giant for all the time it sleeps.
Maybe the race is somewhere else.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein


More information about the cvs-src mailing list