Re: [External] Re: [PATCH] files: Use rcu lock to get the file structures for better performance

2020-05-22 Thread Matthew Wilcox
On Fri, May 22, 2020 at 03:52:39PM +0800, Muchun Song wrote: > On Fri, May 22, 2020 at 12:47 AM Matthew Wilcox wrote: > > > @@ -160,14 +168,23 @@ static int proc_fd_link(struct dentry *dentry, > > > struct path *path) > > > unsigned int fd = proc_fd(d_inode(dentry)); > > >

Re: [External] Re: [PATCH] files: Use rcu lock to get the file structures for better performance

2020-05-22 Thread Muchun Song
On Fri, May 22, 2020 at 12:47 AM Matthew Wilcox wrote: > > On Thu, May 21, 2020 at 08:38:35PM +0800, Muchun Song wrote: > > +++ b/fs/proc/fd.c > > @@ -34,19 +34,27 @@ static int seq_show(struct seq_file *m, void *v) > > if (files) { > > unsigned int fd = proc_fd(m->private); >

Re: [PATCH] files: Use rcu lock to get the file structures for better performance

2020-05-21 Thread Matthew Wilcox
On Thu, May 21, 2020 at 08:38:35PM +0800, Muchun Song wrote: > +++ b/fs/proc/fd.c > @@ -34,19 +34,27 @@ static int seq_show(struct seq_file *m, void *v) > if (files) { > unsigned int fd = proc_fd(m->private); > > - spin_lock(&files->file_lock); > + rcu_

Re: [External] Re: [PATCH] files: Use rcu lock to get the file structures for better performance

2020-05-21 Thread Greg KH
On Fri, May 22, 2020 at 12:06:46AM +0800, Muchun Song wrote: > On Thu, May 21, 2020 at 11:21 PM Matthew Wilcox wrote: > > > > On Thu, May 21, 2020 at 08:38:35PM +0800, Muchun Song wrote: > > > There is another safe way to get the file structure without > > > holding the files->file_lock. That is r

Re: [External] Re: [PATCH] files: Use rcu lock to get the file structures for better performance

2020-05-21 Thread Muchun Song
On Thu, May 21, 2020 at 11:21 PM Matthew Wilcox wrote: > > On Thu, May 21, 2020 at 08:38:35PM +0800, Muchun Song wrote: > > There is another safe way to get the file structure without > > holding the files->file_lock. That is rcu lock, and this way > > has better performance. So use the rcu lock i

Re: [PATCH] files: Use rcu lock to get the file structures for better performance

2020-05-21 Thread Matthew Wilcox
On Thu, May 21, 2020 at 08:38:35PM +0800, Muchun Song wrote: > There is another safe way to get the file structure without > holding the files->file_lock. That is rcu lock, and this way > has better performance. So use the rcu lock instead of the > files->file_lock. What makes you think this is sa

[PATCH] files: Use rcu lock to get the file structures for better performance

2020-05-21 Thread Muchun Song
There is another safe way to get the file structure without holding the files->file_lock. That is rcu lock, and this way has better performance. So use the rcu lock instead of the files->file_lock. Signed-off-by: Muchun Song --- fs/proc/fd.c | 31 --- kernel/b