On 11-Aug-2003 Rui Lopes wrote:
> Hello,
> 
> I've been reading vm_glue.c and I think I've found a bug regarding the
> lock of `proc.p_sflag' inside `scheduler' function.
> 
>>From proc.h, "int p_sflag; /* (j) PS_* flags. */" and "(j) - locked by
> sched_lock mtx";  but the access is done without having the lock.
> 
> 
> Take a look at the attached patch and tell me if this is ok.
> 
> Patch made against "$FreeBSD: src/sys/vm/vm_glue.c,v 1.172 2003/05/13
> 20:36:02 jhb Exp $", but this is also present in current 1.182.

The lock isn't needed in this case for these flags because the proc
lock is already held and for these flags, both the proc lock and
sched lock are always held when they are set or cleared, so only one
of those locks have to be held to check the flags.

-- 

John Baldwin <[EMAIL PROTECTED]>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to