Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp613711imm; Wed, 8 Aug 2018 02:41:35 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyuPypPAliD1JpItih04MHzAk8XBJSMSBEPRJ6AD6OYugy/zY3tIQpSR54fijSgV8OOvMq0 X-Received: by 2002:a63:5c10:: with SMTP id q16-v6mr1854414pgb.452.1533721295110; Wed, 08 Aug 2018 02:41:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533721295; cv=none; d=google.com; s=arc-20160816; b=r52IA6UjMjt5niU2v2mXi7llwI1QyyK5G7o1rPnrbA/s7zBlAA8+9tw2v9aPMRAAKk Fcerw0pkVVdrIcffPaRnsTxHR0Ge8/uD/KXT5xgGycW7KgJSXJP80+fT4cagVfwugGV1 M7yniaCT5nWEDxMsrZX6KX4KWt5bkGgobGGNeQsXpdx+b659EfWwmmkD5o8NUvjGQ85L JQRJxlvJ5wLnkJ8sAC9yIbJUWaqsqRroNwfAX2tZtiSVsnpMNqRUniDWXbNKxoAtjh9A nxFZ5m9G/z0RkPzWIc75dJoM0sPqrZOG7aEL1Qib3PdwgRXkrb7CWZuX54UCnQm6dzld XL0Q== 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=vSUHnzXGn4VcSf4sAL3ntIGIIEPxdNEKpAEo8TaL/a8=; b=auumpaP/pBKq1+P1fQsJYEqPNVHOGghhKwtjPMXl5mpHo5IXK22Nf0EaS771uUmrfN IT7zEMjlfAirgiFflbMN4guqcgejOWcPxFVEOzqydBIicY4yoKJwvhzgOdY1mhi0nrAE ph91E066uMuv98F6LN3AXVt8oBW6QIW4YvZeexpUP+33UEkJ/L782fu9Gxs1u93JL1h4 +X/n4GIglmXuOm3+IU3RwxBjyMHGaIIrHexLqqCLzAjji51w4073K3tiKwfSVCSuq+Zu XFBq9dnbiuFrMXwri9C8OXduMz9/4VD1AM07gECUUVOPojcGjAf1W7eF5LiUcGUQ5/Yl CZ0w== 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 9-v6si3714635plf.374.2018.08.08.02.41.20; Wed, 08 Aug 2018 02:41:35 -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 S1726954AbeHHL7Z (ORCPT + 99 others); Wed, 8 Aug 2018 07:59:25 -0400 Received: from nautica.notk.org ([91.121.71.147]:47736 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726724AbeHHL7Y (ORCPT ); Wed, 8 Aug 2018 07:59:24 -0400 Received: by nautica.notk.org (Postfix, from userid 1001) id DFB85C009; Wed, 8 Aug 2018 11:40:29 +0200 (CEST) Date: Wed, 8 Aug 2018 11:40:14 +0200 From: Dominique Martinet To: piaojun Cc: "akpm@linux-foundation.org" , Eric Van Hensbergen , Ron Minnich , Latchesar Ionkov , Greg Kurz , Linux Kernel Mailing List , v9fs-developer@lists.sourceforge.net Subject: Re: [PATCH] net/9p/trans_virtio.c: decrease the refcount of 9p virtio device when removing it Message-ID: <20180808094014.GA5585@nautica> References: <5B6AA65E.3030907@huawei.com> <20180808083630.GB16121@nautica> <5B6AB081.6090608@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5B6AB081.6090608@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, Aug 08, 2018: > I try to remove 9pnet_virtio.ko by 'rmmod 9pnet_virtio' as I want to > replace it without rebooting system. I do that all the time when testing, it works for me. What exact kernel commit are you running? > Here I have not mount 9pfs yet, so the refcount is still 0. > > Before rmmod: > # lsmod | grep 9p > 9pnet_virtio 20480 0 > 9pnet 106496 1 9pnet_virtio > virtio_ring 28672 5 virtio_scsi,9pnet_virtio,virtio_pci,virtio_blk,virtio_net > virtio 16384 5 virtio_scsi,9pnet_virtio,virtio_pci,virtio_blk,virtio_net > > After rmmod: > # lsmod | grep 9p > 9pnet_virtio 20480 0 > 9pnet 106496 1 9pnet_virtio > virtio_ring 28672 5 virtio_scsi,9pnet_virtio,virtio_pci,virtio_blk,virtio_net > virtio 16384 5 virtio_scsi,9pnet_virtio,virtio_pci,virtio_blk,virtio_net > > Normally 9pnet_virtio should be invisible after rmmod like this: > # lsmod | grep 9p > 9pnet 106496 0 Right, that obviously didn't work... But on the other hand, if I apply your commit and load/unload 9pnet_virtio 5-10 times (I ran it in a loop) I get KASAN errors because we put too many of these refs ; that doesn't happen without your patch so it's apparently wrong. I'm curious how that could make modprobe work better for you as well, it shouldn't depend on that... Maybe `modprobe -r` might give a better error, or something in dmesg? -- Dominique