[Devel] Re: [PATCH 10/10] memcg: Document kernel memory accounting.

2012-02-27 Thread Randy Dunlap
On 02/27/2012 02:58 PM, Suleiman Souhlal wrote: > Signed-off-by: Suleiman Souhlal > --- > Documentation/cgroups/memory.txt | 44 +++-- > 1 files changed, 41 insertions(+), 3 deletions(-) > > diff --git a/Documentation/cgroups/memory.txt > b/Documentation/cgrou

[Devel] Re: [PATCH v3 1/4] SUNRPC: release per-net clients lock before calling PipeFS dentries creation

2012-02-27 Thread Stanislav Kinsbursky
27.02.2012 22:05, Stanislav Kinsbursky пишет: v3: 1) Lookup for client is performed from the beginning of the list on each PipeFS event handling operation. Lockdep is sad otherwise, because inode mutex is taken on PipeFS dentry creation, which can be called on mount notification, where this per-

[Devel] [PATCH v3 3/4] SUNRPC: check RPC inode's pipe reference before dereferencing

2012-02-27 Thread Stanislav Kinsbursky
There are 2 tightly bound objects: pipe data (created for kernel needs, has reference to dentry, which depends on PipeFS mount/umount) and PipeFS dentry/inode pair (created on mount for user-space needs). They both independently may have or have not a valid reference to each other. This means, that

[Devel] [PATCH v3 4/4] SUNRPC: move waitq from RPC pipe to RPC inode

2012-02-27 Thread Stanislav Kinsbursky
Currently, wait queue, used for polling of RPC pipe changes from user-space, is a part of RPC pipe. But the pipe data itself can be released on NFS umount prior to dentry-inode pair, connected to it (is case of this pair is open by some process). This is not a problem for almost all pipe users, bec

[Devel] [PATCH v3 2/4] NFS: release per-net clients lock before calling PipeFS dentries creation

2012-02-27 Thread Stanislav Kinsbursky
v3: 1) Lookup for client is performed from the beginning of the list on each PipeFS event handling operation. Lockdep is sad otherwise, because inode mutex is taken on PipeFS dentry creation, which can be called on mount notification, where this per-net client lock is taken on clients list walk.

[Devel] [PATCH v3 1/4] SUNRPC: release per-net clients lock before calling PipeFS dentries creation

2012-02-27 Thread Stanislav Kinsbursky
v3: 1) Lookup for client is performed from the beginning of the list on each PipeFS event handling operation. Lockdep is sad otherwise, because inode mutex is taken on PipeFS dentry creation, which can be called on mount notification, where this per-net client lock is taken on clients list walk.

[Devel] [PATCH v3 0/4] SUNRPC: several fixes around PipeFS objects

2012-02-27 Thread Stanislav Kinsbursky
v3: 1) Lookup for client is performed from the beginning of the list on each PipeFS event handling operation. v2: 1) Prior to calling PipeFS dentry rountines (for both type of clients - SUNPRC and NFS) get the client and drop the list lock instead of replacing per-net locks by mutexes. First two

[Devel] Re: [PATCH v2 1/4] SUNRPC: release per-net clients lock before calling PipeFS dentries creation

2012-02-27 Thread Myklebust, Trond
On Mon, 2012-02-27 at 20:55 +0400, Stanislav Kinsbursky wrote: > 27.02.2012 20:21, Myklebust, Trond пишет: > > On Mon, 2012-02-27 at 19:50 +0400, Stanislav Kinsbursky wrote: > >> Lockdep is sad otherwise, because inode mutex is taken on PipeFS dentry > >> creation, which can be called on mount noti

[Devel] RE: [PATCH v2 1/4] SUNRPC: release per-net clients lock before calling PipeFS dentries creation

2012-02-27 Thread David Laight
> Gmmm. > Please, correct me, if I'm wrong, that you are proposing > something like this: > > spin_lock(&sn->rpc_client_lock); > again: > list_for_each_entry(clnt,&sn->all_clients, cl_clients) { > if ((event == RPC_PIPEFS_MOUNT) && clnt->cl_dentry) || >

[Devel] Re: [PATCH v2 1/4] SUNRPC: release per-net clients lock before calling PipeFS dentries creation

2012-02-27 Thread Stanislav Kinsbursky
27.02.2012 20:21, Myklebust, Trond пишет: On Mon, 2012-02-27 at 19:50 +0400, Stanislav Kinsbursky wrote: Lockdep is sad otherwise, because inode mutex is taken on PipeFS dentry creation, which can be called on mount notification, where this per-net client lock is taken on clients list walk. Sig

[Devel] Re: [PATCH v2 1/4] SUNRPC: release per-net clients lock before calling PipeFS dentries creation

2012-02-27 Thread Myklebust, Trond
On Mon, 2012-02-27 at 19:50 +0400, Stanislav Kinsbursky wrote: > Lockdep is sad otherwise, because inode mutex is taken on PipeFS dentry > creation, which can be called on mount notification, where this per-net client > lock is taken on clients list walk. > > Signed-off-by: Stanislav Kinsbursky >

[Devel] Re: [PATCH v2 2/4] NFS: release per-net clients lock before calling PipeFS dentries creation

