Paul Menage wrote: > On 8/5/06, Srivatsa Vaddagiri <[EMAIL PROTECTED]> wrote: > >>On Fri, Aug 04, 2006 at 07:56:03PM -0700, Paul Menage wrote: >> >>>What's the recommended safe way to access current->res_group (or even >>>an arbitrary task->res_group) without racing against a concurrent >>>set_res_group() call from a different process? >> >>I guess as long as we have done a kref_get() on ->res_group, we are safe >>to access it. > > > But currently I don't even see a safe way of calling kref_get() on > current->res_group - there's a small race with someone deleting the > res_group which could lead you to take a reference on an > already-deleted object.
Yes, in set_res_group and __set_res_group, kref_get/put are being used directly without acquiring res_group_lock which is what will protect against taking refs on a group that is being deleted. > >>We can use RCU if we can assume that the readers wont block, while they >>are dereferencing task->res_group. > > > Readers that need to block can take a proper reference on the group, > so that at least they know it won't go away. > > Paul ------------------------------------------------------------------------- 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