Re: fs_struct refcounting: spinlock vs atomic

2018-02-15 Thread Al Viro
On Thu, Feb 15, 2018 at 06:39:57PM +, Al Viro wrote: > Not true. We also assume that once fs_struct has been locked, the number of > tasks with reference to it won't change. See fs/exec.c:check_unsafe_exec(), > for example. PS: any discussion of VFS and filesystems stuff belongs on

Re: fs_struct refcounting: spinlock vs atomic

2018-02-15 Thread Al Viro
On Thu, Feb 15, 2018 at 06:39:57PM +, Al Viro wrote: > Not true. We also assume that once fs_struct has been locked, the number of > tasks with reference to it won't change. See fs/exec.c:check_unsafe_exec(), > for example. PS: any discussion of VFS and filesystems stuff belongs on

Re: fs_struct refcounting: spinlock vs atomic

2018-02-15 Thread Al Viro
On Thu, Feb 15, 2018 at 02:46:19PM +0100, Enrico Weigelt wrote: > On 15.02.2018 10:14, Richard Weinberger wrote: > > On Wed, Feb 14, 2018 at 10:13 PM, Enrico Weigelt wrote: > > > Hi folks, > > > > > > > > > in fork.c, a spinlock is held for fs_struct refcounting, while other > >

Re: fs_struct refcounting: spinlock vs atomic

2018-02-15 Thread Al Viro
On Thu, Feb 15, 2018 at 02:46:19PM +0100, Enrico Weigelt wrote: > On 15.02.2018 10:14, Richard Weinberger wrote: > > On Wed, Feb 14, 2018 at 10:13 PM, Enrico Weigelt wrote: > > > Hi folks, > > > > > > > > > in fork.c, a spinlock is held for fs_struct refcounting, while other > > > places - eg.

Re: fs_struct refcounting: spinlock vs atomic

2018-02-15 Thread Enrico Weigelt
On 15.02.2018 10:14, Richard Weinberger wrote: On Wed, Feb 14, 2018 at 10:13 PM, Enrico Weigelt wrote: Hi folks, in fork.c, a spinlock is held for fs_struct refcounting, while other places - eg. switch_task_namespaces uses atomic_dec_and_test() on the nsproxy. What's the

Re: fs_struct refcounting: spinlock vs atomic

2018-02-15 Thread Enrico Weigelt
On 15.02.2018 10:14, Richard Weinberger wrote: On Wed, Feb 14, 2018 at 10:13 PM, Enrico Weigelt wrote: Hi folks, in fork.c, a spinlock is held for fs_struct refcounting, while other places - eg. switch_task_namespaces uses atomic_dec_and_test() on the nsproxy. What's the exact difference

Re: fs_struct refcounting: spinlock vs atomic

2018-02-15 Thread Richard Weinberger
On Wed, Feb 14, 2018 at 10:13 PM, Enrico Weigelt wrote: > Hi folks, > > > in fork.c, a spinlock is held for fs_struct refcounting, while other > places - eg. switch_task_namespaces uses atomic_dec_and_test() on > the nsproxy. > > What's the exact difference here ? Could the atomic

Re: fs_struct refcounting: spinlock vs atomic

2018-02-15 Thread Richard Weinberger
On Wed, Feb 14, 2018 at 10:13 PM, Enrico Weigelt wrote: > Hi folks, > > > in fork.c, a spinlock is held for fs_struct refcounting, while other > places - eg. switch_task_namespaces uses atomic_dec_and_test() on > the nsproxy. > > What's the exact difference here ? Could the atomic counting also

fs_struct refcounting: spinlock vs atomic

2018-02-14 Thread Enrico Weigelt
Hi folks, in fork.c, a spinlock is held for fs_struct refcounting, while other places - eg. switch_task_namespaces uses atomic_dec_and_test() on the nsproxy. What's the exact difference here ? Could the atomic counting also used for fs_struct ? --mtx -- Enrico Weigelt, metux IT consult Free

fs_struct refcounting: spinlock vs atomic

2018-02-14 Thread Enrico Weigelt
Hi folks, in fork.c, a spinlock is held for fs_struct refcounting, while other places - eg. switch_task_namespaces uses atomic_dec_and_test() on the nsproxy. What's the exact difference here ? Could the atomic counting also used for fs_struct ? --mtx -- Enrico Weigelt, metux IT consult Free