virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Zhang Tianci <zhangtianci.1997@bytedance.com>
Cc: jasowang@redhat.com, xuanzhuo@linux.alibaba.com,
	eperezma@redhat.com, virtualization@lists.linux.dev,
	xieyongji@bytedance.com
Subject: Re: virtio_pci: Question about virtio_pci kernel module refcnt
Date: Wed, 22 Oct 2025 07:31:29 -0400	[thread overview]
Message-ID: <20251022073015-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CAP4dvsfZEo+1+O8tpLFFh=s-fEFaMRu2+mQ3F=LJmjoEHyZXMw@mail.gmail.com>

On Wed, Oct 22, 2025 at 07:21:45PM +0800, Zhang Tianci wrote:
> Hi,
> I noticed that the reference count of the virtio_pci kernel module
> in the VM is always 0, even though there are at least two
> virtio block devices and one virtiofs device in the VM.
> 
> Using rmmod virtio_pci can unload the virtio_pci module,
> but this renders the virtio block devices unusable.

it removes them. you can put it back in and you will
get devices again.

> I wonder if this result is expected? Why don't the virtio block devices
> and virtiofs device hold a reference count to the virtio_pci kernel module?

because they don't have to.

-- 
MST


  reply	other threads:[~2025-10-22 11:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22 11:21 virtio_pci: Question about virtio_pci kernel module refcnt Zhang Tianci
2025-10-22 11:31 ` Michael S. Tsirkin [this message]
2025-10-23  2:34   ` [External] " Zhang Tianci
2025-10-24  1:53     ` Jason Wang
2025-10-24  2:34       ` Zhang Tianci
2025-10-24  4:00         ` Jason Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251022073015-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=virtualization@lists.linux.dev \
    --cc=xieyongji@bytedance.com \
    --cc=xuanzhuo@linux.alibaba.com \
    --cc=zhangtianci.1997@bytedance.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).