Paul M wrote: > The cpusets code which this was based on simply locked the task list, > and traversed it to find threads in the cpuset of interest; you could > do the same thing in any other resource controller.
I get away with this in the cpuset code because: 1) I have the cpuset pointer directly in 'task_struct', so don't have to chase down anything, for each task, while scanning the task list. I just have to ask, for each task, if its cpuset pointer points to the cpuset of interest. 2) I don't care if I get an inconsistent answer, so I don't have to lock each task, nor do I even lockout the rest of the cpuset code. All I know, at the end of the scan, is that each task that I claim is attached to the cpuset in question was attached to it at some point during my scan, not necessarilly all at the same time. 3) It's not a flaming disaster if the kmalloc() of enough memory to hold all the pids I collect in a single array fails. That just means that some hapless users open for read of a cpuset 'tasks' file failed, -ENOMEM. Oh well ... If someone is actually trying to manage system resources accurately, they probably can't get away being as fast and loose as this. -- I won't rest till it's the best ... Programmer, Linux Scalability Paul Jackson <[EMAIL PROTECTED]> 1.925.600.0401 ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ ckrm-tech mailing list https://lists.sourceforge.net/lists/listinfo/ckrm-tech