Re: [PATCH] cgroup: avoid attaching a cgroup root to two different superblocks, take 2

2017-04-28 Thread Tejun Heo
On Wed, Apr 19, 2017 at 10:15:59AM +0800, Zefan Li wrote: > Commit bfb0b80db5f9 is broken. Now we try to fix the race by delaying > the initialization of cgroup root refcnt until a superblock has been > allocated. > > Cc: sta...@vger.kernel.org # 3.16+ > Reported-by: Dmitry Vyukov

Re: [PATCH] cgroup: avoid attaching a cgroup root to two different superblocks, take 2

2017-04-28 Thread Tejun Heo
On Wed, Apr 19, 2017 at 10:15:59AM +0800, Zefan Li wrote: > Commit bfb0b80db5f9 is broken. Now we try to fix the race by delaying > the initialization of cgroup root refcnt until a superblock has been > allocated. > > Cc: sta...@vger.kernel.org # 3.16+ > Reported-by: Dmitry Vyukov > Reported-by:

[PATCH] cgroup: avoid attaching a cgroup root to two different superblocks, take 2

2017-04-18 Thread Zefan Li
Commit bfb0b80db5f9 is broken. Now we try to fix the race by delaying the initialization of cgroup root refcnt until a superblock has been allocated. Cc: sta...@vger.kernel.org # 3.16+ Reported-by: Dmitry Vyukov Reported-by: Andrei Vagin Tested-by:

[PATCH] cgroup: avoid attaching a cgroup root to two different superblocks, take 2

2017-04-18 Thread Zefan Li
Commit bfb0b80db5f9 is broken. Now we try to fix the race by delaying the initialization of cgroup root refcnt until a superblock has been allocated. Cc: sta...@vger.kernel.org # 3.16+ Reported-by: Dmitry Vyukov Reported-by: Andrei Vagin Tested-by: Andrei Vagin Signed-off-by: Zefan Li --- I

Re: cgroup: avoid attaching a cgroup root to two different superblocks

2017-04-18 Thread Tejun Heo
Hello, Li. On Mon, Apr 17, 2017 at 06:41:38PM +0800, Zefan Li wrote: > Now I remember why it didn't check NULL pointer... Could you try the > following fix? > It also reverts my previous patch. I would appreciate if you run the full > test suit, > to make sure it won't break anything. Can you

Re: cgroup: avoid attaching a cgroup root to two different superblocks

2017-04-18 Thread Tejun Heo
Hello, Li. On Mon, Apr 17, 2017 at 06:41:38PM +0800, Zefan Li wrote: > Now I remember why it didn't check NULL pointer... Could you try the > following fix? > It also reverts my previous patch. I would appreciate if you run the full > test suit, > to make sure it won't break anything. Can you

Re: cgroup: avoid attaching a cgroup root to two different superblocks

2017-04-17 Thread Andrei Vagin
k NULL pointer... Could you try the > following fix? > It also reverts my previous patch. I would appreciate if you run the full > test suit, > to make sure it won't break anything. It works for me. Thanks. Tested-by: Andrei Vagin <ava...@virtuozzo.com> > > PS: Tejun, I

Re: cgroup: avoid attaching a cgroup root to two different superblocks

2017-04-17 Thread Andrei Vagin
k NULL pointer... Could you try the > following fix? > It also reverts my previous patch. I would appreciate if you run the full > test suit, > to make sure it won't break anything. It works for me. Thanks. Tested-by: Andrei Vagin > > PS: Tejun, I found recently I

Re: cgroup: avoid attaching a cgroup root to two different superblocks

2017-04-17 Thread Zefan Li
anything. PS: Tejun, I found recently I can no longer receive your emails. Don't know why... === [PATCH] cgruop: avoid attaching a cgroup root to two different superblocks, take 2 Commit bfb0b80db5f9 is broken. Now we try to fix the race by delaying the initialization of cgroup root ref

Re: cgroup: avoid attaching a cgroup root to two different superblocks

2017-04-17 Thread Zefan Li
anything. PS: Tejun, I found recently I can no longer receive your emails. Don't know why... === [PATCH] cgruop: avoid attaching a cgroup root to two different superblocks, take 2 Commit bfb0b80db5f9 is broken. Now we try to fix the race by delaying the initialization of cgroup root ref

