From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33685) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbYoB-0001j0-3r for qemu-devel@nongnu.org; Tue, 07 Oct 2014 13:44:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XbYo6-0002rb-0m for qemu-devel@nongnu.org; Tue, 07 Oct 2014 13:44:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23692) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbYo5-0002rN-PH for qemu-devel@nongnu.org; Tue, 07 Oct 2014 13:44:17 -0400 Date: Tue, 7 Oct 2014 18:07:32 +0100 From: "Dr. David Alan Gilbert" Message-ID: <20141007170731.GO2404@work-vm> References: <1412356087-16115-1-git-send-email-aarcange@redhat.com> <1412356087-16115-11-git-send-email-aarcange@redhat.com> <20141006085540.GD2336@work-vm> <20141006164156.GA31075@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH 10/17] mm: rmap preparation for remap_anon_pages List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Linus Torvalds Cc: Robert Love , Dave Hansen , Jan Kara , KVM list , Neil Brown , Stefan Hajnoczi , qemu-devel@nongnu.org, linux-mm , KOSAKI Motohiro , Michel Lespinasse , Andrea Arcangeli , Taras Glek , Andrew Jones , Juan Quintela , Hugh Dickins , Isaku Yamahata , Mel Gorman , Sasha Levin , Android Kernel Team , "Huangpeng (Peter)" , Andres Lagar-Cavilla , Christopher Covington , Anthony Liguori , Mike Hommey , Keith Packard , Wenchao Xia , Linux API , Linux Kernel Mailing List , Andy Lutomirski , Minchan Kim , Dmitry Adamushko , Johannes Weiner , Paolo Bonzini , Andrew Morton , Peter Feiner * Linus Torvalds (torvalds@linux-foundation.org) wrote: > On Mon, Oct 6, 2014 at 12:41 PM, Andrea Arcangeli wrote: > > > > Of course if somebody has better ideas on how to resolve an anonymous > > userfault they're welcome. > > So I'd *much* rather have a "write()" style interface (ie _copying_ > bytes from user space into a newly allocated page that gets mapped) > than a "remap page" style interface Something like that might work for the postcopy case; it doesn't work for some of the other uses that need to stop a page being changed by the guest, but then need to somehow get a copy of that page internally to QEMU, and perhaps provide it back later. remap_anon_pages worked for those cases as well; I can't think of another current way of doing it in userspace. I'm thinking here of systems for making VMs with memory larger than a single host; that's something that's not as well thought out. I've also seen people writing emulation that want to trap and emulate some page accesses while still having the original data available to the emulator itself. So yes, OK for now, but the result is less general. Dave > remapping anonymous pages involves page table games that really aren't > necessarily a good idea, and tlb invalidates for the old page etc. > Just don't do it. > > Linus -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK