From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751938AbdGaIcT (ORCPT ); Mon, 31 Jul 2017 04:32:19 -0400 Received: from mga01.intel.com ([192.55.52.88]:32950 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750944AbdGaIcS (ORCPT ); Mon, 31 Jul 2017 04:32:18 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,441,1496127600"; d="scan'208";a="999053224" Message-ID: <597EEBB2.8080609@intel.com> Date: Mon, 31 Jul 2017 16:34:58 +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: Michal Hocko CC: linux-kernel@vger.kernel.org, linux-mm@kvack.org, virtualization@lists.linux-foundation.org, mst@redhat.com, mawilcox@microsoft.com, dave.hansen@intel.com, akpm@linux-foundation.org, zhenwei.pi@youruncloud.com Subject: Re: [PATCH] mm: don't zero ballooned pages References: <1501474413-21580-1-git-send-email-wei.w.wang@intel.com> <20170731065508.GE13036@dhcp22.suse.cz> <597EDF3D.8020101@intel.com> <20170731074350.GC15767@dhcp22.suse.cz> In-Reply-To: <20170731074350.GC15767@dhcp22.suse.cz> 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 07/31/2017 03:43 PM, Michal Hocko wrote: > On Mon 31-07-17 15:41:49, Wei Wang wrote: >> On 07/31/2017 02:55 PM, Michal Hocko wrote: >>> On Mon 31-07-17 12:13:33, Wei Wang wrote: >>>> Ballooned pages will be marked as MADV_DONTNEED by the hypervisor and >>>> shouldn't be given to the host ksmd to scan. >>> Could you point me where this MADV_DONTNEED is done, please? >> Sure. It's done in the hypervisor when the balloon pages are received. >> >> Please see line 40 at >> https://github.com/qemu/qemu/blob/master/hw/virtio/virtio-balloon.c > Thanks. Are all hypervisors which are using this API doing this? The implementation may be different across different hypervisors. But the underlying concept is the same - they unmap the balloon pages from the guest and those pages will be given to other guests or host processes to use. Regardless of the implementation, I think it is an improper operation to make the memory KSM mergeable when the memory does not belong to the guest anymore. Best, Wei