Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp329445imm; Wed, 18 Jul 2018 02:56:25 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfW+JP/fdfBphCTmJzSlrq7kA6udwCn2ackVmqDJBOArc8a/FKxw/FGCeJ8fQb8gASZVfed X-Received: by 2002:a63:8848:: with SMTP id l69-v6mr5016890pgd.377.1531907785022; Wed, 18 Jul 2018 02:56:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531907784; cv=none; d=google.com; s=arc-20160816; b=MpQG+5gfbX1LdOMzWVwBEziaB7QfyllxHP6izccCepDBYk5OhTFZH9ecr6ShhLkH8a pg4aFqtA8TmI6b/VppH30fH72TIMpDqtdLOVVXzUzFcFxjCw4HFAlwIjeURvjOZGonAl 3UdvKI4w+N7KMnFHX2KUI30MpuzjCRrVNCWYDZ5KBqFmmc4D4wTY+Itf/cjrzYpIBbPL n6lJ53sWnsrWPiN/tqAJ1I8ja0hlnYJkrPn5lVM4HVTDd6k535MvOSLZeTAPzCkeUBSS 9xrlDqYWBYhbUg0leNUWX0qIP7xQAIUjBdXwPboLBE+Q1eVf09lZlc/goWJJS/LhkrSb fA4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=bn2KFmtWdm6kFru0UCafnduKxBUuBycA/STkBMxHPlM=; b=mzYoCi71C5eYjjaQ6sQMmTL2NXRyXow8I1cFj9Ch9nUpovjlnir0ci17ooNCvBqCyV +oVkNzTb5aqz9dLv6dKupr2KHB7DQ2no/mEWaehh+uZrIq6zQYqukMBd5GMyeOSRSM3o md0EohftdO04ttHG6xCHO5EY+eox95JZzbgp0s8CagmqkOYXmRdQnvU22n0teZ7cbO2R A4g2ZRCdZADvsTiNpo582JG4Z9LAdA8OEdq+KgkELkHChZarmquZN5qSpqDpWIUEHHDw lFYDe5t5BCWpVIZWicajBQnT1BVWGbvVSMcS6GyJC6ttlGc24HAruFsIIX9KtzuOyn6J F8RA== 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 w19-v6si2744355plq.236.2018.07.18.02.56.10; Wed, 18 Jul 2018 02:56:24 -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 S1726501AbeGRKbn (ORCPT + 99 others); Wed, 18 Jul 2018 06:31:43 -0400 Received: from nautica.notk.org ([91.121.71.147]:47278 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726064AbeGRKbm (ORCPT ); Wed, 18 Jul 2018 06:31:42 -0400 Received: by nautica.notk.org (Postfix, from userid 1001) id 93FFEC009; Wed, 18 Jul 2018 11:54:35 +0200 (CEST) Date: Wed, 18 Jul 2018 11:54:20 +0200 From: Dominique Martinet To: piaojun Cc: "akpm@linux-foundation.org" , Eric Van Hensbergen , Ron Minnich , Latchesar Ionkov , Linux Kernel Mailing List , v9fs-developer@lists.sourceforge.net Subject: Re: [PATCH] net/9p/trans_virtio.c: replace mutex_lock with spin_lock to protect 'virtio_chan_list' Message-ID: <20180718095420.GA28377@nautica> References: <5B4EF511.7090104@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5B4EF511.7090104@huawei.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org piaojun wrote on Wed, Jul 18, 2018: > spin_lock is more effective for short time protection than mutex_lock, as > mutex lock may cause process sleep and wake up which consume much cpu > time. That's not a fast path operation, I don't mind changing things but I'd like to understand why - these functions are only ever called at unmount time or when something happens on the virtio bus (probe will happen on probing on the pci bus and I'm not too sure on remove but probably pci removal i.e. basically never?) I don't see why this wouldn't work, but I won't take this without a (good?) reason. -- Dominique Martinet