From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752506AbdDMLGT (ORCPT ); Thu, 13 Apr 2017 07:06:19 -0400 Received: from mga04.intel.com ([192.55.52.120]:32716 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750952AbdDMLGS (ORCPT ); Thu, 13 Apr 2017 07:06:18 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,194,1488873600"; d="scan'208";a="1134981318" Message-ID: <58EF5C0D.60603@intel.com> Date: Thu, 13 Apr 2017 19:07:57 +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: 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 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: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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