2012-02-27 Thread Stanislav Kinsbursky
27.02.2012 19:59, David Laight пишет: spin_lock(&nn->nfs_client_lock); - list_for_each_entry(clp,&nn->nfs_client_list, cl_share_link) { + list_for_each_entry_safe(clp, tmp,&nn->nfs_client_list, cl_share_link) { if (clp->rpc_ops !=&nfs_v4_clientops)

[Devel] RE: [PATCH v2 2/4] NFS: release per-net clients lock before calling PipeFS dentries creation

2012-02-27 Thread David Laight
> spin_lock(&nn->nfs_client_lock); > - list_for_each_entry(clp, &nn->nfs_client_list, cl_share_link) { > + list_for_each_entry_safe(clp, tmp, &nn->nfs_client_list, cl_share_link) { > if (clp->rpc_ops != &nfs_v4_clientops) > continue; > +

[Devel] [PATCH v2 4/4] SUNRPC: move waitq from RPC pipe to RPC inode

2012-02-27 Thread Stanislav Kinsbursky
Currently, wait queue, used for polling of RPC pipe changes from user-space, is a part of RPC pipe. But the pipe data itself can be released on NFS umount prior to dentry-inode pair, connected to it (is case of this pair is open by some process). This is not a problem for almost all pipe users, bec

[Devel] [PATCH v2 3/4] SUNRPC: check RPC inode's pipe reference before dereferencing

2012-02-27 Thread Stanislav Kinsbursky
There are 2 tightly bound objects: pipe data (created for kernel needs, has reference to dentry, which depends on PipeFS mount/umount) and PipeFS dentry/inode pair (created on mount for user-space needs). They both independently may have or have not a valid reference to each other. This means, that

[Devel] [PATCH v2 2/4] NFS: release per-net clients lock before calling PipeFS dentries creation

2012-02-27 Thread Stanislav Kinsbursky
Lockdep is sad otherwise, because inode mutex is taken on PipeFS dentry creation, which can be called on mount notification, where this per-net client lock is taken on clients list walk. Signed-off-by: Stanislav Kinsbursky --- fs/nfs/client.c |2 +- fs/nfs/idmap.c |8 ++-- 2 files

[Devel] [PATCH v2 1/4] SUNRPC: release per-net clients lock before calling PipeFS dentries creation

2012-02-27 Thread Stanislav Kinsbursky
Lockdep is sad otherwise, because inode mutex is taken on PipeFS dentry creation, which can be called on mount notification, where this per-net client lock is taken on clients list walk. Signed-off-by: Stanislav Kinsbursky --- net/sunrpc/clnt.c | 10 +++--- 1 files changed, 7 insertions(+

[Devel] [PATCH v2 0/4] SUNRPC: several fixes around PipeFS objects

2012-02-27 Thread Stanislav Kinsbursky
v2: 1) Prior to calling PipeFS dentry rountines (for both type of clients - SUNPRC and NFS) get the client and drop the list lock instead of replacing per-net locks by mutexes. First two pathes fixes lockdep warnings and next two - dereferencing of released pipe data on eventfd close and in file

[Devel] Re: [PATCH 2/4] NFS: replace per-net client lock by mutex

2012-02-27 Thread Stanislav Kinsbursky
27.02.2012 19:00, Myklebust, Trond пишет: On Mon, 2012-02-27 at 17:49 +0400, Stanislav Kinsbursky wrote: Lockdep is sad otherwise, because inode mutex is taken on PipeFS dentry creation, which can be called on mount notification, where this per-net client lock is taken on clients list walk. Not

[Devel] Re: [PATCH 2/4] NFS: replace per-net client lock by mutex

2012-02-27 Thread Myklebust, Trond
On Mon, 2012-02-27 at 17:49 +0400, Stanislav Kinsbursky wrote: > Lockdep is sad otherwise, because inode mutex is taken on PipeFS dentry > creation, which can be called on mount notification, where this per-net client > lock is taken on clients list walk. > > Note: I used simple mutex instead of r

[Devel] [PATCH 4/4] SUNRPC: move waitq from RPC pipe to RPC inode

2012-02-27 Thread Stanislav Kinsbursky
Currently, wait queue, used for polling of RPC pipe changes from user-space, is a part of RPC pipe. But the pipe data itself can be released on NFS umount prior to dentry-inode pair, connected to it (is case of this pair is open by some process). This is not a problem for almost all pipe users, bec

[Devel] [PATCH 3/4] SUNRPC: check RPC inode's pipe reference before dereferencing

2012-02-27 Thread Stanislav Kinsbursky
There are 2 tightly bound objects: pipe data (created for kernel needs, has reference to dentry, which depends on PipeFS mount/umount) and PipeFS dentry/inode pair (created on mount for user-space needs). They both independently may have or have not a valid reference to each other. This means, that

[Devel] [PATCH 0/4] SUNRPC: several fixes around PipeFS objects

2012-02-27 Thread Stanislav Kinsbursky
First two pathes fixes lockdep warnings and next two - dereferencing of released pipe data on eventfd close. The following series consists of: --- Stanislav Kinsbursky (4): SUNRPC: replace per-net client lock by rw mutex NFS: replace per-net client lock by mutex SUNRPC: check R

[Devel] [PATCH 2/4] NFS: replace per-net client lock by mutex

2012-02-27 Thread Stanislav Kinsbursky
Lockdep is sad otherwise, because inode mutex is taken on PipeFS dentry creation, which can be called on mount notification, where this per-net client lock is taken on clients list walk. Note: I used simple mutex instead of rw semaphore because of nfs_put_client->atomic_dec_and_mutex_lock() call.

[Devel] [PATCH 1/4] SUNRPC: replace per-net client lock by rw mutex

2012-02-27 Thread Stanislav Kinsbursky
Lockdep is sad otherwise, because inode mutex is taken on PipeFS dentry creation, which can be called on mount notification, where this per-net client lock is taken on clients list walk. Signed-off-by: Stanislav Kinsbursky --- net/sunrpc/clnt.c| 16 net/sunrpc/netns.h