From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48933) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZgsE-0004tN-Rk for qemu-devel@nongnu.org; Tue, 07 May 2013 08:20:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZgsB-0006Wz-Cf for qemu-devel@nongnu.org; Tue, 07 May 2013 08:20:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24135) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZgsB-0006Wn-53 for qemu-devel@nongnu.org; Tue, 07 May 2013 08:19:59 -0400 Date: Tue, 7 May 2013 14:19:54 +0200 From: Andrea Arcangeli Message-ID: <20130507121954.GE12538@redhat.com> References: <1367870221-12676-1-git-send-email-aarcange@redhat.com> <20130507113809.GB10720@hawk.usersys.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130507113809.GB10720@hawk.usersys.redhat.com> Subject: Re: [Qemu-devel] [PATCH 0/4] madvise(MADV_USERFAULT) & sys_remap_anon_pages() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andrew Jones Cc: Anthony Liguori , Juan Quintela , Hugh Dickins , qemu-devel@nongnu.org, linux-kernel@vger.kernel.org, Orit Wasserman , Mel Gorman , Paolo Bonzini , Isaku Yamahata On Tue, May 07, 2013 at 01:38:10PM +0200, Andrew Jones wrote: > What about instead of adding a new syscall (remap_anon_pages) to > instead extend mremap with new flags giving it a strict mode? I actually thought about this and it's a very interesting argument. When I thought about it, I felt the problem was that we won't know until we did some work (at least until reaching _each_ individual page structure of every page mapped in the mremapped range) if we can avoid the vma mangling or not. So then remap_anon_pages should be more efficient because it will just error out if strict mode is not possible, it won't need to search all page structures before it know if it has to do the vma mangling or not. It likely is simpler too than to try to teach mremap to do both things after checking which one it can do. Also, the same argument could be made about remap_file_pages too. But it's still an interesting point, let's see what others thinks about it.