Date: Tue, 29 May 2007 15:28:07 -0700 (PDT) From: Jeff Roberson <jroberson@chesapeake.net> To: arch@freebsd.org Subject: initial rusage patch. Message-ID: <20070529152059.Y661@10.0.0.1>
next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~jeff/rusage3.diff I'm providing this patch for discussion only. I've just implemented enough that you can see the fallout from this change. I have not yet tested enough to say that this is perfect. I have also not yet fixed the RLIMIT_CPU check in mi_switch(). You can see, however, that with this change there is no access to struct proc in mi_switch() except for INVARIANTS and KTR. Aside, of course, for the rlimit that needs to move anyway. You can also see, that most access to rusage are done through fewer indirects and to local memory. The storage impact of struct proc doesn't change as pstat can be reclaimed as it could before. Furthermore, the only time we need locks is in rufetch() where we aggregate the threads counters and rusage structs into one allocated by the caller. Doing this aggregation less frequently means we're touching struct proc less frequently. In this patch the scheduler lock protects this aggregation. In my threadlock diff this will be protected by the per process spinlock and the thread lock. However, in most places that we aggregate with calcru() we're grabbing a spinlock anyway. So it is not so expensive to grab another. Thanks, Jeff
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070529152059.Y661>