Re: [PATCH] cpuset semaphore depth check optimize

Robin Holt
2005-09-20T12:06:14Z

Paul,

Can you give a _short_ explanation of why notify_on_release is
essential? Could the intent be accomplished with something
like destroy on exit which then goes through and does the
remove of shildren and finally removes the cpuset?

If we can agree on that, then the exit path becomes
if (atomic_dec_and_lock(&current->cpuset.refcount)) {
/* Code to remove children. */
}
which no longer needs to call a usermode helper and is _FAR_
better in my personal biased opinion.

Thanks,
Robin

PS: For reference, here is what /sbin/cpuset_release_agent
looks like:

[holt@attica:sbin] cat cpuset_release_agent
#!/bin/sh

# Do not modify this file /sbin/cpuset_release_agent.
#
# It is invoked directly from the kernel's call_usermodehelper()
# routine, whenever the last user of cpuset goes away, if that
# cpuset had its 'notify_on_release' option set to '1'. This
# cpuset_release_agent script is responsible for removing the
# abandoned cpuset, whose cpuset file system path is passed
# in argv[1].

rmdir /dev/cpuset/$1