Re: Updated rusage patch



On Wed, 30 May 2007, Julian Elischer wrote:

Bruce Evans wrote:

- RELENG_4: statclock() uses splhigh() but not interrupt atomicity.
exit1() uses no locking and thus races with statclock().
above: statclock() still uses sched_lock but not interrupt atomicity.


sched_lock blocks interrupts

exit1() uses no locking and thus races with statclock().
^^^^^^^^^^^^^^^^^^^^^^^

exit1() uses no locking and is thus unaffected by sched_lock. More
precisely, it uses mounds of locking, but at the point that it races
with statclock() it holds only PROC_LOCK(p). It acquires sched_lock
for the first time much later.

Bruce
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Updated rusage patch
    ... More notes on locking below. ... the same races as in RELENG_4: ... exit1() uses no locking and thus races with statclock. ... The only races that are present when reading without locks are potentially inconsistent rusage where the stats are not all from a single snapshot of the program. ...
    (freebsd-arch)
  • Re: Updated rusage patch
    ... There is an incredible amount of locking and unlocking to deal with various races and lock order issues. ... statclock all together and protects the whole thing with thread_lock. ...
    (freebsd-arch)