On Thu, Feb 17, 2022 at 03:36:20PM -0500, Rik van Riel wrote: > The patch works, but a cleanup question for Al Viro: > > How do we get rid of #include "../fs/mount.h" and the raw ->mnt_ns = NULL thing > in the cleanest way? > > ---8<--- > Currently freeing ipc_namespace structures is done through a > workqueue, with every single item on the queue waiting in > synchronize_rcu before it is freed, limiting the rate at which > ipc_namespace structures can be freed to something on the order > of 100 a second. > > Getting rid of that workqueue and just using rcu_work instead > allows a whole batch of ipc_namespace frees to wait one single > RCU grace period, after which they can all get freed quickly. > > Without this patch, a test program that simply calls > unshare(CLONE_NEWIPC) a million times in a loop eventually > gets -ENOSPC as the total number of ipc_namespace structures > exceeds the limit, due to slow freeing. > > With this patch, the test program runs successfully every time. > > Reported-by: Chris Mason <clm@xxxxxx> > Signed-off-by: Rik van Riel <riel@xxxxxxxxxxx>