lkml.org 
[lkml]   [2018]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [V9fs-developer] [PATCH] net/9p/client.c: fix misuse of spin_lock_irqsave for p9_client lock
piaojun wrote on Thu, Jul 12, 2018:
> In p9_read_work(), we use spin_lock for client->lock, but misuse
> spin_lock_irqsave for it in p9_fid_create(). As p9_client lock won't be
> locked in irq context, so spin_lock is enough. And that will improve the
> performance.

Agreed on principle, see remark below

> Signed-off-by: Jun Piao <piaojun@huawei.com>
> ---
> net/9p/client.c | 17 +++++++----------
> net/9p/trans_fd.c | 7 +++----
> 2 files changed, 10 insertions(+), 14 deletions(-)
>
> diff --git a/net/9p/client.c b/net/9p/client.c
> index 8bc8b3e..b05cbfc 100644
> --- a/net/9p/client.c
> +++ b/net/9p/client.c
> @@ -260,7 +260,6 @@ static struct p9_fcall *p9_fcall_alloc(int alloc_msize)
> static struct p9_req_t *
> p9_tag_alloc(struct p9_client *c, u16 tag, unsigned int max_size)
> {
> - unsigned long flags;
> int row, col;
> struct p9_req_t *req;
> int alloc_msize = min(c->msize, max_size);
> @@ -270,7 +269,7 @@ static struct p9_fcall *p9_fcall_alloc(int alloc_msize)
> tag++;
>
> if (tag >= c->max_tag) {
> - spin_lock_irqsave(&c->lock, flags);
> + spin_lock(&c->lock);

This code doesn't exist anymore with Matthew's idr rework, could you
submit that patch based on top of my 9p-next branch?
(unless you really want Andrew to take this for the next 4.18-rc, but
I'm not convinced this qualifies)

Please see my "Current 9P patches - test branch" for details:
https://sourceforge.net/p/v9fs/mailman/message/36365359/

--
Dominique Martinet
\
 
 \ /
  Last update: 2018-07-15 22:05    [W:0.035 / U:31.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site