On Mon, Feb 14, 2005 at 12:28:47AM -0800, Ashwin Chandra wrote:

>   FOREACH_PROC_IN_SYSTEM(p) {
>     mtx_lock(&Giant);
>     PROC_LOCK(p);
>     printf("%d %d\n", (int)p->p_stats->p_ru.ru_isrss, 
> (int)p->p_stats->p_ru.ru_idrss);
>     PROC_UNLOCK(p);
>     mtx_unlock(&Giant);
>   }

Addition to my previous letter.  I'm not sure about Giant, but statclock()
is the only one place where ru_isrss and ru_idrss are modified, so I
think it should be enough to get sched_lock before fetching ru_isrss
and ru_idrss.  Also check locks in getrusage().
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to