From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753729AbaJGLLR (ORCPT ); Tue, 7 Oct 2014 07:11:17 -0400 Received: from mta-out1.inet.fi ([62.71.2.197]:35298 "EHLO kirsi1.inet.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753236AbaJGLLN (ORCPT ); Tue, 7 Oct 2014 07:11:13 -0400 Date: Tue, 7 Oct 2014 14:10:26 +0300 From: "Kirill A. Shutemov" To: Andrea Arcangeli Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org, Robert Love , Dave Hansen , Jan Kara , Neil Brown , Stefan Hajnoczi , Andrew Jones , KOSAKI Motohiro , Michel Lespinasse , Taras Glek , Juan Quintela , Hugh Dickins , Isaku Yamahata , Mel Gorman , Sasha Levin , Android Kernel Team , "\\\"Dr. David Alan Gilbert\\\"" , "Huangpeng (Peter)" , Andres Lagar-Cavilla , Christopher Covington , Anthony Liguori , Paolo Bonzini , Keith Packard , Wenchao Xia , Andy Lutomirski , Minchan Kim , Dmitry Adamushko , Johannes Weiner , Mike Hommey , Andrew Morton , Linus Torvalds , Peter Feiner Subject: Re: [Qemu-devel] [PATCH 10/17] mm: rmap preparation for remap_anon_pages Message-ID: <20141007111026.GD30762@node.dhcp.inet.fi> References: <1412356087-16115-1-git-send-email-aarcange@redhat.com> <1412356087-16115-11-git-send-email-aarcange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1412356087-16115-11-git-send-email-aarcange@redhat.com> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 03, 2014 at 07:08:00PM +0200, Andrea Arcangeli wrote: > There's one constraint enforced to allow this simplification: the > source pages passed to remap_anon_pages must be mapped only in one > vma, but this is not a limitation when used to handle userland page > faults with MADV_USERFAULT. The source addresses passed to > remap_anon_pages should be set as VM_DONTCOPY with MADV_DONTFORK to > avoid any risk of the mapcount of the pages increasing, if fork runs > in parallel in another thread, before or while remap_anon_pages runs. Have you considered triggering COW instead of adding limitation on pages' mapcount? The limitation looks artificial from interface POV. -- Kirill A. Shutemov