cvs commit: src/sys/kern kern_clock.c

John Baldwin jhb at FreeBSD.org
Mon May 3 10:50:49 PDT 2004


On Monday 03 May 2004 11:10 am, Brian Fundakowski Feldman wrote:
> Colin Percival <cperciva at FreeBSD.org> wrote:
> > cperciva    2004/05/02 17:48:11 PDT
> >
> >   FreeBSD src repository
> >
> >   Modified files:
> >     sys/kern             kern_clock.c
> >   Log:
> >   Fix a race condition which could result in profprocs being decremented
> >   more than once if stopprofclock is called multiple times on the same
> >   process.
>
> FWIW, the sched_lock enclosing the p->p_flag modification seems pretty
> bogus.

Nope.  The P_PROFIL flag is protected by both the proc lock and sched_lock so 
that we can check the flag with just sched_lock held in clock interrupt 
handlers that can't acquire normal mutexes.

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


More information about the cvs-all mailing list