From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: virtio-dev-return-2616-cohuck=redhat.com@lists.oasis-open.org Sender: List-Post: List-Help: List-Unsubscribe: List-Subscribe: Received: from lists.oasis-open.org (oasis-open.org [66.179.20.138]) by lists.oasis-open.org (Postfix) with ESMTP id C33D85818F38 for ; Thu, 19 Oct 2017 01:05:06 -0700 (PDT) Message-ID: <59E85D2A.1060407@intel.com> Date: Thu, 19 Oct 2017 16:07:06 +0800 From: Wei Wang MIME-Version: 1.0 References: <1506744354-20979-1-git-send-email-wei.w.wang@intel.com> <1506744354-20979-6-git-send-email-wei.w.wang@intel.com> <20171001060305-mutt-send-email-mst@kernel.org> <286AC319A985734F985F78AFA26841F73932025A@shsmsx102.ccr.corp.intel.com> <20171010180636-mutt-send-email-mst@kernel.org> <59DDB428.4020208@intel.com> <20171011161912-mutt-send-email-mst@kernel.org> <59DEE790.5040809@intel.com> <20171013163503-mutt-send-email-mst@kernel.org> In-Reply-To: <20171013163503-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: [virtio-dev] Re: [PATCH v16 5/5] virtio-balloon: VIRTIO_BALLOON_F_CTRL_VQ To: "Michael S. Tsirkin" Cc: "virtio-dev@lists.oasis-open.org" , "linux-kernel@vger.kernel.org" , "qemu-devel@nongnu.org" , "virtualization@lists.linux-foundation.org" , "kvm@vger.kernel.org" , "linux-mm@kvack.org" , "mhocko@kernel.org" , "akpm@linux-foundation.org" , "mawilcox@microsoft.com" , "david@redhat.com" , "cornelia.huck@de.ibm.com" , "mgorman@techsingularity.net" , "aarcange@redhat.com" , "amit.shah@redhat.com" , "pbonzini@redhat.com" , "willy@infradead.org" , "liliang.opensource@gmail.com" , "yang.zhang.wz@gmail.com" , "quan.xu@aliyun.com" List-ID: On 10/13/2017 09:38 PM, Michael S. Tsirkin wrote: > On Thu, Oct 12, 2017 at 11:54:56AM +0800, Wei Wang wrote: >>> But I think flushing is very fragile. You will easily run into races >>> if one of the actors gets out of sync and keeps adding data. >>> I think adding an ID in the free vq stream is a more robust >>> approach. >>> >> Adding ID to the free vq would need the device to distinguish whether it >> receives an ID or a free page hint, > Not really. It's pretty simple: a 64 bit buffer is an ID. A 4K and bigger one > is a page. I think we can also use the previous method, free page via in_buf, and id via out_buf. Best, Wei --------------------------------------------------------------------- To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Wang Subject: Re: [PATCH v16 5/5] virtio-balloon: VIRTIO_BALLOON_F_CTRL_VQ Date: Thu, 19 Oct 2017 16:07:06 +0800 Message-ID: <59E85D2A.1060407@intel.com> References: <1506744354-20979-1-git-send-email-wei.w.wang@intel.com> <1506744354-20979-6-git-send-email-wei.w.wang@intel.com> <20171001060305-mutt-send-email-mst@kernel.org> <286AC319A985734F985F78AFA26841F73932025A@shsmsx102.ccr.corp.intel.com> <20171010180636-mutt-send-email-mst@kernel.org> <59DDB428.4020208@intel.com> <20171011161912-mutt-send-email-mst@kernel.org> <59DEE790.5040809@intel.com> <20171013163503-mutt-send-email-mst@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: "virtio-dev@lists.oasis-open.org" , "linux-kernel@vger.kernel.org" , "qemu-devel@nongnu.org" , "virtualization@lists.linux-foundation.org" , "kvm@vger.kernel.org" , "linux-mm@kvack.org" , "mhocko@kernel.org" , "akpm@linux-foundation.org" , "mawilcox@microsoft.com" , "david@redhat.com" , "cornelia.huck@de.ibm.com" , "mgorman@techsingularity.net" , "aarcange@redhat.com" , "amit.shah@redhat.com" , "pbonzini@redhat.com" , "willy@infradead.org" , "liliang.opensource@gmail.co To: "Michael S. Tsirkin" Return-path: In-Reply-To: <20171013163503-mutt-send-email-mst@kernel.org> Sender: owner-linux-mm@kvack.org List-Id: kvm.vger.kernel.org On 10/13/2017 09:38 PM, Michael S. Tsirkin wrote: > On Thu, Oct 12, 2017 at 11:54:56AM +0800, Wei Wang wrote: >>> But I think flushing is very fragile. You will easily run into races >>> if one of the actors gets out of sync and keeps adding data. >>> I think adding an ID in the free vq stream is a more robust >>> approach. >>> >> Adding ID to the free vq would need the device to distinguish whether it >> receives an ID or a free page hint, > Not really. It's pretty simple: a 64 bit buffer is an ID. A 4K and bigger one > is a page. I think we can also use the previous method, free page via in_buf, and id via out_buf. Best, Wei -- 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 Return-Path: Received: from mail-pg0-f70.google.com (mail-pg0-f70.google.com [74.125.83.70]) by kanga.kvack.org (Postfix) with ESMTP id 27CD96B0033 for ; Thu, 19 Oct 2017 04:05:06 -0400 (EDT) Received: by mail-pg0-f70.google.com with SMTP id p9so6194115pgc.6 for ; Thu, 19 Oct 2017 01:05:06 -0700 (PDT) Received: from mga01.intel.com (mga01.intel.com. [192.55.52.88]) by mx.google.com with ESMTPS id m66si4209600pfb.72.2017.10.19.01.05.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Oct 2017 01:05:05 -0700 (PDT) Message-ID: <59E85D2A.1060407@intel.com> Date: Thu, 19 Oct 2017 16:07:06 +0800 From: Wei Wang MIME-Version: 1.0 Subject: Re: [PATCH v16 5/5] virtio-balloon: VIRTIO_BALLOON_F_CTRL_VQ References: <1506744354-20979-1-git-send-email-wei.w.wang@intel.com> <1506744354-20979-6-git-send-email-wei.w.wang@intel.com> <20171001060305-mutt-send-email-mst@kernel.org> <286AC319A985734F985F78AFA26841F73932025A@shsmsx102.ccr.corp.intel.com> <20171010180636-mutt-send-email-mst@kernel.org> <59DDB428.4020208@intel.com> <20171011161912-mutt-send-email-mst@kernel.org> <59DEE790.5040809@intel.com> <20171013163503-mutt-send-email-mst@kernel.org> In-Reply-To: <20171013163503-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: "Michael S. Tsirkin" Cc: "virtio-dev@lists.oasis-open.org" , "linux-kernel@vger.kernel.org" , "qemu-devel@nongnu.org" , "virtualization@lists.linux-foundation.org" , "kvm@vger.kernel.org" , "linux-mm@kvack.org" , "mhocko@kernel.org" , "akpm@linux-foundation.org" , "mawilcox@microsoft.com" , "david@redhat.com" , "cornelia.huck@de.ibm.com" , "mgorman@techsingularity.net" , "aarcange@redhat.com" , "amit.shah@redhat.com" , "pbonzini@redhat.com" , "willy@infradead.org" , "liliang.opensource@gmail.com" , "yang.zhang.wz@gmail.com" , "quan.xu@aliyun.com" On 10/13/2017 09:38 PM, Michael S. Tsirkin wrote: > On Thu, Oct 12, 2017 at 11:54:56AM +0800, Wei Wang wrote: >>> But I think flushing is very fragile. You will easily run into races >>> if one of the actors gets out of sync and keeps adding data. >>> I think adding an ID in the free vq stream is a more robust >>> approach. >>> >> Adding ID to the free vq would need the device to distinguish whether it >> receives an ID or a free page hint, > Not really. It's pretty simple: a 64 bit buffer is an ID. A 4K and bigger one > is a page. I think we can also use the previous method, free page via in_buf, and id via out_buf. Best, Wei -- 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 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752136AbdJSIF2 (ORCPT ); Thu, 19 Oct 2017 04:05:28 -0400 Received: from mga03.intel.com ([134.134.136.65]:38557 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752006AbdJSIFV (ORCPT ); Thu, 19 Oct 2017 04:05:21 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,400,1503385200"; d="scan'208";a="164902189" Message-ID: <59E85D2A.1060407@intel.com> Date: Thu, 19 Oct 2017 16:07:06 +0800 From: Wei Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "Michael S. Tsirkin" CC: "virtio-dev@lists.oasis-open.org" , "linux-kernel@vger.kernel.org" , "qemu-devel@nongnu.org" , "virtualization@lists.linux-foundation.org" , "kvm@vger.kernel.org" , "linux-mm@kvack.org" , "mhocko@kernel.org" , "akpm@linux-foundation.org" , "mawilcox@microsoft.com" , "david@redhat.com" , "cornelia.huck@de.ibm.com" , "mgorman@techsingularity.net" , "aarcange@redhat.com" , "amit.shah@redhat.com" , "pbonzini@redhat.com" , "willy@infradead.org" , "liliang.opensource@gmail.com" , "yang.zhang.wz@gmail.com" , "quan.xu@aliyun.com" Subject: Re: [PATCH v16 5/5] virtio-balloon: VIRTIO_BALLOON_F_CTRL_VQ References: <1506744354-20979-1-git-send-email-wei.w.wang@intel.com> <1506744354-20979-6-git-send-email-wei.w.wang@intel.com> <20171001060305-mutt-send-email-mst@kernel.org> <286AC319A985734F985F78AFA26841F73932025A@shsmsx102.ccr.corp.intel.com> <20171010180636-mutt-send-email-mst@kernel.org> <59DDB428.4020208@intel.com> <20171011161912-mutt-send-email-mst@kernel.org> <59DEE790.5040809@intel.com> <20171013163503-mutt-send-email-mst@kernel.org> In-Reply-To: <20171013163503-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/13/2017 09:38 PM, Michael S. Tsirkin wrote: > On Thu, Oct 12, 2017 at 11:54:56AM +0800, Wei Wang wrote: >>> But I think flushing is very fragile. You will easily run into races >>> if one of the actors gets out of sync and keeps adding data. >>> I think adding an ID in the free vq stream is a more robust >>> approach. >>> >> Adding ID to the free vq would need the device to distinguish whether it >> receives an ID or a free page hint, > Not really. It's pretty simple: a 64 bit buffer is an ID. A 4K and bigger one > is a page. I think we can also use the previous method, free page via in_buf, and id via out_buf. Best, Wei From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e55pI-0007ua-Jr for qemu-devel@nongnu.org; Thu, 19 Oct 2017 04:05:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e55pD-0004bo-0h for qemu-devel@nongnu.org; Thu, 19 Oct 2017 04:05:12 -0400 Received: from mga11.intel.com ([192.55.52.93]:45861) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e55pC-0004bI-MU for qemu-devel@nongnu.org; Thu, 19 Oct 2017 04:05:06 -0400 Message-ID: <59E85D2A.1060407@intel.com> Date: Thu, 19 Oct 2017 16:07:06 +0800 From: Wei Wang MIME-Version: 1.0 References: <1506744354-20979-1-git-send-email-wei.w.wang@intel.com> <1506744354-20979-6-git-send-email-wei.w.wang@intel.com> <20171001060305-mutt-send-email-mst@kernel.org> <286AC319A985734F985F78AFA26841F73932025A@shsmsx102.ccr.corp.intel.com> <20171010180636-mutt-send-email-mst@kernel.org> <59DDB428.4020208@intel.com> <20171011161912-mutt-send-email-mst@kernel.org> <59DEE790.5040809@intel.com> <20171013163503-mutt-send-email-mst@kernel.org> In-Reply-To: <20171013163503-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v16 5/5] virtio-balloon: VIRTIO_BALLOON_F_CTRL_VQ List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: "virtio-dev@lists.oasis-open.org" , "linux-kernel@vger.kernel.org" , "qemu-devel@nongnu.org" , "virtualization@lists.linux-foundation.org" , "kvm@vger.kernel.org" , "linux-mm@kvack.org" , "mhocko@kernel.org" , "akpm@linux-foundation.org" , "mawilcox@microsoft.com" , "david@redhat.com" , "cornelia.huck@de.ibm.com" , "mgorman@techsingularity.net" , "aarcange@redhat.com" , "amit.shah@redhat.com" , "pbonzini@redhat.com" , "willy@infradead.org" , "liliang.opensource@gmail.com" , "yang.zhang.wz@gmail.com" , "quan.xu@aliyun.com" On 10/13/2017 09:38 PM, Michael S. Tsirkin wrote: > On Thu, Oct 12, 2017 at 11:54:56AM +0800, Wei Wang wrote: >>> But I think flushing is very fragile. You will easily run into races >>> if one of the actors gets out of sync and keeps adding data. >>> I think adding an ID in the free vq stream is a more robust >>> approach. >>> >> Adding ID to the free vq would need the device to distinguish whether it >> receives an ID or a free page hint, > Not really. It's pretty simple: a 64 bit buffer is an ID. A 4K and bigger one > is a page. I think we can also use the previous method, free page via in_buf, and id via out_buf. Best, Wei