Date: Tue, 29 May 2007 14:56:38 -0400 From: John Baldwin <jhb@freebsd.org> To: freebsd-arch@freebsd.org Subject: Re: rusage breakdown and cpu limits. Message-ID: <200705291456.38515.jhb@freebsd.org> In-Reply-To: <20070529105856.L661@10.0.0.1> References: <20070529105856.L661@10.0.0.1>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 29 May 2007 02:01:36 pm Jeff Roberson wrote: > I'm working with Attilio to break down rusage further to be per-thread in > places where it is protected by the global scheduler lock. To support > this, I am interested in moving the rlimit cpulimit check into userret(), > or perhaps ast(). Is there any reason why we need to check this on every > context switch? Any objections to moving it? Eventually it will require > a different lock from the one we obtain to call mi_switch(). I think using a per-process spin lock (or a pool of spin locks) would be a good first step. I wouldn't do anything more complicated unless the simple approach doesn't work. The only reason to not move the check into userret() would be if one is worried about threads chewing up CPU time while they are in the kernel w/o bouncing out to userland. Also, it matters which one happens more often (userret() vs mi_switch()). If on average threads perform multiple system calls during a single time slice (no idea if this is true or not), then moving the check to userret() would actually hurt performance. -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200705291456.38515.jhb>