Skip to content
Snippets Groups Projects
Forked from drm / msm
183002 commits behind the upstream repository.
user avatar
Rik van Riel authored
Currently the ipc namespace allocation will fail when there are
ipc_namespace structures pending to be freed. This results in the
simple test case below, as well as some real world workloads, to
get allocation failures even when the number of ipc namespaces in
actual use is way below the limit.

int main()
{
	int i;

	for (i = 0; i < 100000; i++) {
		if (unshare(CLONE_NEWIPC) < 0)
			error(EXIT_FAILURE, errno, "unshare");
	}
}

Make the allocation of an ipc_namespace wait for pending frees,
so it will succeed.

real	6m19.197s
user	0m0.041s
sys	0m1.019s

Signed-off-by: default avatarRik van Riel <riel@surriel.com>
Reported-by: default avatarChris Mason <clm@meta.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
a80c4adc
History