From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bmailout1.hostsharing.net (bmailout1.hostsharing.net [83.223.95.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20D178465; Thu, 28 Dec 2023 13:18:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=h08.hostsharing.net Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS RSA CA G1" (verified OK)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id A42FD3000D5B0; Thu, 28 Dec 2023 14:18:02 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 964802913A9; Thu, 28 Dec 2023 14:18:02 +0100 (CET) Date: Thu, 28 Dec 2023 14:18:02 +0100 From: Lukas Wunner To: Steven Haigh Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, f.ebner@proxmox.com Subject: Re: Qemu KVM thread spins at 100% CPU usage on scsi hot-unplug (kernel 6.6.8 guest) Message-ID: <20231228131802.GA21994@wunner.de> References: <3a7656ab-df4c-4d57-8866-661beffcddd7@crc.id.au> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3a7656ab-df4c-4d57-8866-661beffcddd7@crc.id.au> User-Agent: Mutt/1.10.1 (2018-07-13) On Thu, Dec 28, 2023 at 01:03:10PM +1100, Steven Haigh wrote: > At some point in kernel 6.6.x, SCSI hotplug in qemu VMs broke. This was > mostly fixed in the following commit to release 6.6.8: > commit 5cc8d88a1b94b900fd74abda744c29ff5845430b > Author: Bjorn Helgaas > Date: Thu Dec 14 09:08:56 2023 -0600 > Revert "PCI: acpiphp: Reassign resources on bridge if necessary" > > After this commit, the SCSI block device is hotplugged correctly, and a device node as /dev/sdX appears within the qemu VM. > > New problem: > > When the same SCSI block device is hot-unplugged, the QEMU KVM process will > spin at 100% CPU usage. The guest shows no CPU being used via top, but the > host will continue to spin in the KVM thread until the VM is rebooted. Find out the PID of the qemu process on the host, then cat /proc/$PID/stack to see where the CPU time is spent.