Re: cgroup: avoid attaching a cgroup root to two different superblocks

2017-04-16 Thread Tejun Heo
On Fri, Apr 14, 2017 at 04:27:38PM -0700, Andrei Vagin wrote: > Hello, > > One of our CRIU tests hangs with this patch. > > Steps to reproduce: > curl -o cgroupns.c >

Re: cgroup: avoid attaching a cgroup root to two different superblocks

2017-04-16 Thread Tejun Heo
On Fri, Apr 14, 2017 at 04:27:38PM -0700, Andrei Vagin wrote: > Hello, > > One of our CRIU tests hangs with this patch. > > Steps to reproduce: > curl -o cgroupns.c >

Re: cgroup: avoid attaching a cgroup root to two different superblocks

2017-04-14 Thread Andrei Vagin
On Fri, Apr 14, 2017 at 04:27:37PM -0700, Andrei Vagin wrote: > Hello, > > One of our CRIU tests hangs with this patch. > > Steps to reproduce: > curl -o cgroupns.c >

Re: cgroup: avoid attaching a cgroup root to two different superblocks

2017-04-14 Thread Andrei Vagin
On Fri, Apr 14, 2017 at 04:27:37PM -0700, Andrei Vagin wrote: > Hello, > > One of our CRIU tests hangs with this patch. > > Steps to reproduce: > curl -o cgroupns.c >

Re: cgroup: avoid attaching a cgroup root to two different superblocks

2017-04-14 Thread Andrei Vagin
Hello, One of our CRIU tests hangs with this patch. Steps to reproduce: curl -o cgroupns.c https://gist.githubusercontent.com/avagin/f87c8a8bd2a0de9afcc74976327786bc/raw/5843701ef3679f50dd2427cf57a80871082eb28c/gistfile1.txt gcc cgroupns.c -o cgroupns ./cgroupns ./cgroupns [root@fc24 ~]#

Re: cgroup: avoid attaching a cgroup root to two different superblocks

2017-04-14 Thread Andrei Vagin
Hello, One of our CRIU tests hangs with this patch. Steps to reproduce: curl -o cgroupns.c https://gist.githubusercontent.com/avagin/f87c8a8bd2a0de9afcc74976327786bc/raw/5843701ef3679f50dd2427cf57a80871082eb28c/gistfile1.txt gcc cgroupns.c -o cgroupns ./cgroupns ./cgroupns [root@fc24 ~]#

Re: [PATCH] cgroup: avoid attaching a cgroup root to two different superblocks

2017-04-10 Thread Tejun Heo
On Fri, Apr 07, 2017 at 04:51:55PM +0800, Zefan Li wrote: > We end up using the same cgroup root for two different superblocks, > so percpu_ref_kill() will be called twice on the same root when the > two superblocks are destroyed. > > We should fix to make sure the superblock pinning is really

Re: [PATCH] cgroup: avoid attaching a cgroup root to two different superblocks

2017-04-10 Thread Tejun Heo
On Fri, Apr 07, 2017 at 04:51:55PM +0800, Zefan Li wrote: > We end up using the same cgroup root for two different superblocks, > so percpu_ref_kill() will be called twice on the same root when the > two superblocks are destroyed. > > We should fix to make sure the superblock pinning is really

[PATCH] cgroup: avoid attaching a cgroup root to two different superblocks

2017-04-07 Thread Zefan Li
Run this: touch file0 for ((; ;)) { mount -t cpuset xxx file0 } And this concurrently: touch file1 for ((; ;)) { mount -t cpuset xxx file1 } We'll trigger a warning like this: [ cut here ] WARNING: CPU: 1 PID: 4675 at

[PATCH] cgroup: avoid attaching a cgroup root to two different superblocks

2017-04-07 Thread Zefan Li
Run this: touch file0 for ((; ;)) { mount -t cpuset xxx file0 } And this concurrently: touch file1 for ((; ;)) { mount -t cpuset xxx file1 } We'll trigger a warning like this: [ cut here ] WARNING: CPU: 1 PID: 4675 at