From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751360AbdARFAT convert rfc822-to-8bit (ORCPT ); Wed, 18 Jan 2017 00:00:19 -0500 Received: from mga07.intel.com ([134.134.136.100]:55699 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750712AbdARFAR (ORCPT ); Wed, 18 Jan 2017 00:00:17 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,247,1477983600"; d="scan'208";a="923781544" From: "Li, Liang Z" To: "Michael S. Tsirkin" CC: "kvm@vger.kernel.org" , "virtio-dev@lists.oasis-open.org" , "qemu-devel@nongnu.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "amit.shah@redhat.com" , "Hansen, Dave" , "cornelia.huck@de.ibm.com" , "pbonzini@redhat.com" , "david@redhat.com" , "aarcange@redhat.com" , "dgilbert@redhat.com" , "quintela@redhat.com" Subject: RE: [PATCH v6 kernel 3/5] virtio-balloon: speed up inflate/deflate process Thread-Topic: [PATCH v6 kernel 3/5] virtio-balloon: speed up inflate/deflate process Thread-Index: AQHSW1evV/kH7yiC1ku9/YmVsAmoeKE8r2iAgAElHsA= Date: Wed, 18 Jan 2017 04:56:58 +0000 Message-ID: References: <1482303148-22059-1-git-send-email-liang.z.li@intel.com> <1482303148-22059-4-git-send-email-liang.z.li@intel.com> <20170117211131-mutt-send-email-mst@kernel.org> In-Reply-To: <20170117211131-mutt-send-email-mst@kernel.org> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > - virtqueue_add_outbuf(vq, &sg, 1, vb, GFP_KERNEL); > > - virtqueue_kick(vq); > > +static void do_set_resp_bitmap(struct virtio_balloon *vb, > > + unsigned long base_pfn, int pages) > > > > - /* When host has read buffer, this completes via balloon_ack */ > > - wait_event(vb->acked, virtqueue_get_buf(vq, &len)); > > +{ > > + __le64 *range = vb->resp_data + vb->resp_pos; > > > > + if (pages > (1 << VIRTIO_BALLOON_NR_PFN_BITS)) { > > + /* when the length field can't contain pages, set it to 0 to > > /* > * Multi-line > * comments > * should look like this. > */ > > Also, pls start sentences with an upper-case letter. > Sorry for that. > > + * indicate the actual length is in the next __le64; > > + */ > > This is part of the interface so should be documented as such. > > > + *range = cpu_to_le64((base_pfn << > > + VIRTIO_BALLOON_NR_PFN_BITS) | 0); > > + *(range + 1) = cpu_to_le64(pages); > > + vb->resp_pos += 2; > > Pls use structs for this kind of stuff. I am not sure if you mean to use struct range { __le64 pfn: 52; __le64 nr_page: 12 } Instead of the shift operation? I didn't use this way because I don't want to include 'virtio-balloon.h' in page_alloc.c, or copy the define of this struct in page_alloc.c Thanks! Liang From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Li, Liang Z" Subject: RE: [PATCH v6 kernel 3/5] virtio-balloon: speed up inflate/deflate process Date: Wed, 18 Jan 2017 04:56:58 +0000 Message-ID: References: <1482303148-22059-1-git-send-email-liang.z.li@intel.com> <1482303148-22059-4-git-send-email-liang.z.li@intel.com> <20170117211131-mutt-send-email-mst@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "kvm@vger.kernel.org" , "virtio-dev@lists.oasis-open.org" , "qemu-devel@nongnu.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "amit.shah@redhat.com" , "Hansen, Dave" , "cornelia.huck@de.ibm.com" , "pbonzini@redhat.com" , "david@redhat.com" , "aarcange@redhat.com" , "dgilbert@redhat.com" , "quintela@redhat.com" To: "Michael S. Tsirkin" Return-path: Sender: List-Post: List-Help: List-Unsubscribe: List-Subscribe: In-Reply-To: <20170117211131-mutt-send-email-mst@kernel.org> Content-Language: en-US List-Id: kvm.vger.kernel.org > > - virtqueue_add_outbuf(vq, &sg, 1, vb, GFP_KERNEL); > > - virtqueue_kick(vq); > > +static void do_set_resp_bitmap(struct virtio_balloon *vb, > > + unsigned long base_pfn, int pages) > > > > - /* When host has read buffer, this completes via balloon_ack */ > > - wait_event(vb->acked, virtqueue_get_buf(vq, &len)); > > +{ > > + __le64 *range =3D vb->resp_data + vb->resp_pos; > > > > + if (pages > (1 << VIRTIO_BALLOON_NR_PFN_BITS)) { > > + /* when the length field can't contain pages, set it to 0 to >=20 > /* > * Multi-line > * comments > * should look like this. > */ >=20 > Also, pls start sentences with an upper-case letter. >=20 Sorry for that. > > + * indicate the actual length is in the next __le64; > > + */ >=20 > This is part of the interface so should be documented as such. >=20 > > + *range =3D cpu_to_le64((base_pfn << > > + VIRTIO_BALLOON_NR_PFN_BITS) | 0); > > + *(range + 1) =3D cpu_to_le64(pages); > > + vb->resp_pos +=3D 2; >=20 > Pls use structs for this kind of stuff. I am not sure if you mean to use=20 struct range { __le64 pfn: 52; __le64 nr_page: 12 } Instead of the shift operation? I didn't use this way because I don't want to include 'virtio-balloon.h' in= page_alloc.c, or copy the define of this struct in page_alloc.c Thanks! Liang From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f71.google.com (mail-pg0-f71.google.com [74.125.83.71]) by kanga.kvack.org (Postfix) with ESMTP id CEDBB6B0033 for ; Tue, 17 Jan 2017 23:57:03 -0500 (EST) Received: by mail-pg0-f71.google.com with SMTP id 194so3634651pgd.7 for ; Tue, 17 Jan 2017 20:57:03 -0800 (PST) Received: from mga11.intel.com (mga11.intel.com. [192.55.52.93]) by mx.google.com with ESMTPS id 10si10474720pgg.262.2017.01.17.20.57.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jan 2017 20:57:02 -0800 (PST) From: "Li, Liang Z" Subject: RE: [PATCH v6 kernel 3/5] virtio-balloon: speed up inflate/deflate process Date: Wed, 18 Jan 2017 04:56:58 +0000 Message-ID: References: <1482303148-22059-1-git-send-email-liang.z.li@intel.com> <1482303148-22059-4-git-send-email-liang.z.li@intel.com> <20170117211131-mutt-send-email-mst@kernel.org> In-Reply-To: <20170117211131-mutt-send-email-mst@kernel.org> Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: owner-linux-mm@kvack.org List-ID: To: "Michael S. Tsirkin" Cc: "kvm@vger.kernel.org" , "virtio-dev@lists.oasis-open.org" , "qemu-devel@nongnu.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "amit.shah@redhat.com" , "Hansen, Dave" , "cornelia.huck@de.ibm.com" , "pbonzini@redhat.com" , "david@redhat.com" , "aarcange@redhat.com" , "dgilbert@redhat.com" , "quintela@redhat.com" > > - virtqueue_add_outbuf(vq, &sg, 1, vb, GFP_KERNEL); > > - virtqueue_kick(vq); > > +static void do_set_resp_bitmap(struct virtio_balloon *vb, > > + unsigned long base_pfn, int pages) > > > > - /* When host has read buffer, this completes via balloon_ack */ > > - wait_event(vb->acked, virtqueue_get_buf(vq, &len)); > > +{ > > + __le64 *range =3D vb->resp_data + vb->resp_pos; > > > > + if (pages > (1 << VIRTIO_BALLOON_NR_PFN_BITS)) { > > + /* when the length field can't contain pages, set it to 0 to >=20 > /* > * Multi-line > * comments > * should look like this. > */ >=20 > Also, pls start sentences with an upper-case letter. >=20 Sorry for that. > > + * indicate the actual length is in the next __le64; > > + */ >=20 > This is part of the interface so should be documented as such. >=20 > > + *range =3D cpu_to_le64((base_pfn << > > + VIRTIO_BALLOON_NR_PFN_BITS) | 0); > > + *(range + 1) =3D cpu_to_le64(pages); > > + vb->resp_pos +=3D 2; >=20 > Pls use structs for this kind of stuff. I am not sure if you mean to use=20 struct range { __le64 pfn: 52; __le64 nr_page: 12 } Instead of the shift operation? I didn't use this way because I don't want to include 'virtio-balloon.h' in= page_alloc.c, or copy the define of this struct in page_alloc.c Thanks! Liang -- 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]:38448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTiJ3-00038Q-J9 for qemu-devel@nongnu.org; Tue, 17 Jan 2017 23:57:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cTiJ0-0007z3-AJ for qemu-devel@nongnu.org; Tue, 17 Jan 2017 23:57:09 -0500 Received: from mga05.intel.com ([192.55.52.43]:26981) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cTiJ0-0007yQ-11 for qemu-devel@nongnu.org; Tue, 17 Jan 2017 23:57:06 -0500 From: "Li, Liang Z" Date: Wed, 18 Jan 2017 04:56:58 +0000 Message-ID: References: <1482303148-22059-1-git-send-email-liang.z.li@intel.com> <1482303148-22059-4-git-send-email-liang.z.li@intel.com> <20170117211131-mutt-send-email-mst@kernel.org> In-Reply-To: <20170117211131-mutt-send-email-mst@kernel.org> Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v6 kernel 3/5] virtio-balloon: speed up inflate/deflate process List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: "kvm@vger.kernel.org" , "virtio-dev@lists.oasis-open.org" , "qemu-devel@nongnu.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "amit.shah@redhat.com" , "Hansen, Dave" , "cornelia.huck@de.ibm.com" , "pbonzini@redhat.com" , "david@redhat.com" , "aarcange@redhat.com" , "dgilbert@redhat.com" , "quintela@redhat.com" > > - virtqueue_add_outbuf(vq, &sg, 1, vb, GFP_KERNEL); > > - virtqueue_kick(vq); > > +static void do_set_resp_bitmap(struct virtio_balloon *vb, > > + unsigned long base_pfn, int pages) > > > > - /* When host has read buffer, this completes via balloon_ack */ > > - wait_event(vb->acked, virtqueue_get_buf(vq, &len)); > > +{ > > + __le64 *range =3D vb->resp_data + vb->resp_pos; > > > > + if (pages > (1 << VIRTIO_BALLOON_NR_PFN_BITS)) { > > + /* when the length field can't contain pages, set it to 0 to >=20 > /* > * Multi-line > * comments > * should look like this. > */ >=20 > Also, pls start sentences with an upper-case letter. >=20 Sorry for that. > > + * indicate the actual length is in the next __le64; > > + */ >=20 > This is part of the interface so should be documented as such. >=20 > > + *range =3D cpu_to_le64((base_pfn << > > + VIRTIO_BALLOON_NR_PFN_BITS) | 0); > > + *(range + 1) =3D cpu_to_le64(pages); > > + vb->resp_pos +=3D 2; >=20 > Pls use structs for this kind of stuff. I am not sure if you mean to use=20 struct range { __le64 pfn: 52; __le64 nr_page: 12 } Instead of the shift operation? I didn't use this way because I don't want to include 'virtio-balloon.h' in= page_alloc.c, or copy the define of this struct in page_alloc.c Thanks! Liang