From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Wang Subject: Re: [PATCH kernel v8 3/4] mm: add inerface to offer info about unused pages Date: Thu, 13 Apr 2017 19:07:57 +0800 Message-ID: <58EF5C0D.60603@intel.com> References: <1489648127-37282-1-git-send-email-wei.w.wang@intel.com> <1489648127-37282-4-git-send-email-wei.w.wang@intel.com> <20170316142842.69770813b98df70277431b1e@linux-foundation.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, mst@redhat.com, david@redhat.com, dave.hansen@intel.com, cornelia.huck@de.ibm.com, mgorman@techsingularity.net, aarcange@redhat.com, amit.shah@redhat.com, pbonzini@redhat.com, liliang.opensource@gmail.com To: Andrew Morton Return-path: Sender: List-Post: List-Help: List-Unsubscribe: List-Subscribe: In-Reply-To: <20170316142842.69770813b98df70277431b1e@linux-foundation.org> List-Id: kvm.vger.kernel.org On 03/17/2017 05:28 AM, Andrew Morton wrote: > On Thu, 16 Mar 2017 15:08:46 +0800 Wei Wang wrote: > >> From: Liang Li >> >> This patch adds a function to provides a snapshot of the present system >> unused pages. An important usage of this function is to provide the >> unsused pages to the Live migration thread, which skips the transfer of >> thoses unused pages. Newly used pages can be re-tracked by the dirty >> page logging mechanisms. > I don't think this will be useful for anything other than > virtio-balloon. I guess it would be better to keep this code in the > virtio-balloon driver if possible, even though that's rather a layering > violation :( What would have to be done to make that possible? Perhaps > we can put some *small* helpers into page_alloc.c to prevent things > from becoming too ugly. > > Thanks for the suggestion. Small helpers do look more elegant. The nice thing is that I also didn't see any performance loss. To make that possible, we need to enable for_each_polulated_zone() to be callable by a kernel module. Please have a check the v9 patches that I just posted out. Best, Wei 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 02EFF6B0390 for ; Thu, 13 Apr 2017 07:06:19 -0400 (EDT) Received: by mail-pg0-f71.google.com with SMTP id m1so31730447pgd.13 for ; Thu, 13 Apr 2017 04:06:18 -0700 (PDT) Received: from mga11.intel.com (mga11.intel.com. [192.55.52.93]) by mx.google.com with ESMTPS id c17si23659925pgh.23.2017.04.13.04.06.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Apr 2017 04:06:18 -0700 (PDT) Message-ID: <58EF5C0D.60603@intel.com> Date: Thu, 13 Apr 2017 19:07:57 +0800 From: Wei Wang MIME-Version: 1.0 Subject: Re: [PATCH kernel v8 3/4] mm: add inerface to offer info about unused pages References: <1489648127-37282-1-git-send-email-wei.w.wang@intel.com> <1489648127-37282-4-git-send-email-wei.w.wang@intel.com> <20170316142842.69770813b98df70277431b1e@linux-foundation.org> In-Reply-To: <20170316142842.69770813b98df70277431b1e@linux-foundation.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton 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, mst@redhat.com, david@redhat.com, dave.hansen@intel.com, cornelia.huck@de.ibm.com, mgorman@techsingularity.net, aarcange@redhat.com, amit.shah@redhat.com, pbonzini@redhat.com, liliang.opensource@gmail.com On 03/17/2017 05:28 AM, Andrew Morton wrote: > On Thu, 16 Mar 2017 15:08:46 +0800 Wei Wang wrote: > >> From: Liang Li >> >> This patch adds a function to provides a snapshot of the present system >> unused pages. An important usage of this function is to provide the >> unsused pages to the Live migration thread, which skips the transfer of >> thoses unused pages. Newly used pages can be re-tracked by the dirty >> page logging mechanisms. > I don't think this will be useful for anything other than > virtio-balloon. I guess it would be better to keep this code in the > virtio-balloon driver if possible, even though that's rather a layering > violation :( What would have to be done to make that possible? Perhaps > we can put some *small* helpers into page_alloc.c to prevent things > from becoming too ugly. > > Thanks for the suggestion. Small helpers do look more elegant. The nice thing is that I also didn't see any performance loss. To make that possible, we need to enable for_each_polulated_zone() to be callable by a kernel module. Please have a check the v9 patches that I just posted out. 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 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cycZy-0005mC-8c for qemu-devel@nongnu.org; Thu, 13 Apr 2017 07:06:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cycZv-0000h9-4M for qemu-devel@nongnu.org; Thu, 13 Apr 2017 07:06:22 -0400 Received: from mga01.intel.com ([192.55.52.88]:22970) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cycZu-0000gA-Qs for qemu-devel@nongnu.org; Thu, 13 Apr 2017 07:06:19 -0400 Message-ID: <58EF5C0D.60603@intel.com> Date: Thu, 13 Apr 2017 19:07:57 +0800 From: Wei Wang MIME-Version: 1.0 References: <1489648127-37282-1-git-send-email-wei.w.wang@intel.com> <1489648127-37282-4-git-send-email-wei.w.wang@intel.com> <20170316142842.69770813b98df70277431b1e@linux-foundation.org> In-Reply-To: <20170316142842.69770813b98df70277431b1e@linux-foundation.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH kernel v8 3/4] mm: add inerface to offer info about unused pages List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andrew Morton 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, mst@redhat.com, david@redhat.com, dave.hansen@intel.com, cornelia.huck@de.ibm.com, mgorman@techsingularity.net, aarcange@redhat.com, amit.shah@redhat.com, pbonzini@redhat.com, liliang.opensource@gmail.com On 03/17/2017 05:28 AM, Andrew Morton wrote: > On Thu, 16 Mar 2017 15:08:46 +0800 Wei Wang wrote: > >> From: Liang Li >> >> This patch adds a function to provides a snapshot of the present system >> unused pages. An important usage of this function is to provide the >> unsused pages to the Live migration thread, which skips the transfer of >> thoses unused pages. Newly used pages can be re-tracked by the dirty >> page logging mechanisms. > I don't think this will be useful for anything other than > virtio-balloon. I guess it would be better to keep this code in the > virtio-balloon driver if possible, even though that's rather a layering > violation :( What would have to be done to make that possible? Perhaps > we can put some *small* helpers into page_alloc.c to prevent things > from becoming too ugly. > > Thanks for the suggestion. Small helpers do look more elegant. The nice thing is that I also didn't see any performance loss. To make that possible, we need to enable for_each_polulated_zone() to be callable by a kernel module. Please have a check the v9 patches that I just posted out. Best, Wei