Date: Tue, 18 Feb 2003 17:06:49 -0800 From: "Mooneer Salem" <mooneer@translator.cx> To: "FreeBSD Hackers" <freebsd-hackers@freebsd.org> Subject: Per-jail CPU limits? Message-ID: <FHEMJMOKKMJDGKFOHHEPKEDKFAAA.mooneer@translator.cx>
next in thread | raw e-mail | index | archive | help
Hello, I've been looking at the kernel source, in particular the scheduler in the past few weeks. I found a place in kern_switch.c where per-jail CPU controls could be added (in particular, in the kse_reassign() function). From looking at that function, I could loop through td_runq until I either: 1. Found a thread that isn't jailed, 2. Found a jailed thread, but determine it's safe to let it run because it does not go over sysctl-defined limits, or 3. Find no usable thread, in which case the KSE would theoretically switch over to the idle process until it's time to repeat the process again. This should allow the use of the standard FreeBSD scheduler, except for the jail limits. The question is, how do we determine the total CPU used by the jail? I found the kg_estcpu entry in struct ksegrp, which the thread has a pointer to, but would that be enough? Is there a different approach we could take that would solve this problem? Thanks, -- Mooneer Salem GPLTrans: http://www.translator.cx/ lifeafterking.org: http://www.lifeafterking.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FHEMJMOKKMJDGKFOHHEPKEDKFAAA.mooneer>