From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030292AbcJ0SjJ (ORCPT ); Thu, 27 Oct 2016 14:39:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45102 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934208AbcJ0SjG (ORCPT ); Thu, 27 Oct 2016 14:39:06 -0400 Date: Thu, 27 Oct 2016 21:29:38 +0300 From: "Michael S. Tsirkin" To: Liang Li Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-mm@kvack.org, virtio-dev@lists.oasis-open.org, kvm@vger.kernel.org, qemu-devel@nongnu.org, quintela@redhat.com, dgilbert@redhat.com, dave.hansen@intel.com, pbonzini@redhat.com, cornelia.huck@de.ibm.com, amit.shah@redhat.com Subject: Re: [RESEND PATCH v3 kernel 6/7] virtio-balloon: define feature bit and head for misc virt queue Message-ID: <20161027211928-mutt-send-email-mst@kernel.org> References: <1477031080-12616-1-git-send-email-liang.z.li@intel.com> <1477031080-12616-7-git-send-email-liang.z.li@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1477031080-12616-7-git-send-email-liang.z.li@intel.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 27 Oct 2016 18:29:40 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 21, 2016 at 02:24:39PM +0800, Liang Li wrote: > Define a new feature bit which supports a new virtual queue. This > new virtual qeuque is for information exchange between hypervisor > and guest. The VMM hypervisor can make use of this virtual queue > to request the guest do some operations, e.g. drop page cache, > synchronize file system, etc. Can we call this something more informative pls? host request vq? > And the VMM hypervisor can get some > of guest's runtime information through this virtual queue, e.g. the > guest's unused page information, which can be used for live migration > optimization. I guess the idea is that guest gets requests from host and then responds to them on this vq. Pls document. > > Signed-off-by: Liang Li > Cc: Michael S. Tsirkin > Cc: Paolo Bonzini > Cc: Cornelia Huck > Cc: Amit Shah > --- > include/uapi/linux/virtio_balloon.h | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h > index d3b182a..3a9d633 100644 > --- a/include/uapi/linux/virtio_balloon.h > +++ b/include/uapi/linux/virtio_balloon.h > @@ -35,6 +35,7 @@ > #define VIRTIO_BALLOON_F_STATS_VQ 1 /* Memory Stats virtqueue */ > #define VIRTIO_BALLOON_F_DEFLATE_ON_OOM 2 /* Deflate balloon on OOM */ > #define VIRTIO_BALLOON_F_PAGE_BITMAP 3 /* Send page info with bitmap */ > +#define VIRTIO_BALLOON_F_MISC_VQ 4 /* Misc info virtqueue */ > > /* Size of a PFN in the balloon interface. */ > #define VIRTIO_BALLOON_PFN_SHIFT 12 > @@ -101,4 +102,25 @@ struct balloon_bmap_hdr { > __virtio64 bmap_len; > }; > > +enum balloon_req_id { > + /* Get unused pages information */ unused page information > + BALLOON_GET_UNUSED_PAGES, > +}; > + > +enum balloon_flag { > + /* Have more data for a request */ > + BALLOON_FLAG_CONT, > + /* No more data for a request */ > + BALLOON_FLAG_DONE, > +}; is this a bit number or a value? Pls name consistently. > + > +struct balloon_req_hdr { > + /* Used to distinguish different request */ requests > + __virtio16 cmd; > + /* Reserved */ > + __virtio16 reserved[3]; > + /* Request parameter */ > + __virtio64 param; > +}; > + > #endif /* _LINUX_VIRTIO_BALLOON_H */ Prefix structs with virtio_ as well pls. Also, wouldn't it simplify code if we use __le for new structs? > -- > 1.8.3.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [RESEND PATCH v3 kernel 6/7] virtio-balloon: define feature bit and head for misc virt queue Date: Thu, 27 Oct 2016 21:29:38 +0300 Message-ID: <20161027211928-mutt-send-email-mst@kernel.org> References: <1477031080-12616-1-git-send-email-liang.z.li@intel.com> <1477031080-12616-7-git-send-email-liang.z.li@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-mm@kvack.org, virtio-dev@lists.oasis-open.org, kvm@vger.kernel.org, qemu-devel@nongnu.org, quintela@redhat.com, dgilbert@redhat.com, dave.hansen@intel.com, pbonzini@redhat.com, cornelia.huck@de.ibm.com, amit.shah@redhat.com To: Liang Li Return-path: Content-Disposition: inline In-Reply-To: <1477031080-12616-7-git-send-email-liang.z.li@intel.com> Sender: owner-linux-mm@kvack.org List-Id: kvm.vger.kernel.org On Fri, Oct 21, 2016 at 02:24:39PM +0800, Liang Li wrote: > Define a new feature bit which supports a new virtual queue. This > new virtual qeuque is for information exchange between hypervisor > and guest. The VMM hypervisor can make use of this virtual queue > to request the guest do some operations, e.g. drop page cache, > synchronize file system, etc. Can we call this something more informative pls? host request vq? > And the VMM hypervisor can get some > of guest's runtime information through this virtual queue, e.g. the > guest's unused page information, which can be used for live migration > optimization. I guess the idea is that guest gets requests from host and then responds to them on this vq. Pls document. > > Signed-off-by: Liang Li > Cc: Michael S. Tsirkin > Cc: Paolo Bonzini > Cc: Cornelia Huck > Cc: Amit Shah > --- > include/uapi/linux/virtio_balloon.h | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h > index d3b182a..3a9d633 100644 > --- a/include/uapi/linux/virtio_balloon.h > +++ b/include/uapi/linux/virtio_balloon.h > @@ -35,6 +35,7 @@ > #define VIRTIO_BALLOON_F_STATS_VQ 1 /* Memory Stats virtqueue */ > #define VIRTIO_BALLOON_F_DEFLATE_ON_OOM 2 /* Deflate balloon on OOM */ > #define VIRTIO_BALLOON_F_PAGE_BITMAP 3 /* Send page info with bitmap */ > +#define VIRTIO_BALLOON_F_MISC_VQ 4 /* Misc info virtqueue */ > > /* Size of a PFN in the balloon interface. */ > #define VIRTIO_BALLOON_PFN_SHIFT 12 > @@ -101,4 +102,25 @@ struct balloon_bmap_hdr { > __virtio64 bmap_len; > }; > > +enum balloon_req_id { > + /* Get unused pages information */ unused page information > + BALLOON_GET_UNUSED_PAGES, > +}; > + > +enum balloon_flag { > + /* Have more data for a request */ > + BALLOON_FLAG_CONT, > + /* No more data for a request */ > + BALLOON_FLAG_DONE, > +}; is this a bit number or a value? Pls name consistently. > + > +struct balloon_req_hdr { > + /* Used to distinguish different request */ requests > + __virtio16 cmd; > + /* Reserved */ > + __virtio16 reserved[3]; > + /* Request parameter */ > + __virtio64 param; > +}; > + > #endif /* _LINUX_VIRTIO_BALLOON_H */ Prefix structs with virtio_ as well pls. Also, wouldn't it simplify code if we use __le for new structs? > -- > 1.8.3.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45275) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzpQs-00070u-Bx for qemu-devel@nongnu.org; Thu, 27 Oct 2016 14:29:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzpQr-0008B5-GK for qemu-devel@nongnu.org; Thu, 27 Oct 2016 14:29:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23088) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bzpQr-0008An-8G for qemu-devel@nongnu.org; Thu, 27 Oct 2016 14:29:41 -0400 Date: Thu, 27 Oct 2016 21:29:38 +0300 From: "Michael S. Tsirkin" Message-ID: <20161027211928-mutt-send-email-mst@kernel.org> References: <1477031080-12616-1-git-send-email-liang.z.li@intel.com> <1477031080-12616-7-git-send-email-liang.z.li@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1477031080-12616-7-git-send-email-liang.z.li@intel.com> Subject: Re: [Qemu-devel] [RESEND PATCH v3 kernel 6/7] virtio-balloon: define feature bit and head for misc virt queue List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liang Li Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-mm@kvack.org, virtio-dev@lists.oasis-open.org, kvm@vger.kernel.org, qemu-devel@nongnu.org, quintela@redhat.com, dgilbert@redhat.com, dave.hansen@intel.com, pbonzini@redhat.com, cornelia.huck@de.ibm.com, amit.shah@redhat.com On Fri, Oct 21, 2016 at 02:24:39PM +0800, Liang Li wrote: > Define a new feature bit which supports a new virtual queue. This > new virtual qeuque is for information exchange between hypervisor > and guest. The VMM hypervisor can make use of this virtual queue > to request the guest do some operations, e.g. drop page cache, > synchronize file system, etc. Can we call this something more informative pls? host request vq? > And the VMM hypervisor can get some > of guest's runtime information through this virtual queue, e.g. the > guest's unused page information, which can be used for live migration > optimization. I guess the idea is that guest gets requests from host and then responds to them on this vq. Pls document. > > Signed-off-by: Liang Li > Cc: Michael S. Tsirkin > Cc: Paolo Bonzini > Cc: Cornelia Huck > Cc: Amit Shah > --- > include/uapi/linux/virtio_balloon.h | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h > index d3b182a..3a9d633 100644 > --- a/include/uapi/linux/virtio_balloon.h > +++ b/include/uapi/linux/virtio_balloon.h > @@ -35,6 +35,7 @@ > #define VIRTIO_BALLOON_F_STATS_VQ 1 /* Memory Stats virtqueue */ > #define VIRTIO_BALLOON_F_DEFLATE_ON_OOM 2 /* Deflate balloon on OOM */ > #define VIRTIO_BALLOON_F_PAGE_BITMAP 3 /* Send page info with bitmap */ > +#define VIRTIO_BALLOON_F_MISC_VQ 4 /* Misc info virtqueue */ > > /* Size of a PFN in the balloon interface. */ > #define VIRTIO_BALLOON_PFN_SHIFT 12 > @@ -101,4 +102,25 @@ struct balloon_bmap_hdr { > __virtio64 bmap_len; > }; > > +enum balloon_req_id { > + /* Get unused pages information */ unused page information > + BALLOON_GET_UNUSED_PAGES, > +}; > + > +enum balloon_flag { > + /* Have more data for a request */ > + BALLOON_FLAG_CONT, > + /* No more data for a request */ > + BALLOON_FLAG_DONE, > +}; is this a bit number or a value? Pls name consistently. > + > +struct balloon_req_hdr { > + /* Used to distinguish different request */ requests > + __virtio16 cmd; > + /* Reserved */ > + __virtio16 reserved[3]; > + /* Request parameter */ > + __virtio64 param; > +}; > + > #endif /* _LINUX_VIRTIO_BALLOON_H */ Prefix structs with virtio_ as well pls. Also, wouldn't it simplify code if we use __le for new structs? > -- > 1.8.3.1