Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1822558imm; Sun, 15 Jul 2018 18:27:46 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc+lF1zEFUvqCF2rkTJMdvpnVsNrbrrOIKIpo7uaUNH66zhJrslecsAhKbhMdFG+aVdbTV7 X-Received: by 2002:a65:5286:: with SMTP id y6-v6mr13790483pgp.65.1531704466657; Sun, 15 Jul 2018 18:27:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531704466; cv=none; d=google.com; s=arc-20160816; b=mImXyCYryjaBuUwieBbPDfrqqcXSIgjJO9gugiQg7ykrGyupONtifl+hyAEOAG0yMx wUm6DVfLPtJWks8bHASapiqF632iVswFvGmR/RX2on090qRFUUFCnTFFwusWvSpLYhEA XXKGjAZy5jm7I8kKBWDYtxatwY1WSOvshUvpm4dv0I8MmqAVMd7/M+vRw++SmwjovTUd p5CBajpd7jLlT/w+cUNhvxzKHv1RqgqxqMIxMElrSSDdVIBGLH+/tr3h0p7pBOufVZRe wsnIR63HPqGUXv6c6hBkYS0kzZy2OP8VGdqXHN8wNX/RFaCullYZmdy8XjsFhmGlCFy/ x47w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:arc-authentication-results; bh=YJkDpzBvNCeIV7S/fJFSH8KE7lEivyfkHAb8Oe6LE3M=; b=uEwhjrhLjWYeZp5iSIEhntXDeVlie7eX4IdwCJ8m8Lbqk177e8lZw9ooLWp3jDvzF7 jNhF+r4AxCUpfwhnnIDCwzWHFvYnmjAJyg7GtxylXCK2iL3qz1ewDtLasHvYsXAF0qOA ux1xv5RFoEMNCKCZKFLWrKx1RlKDQC1Opj2JtvlzEXeYHGiJQI8G08BQDHuTyrWHl61+ E0xhZalU4Ja1v4zDfZl+wu5ckGpdGTzg7amB+FjW1lGeFuDVWQvVbdP70Yif+etx3aqJ LV+rD+J6GcMC1EGCqflxTl9xYMuEImNuWbv9FFGneFPrguazZizn7ljmQjorI5GStFSR 7ftA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z125-v6si14428267pfz.10.2018.07.15.18.27.31; Sun, 15 Jul 2018 18:27:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727394AbeGPBvy (ORCPT + 99 others); Sun, 15 Jul 2018 21:51:54 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:36478 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727180AbeGPBvy (ORCPT ); Sun, 15 Jul 2018 21:51:54 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 9769A2B7A6BB7; Mon, 16 Jul 2018 09:26:54 +0800 (CST) Received: from [10.177.253.249] (10.177.253.249) by smtp.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.382.0; Mon, 16 Jul 2018 09:26:52 +0800 Subject: Re: [V9fs-developer] [PATCH] net/9p/client.c: fix misuse of spin_lock_irqsave for p9_client lock To: Dominique Martinet References: <5B46F5AD.50200@huawei.com> <20180712070122.GB7639@nautica> CC: "akpm@linux-foundation.org" , , , , , Linux Kernel Mailing List From: piaojun Message-ID: <5B4BF457.2070905@huawei.com> Date: Mon, 16 Jul 2018 09:26:47 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20180712070122.GB7639@nautica> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.253.249] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dominique, On 2018/7/12 15:01, Dominique Martinet wrote: > 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 >> --- >> 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) OK, I will rebase my patch and resend later. Thanks, Jun > > Please see my "Current 9P patches - test branch" for details: > https://sourceforge.net/p/v9fs/mailman/message/36365359/ >