From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Subject: Re: [RFC] kvm: x86: export vCPU halted state to sysfs Date: Fri, 2 Feb 2018 12:49:25 +0000 Message-ID: <20180202124925.GB15403@redhat.com> References: <20180201125441.2f5b4fdd@redhat.com> Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: kvm@vger.kernel.org, pbonzini@redhat.com, rkrcmar@redhat.com, ehabkost@redhat.com To: Luiz Capitulino Return-path: Received: from mx1.redhat.com ([209.132.183.28]:50058 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751416AbeBBMtc (ORCPT ); Fri, 2 Feb 2018 07:49:32 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8BE7A81DF2 for ; Fri, 2 Feb 2018 12:49:32 +0000 (UTC) Content-Disposition: inline In-Reply-To: <20180201125441.2f5b4fdd@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Feb 01, 2018 at 12:54:41PM -0500, Luiz Capitulino wrote: > > Libvirt needs to know when a vCPU is halted. To get this information, > libvirt has started using the query-cpus command from QEMU. However, > if in kernel irqchip is in use, query-cpus will force all vCPUs > to user-space since they have to issue the KVM_GET_MP_STATE ioctl. > This has catastrophic implications to low-latency workloads like > KVM-RT and zero packet loss with DPDK. To make matters worse, there's > an OpenStack service called ceilometer that causes libvirt to > issue query-cpus every few minutes. > > The solution proposed in this patch is to export the vCPU > halted state in the already existing vcpu directory in sysfs. > This way, libvirt can read the vCPU halted state from sysfs and avoid > using the query-cpus command. This solution seems to be sufficient > for libvirt needs, but it has the following cons: > > * vcpu information in sysfs lives in a debug directory, so > libvirt would be basing its API on debug info Is this part of regular sysfs mount point, or does it require a debug fs to be mounted separately at /sys/fs/debug ? > * Currently, only x86 supports the vcpu dir in sysfs, so > we'd have to expand this to other archs (should be doable) Yep, that would be fairly important Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|