From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail143.messagelabs.com (mail143.messagelabs.com [216.82.254.35]) by kanga.kvack.org (Postfix) with SMTP id 94D7F6B016B for ; Mon, 8 Aug 2011 04:24:03 -0400 (EDT) Date: Mon, 8 Aug 2011 10:23:35 +0200 From: Johannes Weiner Subject: Re: [PATCH 2 of 3] mremap: avoid sending one IPI per page Message-ID: <20110808082335.GB27011@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: aarcange@redhat.com Cc: linux-mm@kvack.org, Mel Gorman , Rik van Riel , Hugh Dickins On Sat, Aug 06, 2011 at 06:58:04PM +0200, aarcange@redhat.com wrote: > From: Andrea Arcangeli > > This replaces ptep_clear_flush() with ptep_get_and_clear() and a single > flush_tlb_range() at the end of the loop, to avoid sending one IPI for each > page. > > The mmu_notifier_invalidate_range_start/end section is enlarged accordingly but > this is not going to fundamentally change things. It was more by accident that > the region under mremap was for the most part still available for secondary > MMUs: the primary MMU was never allowed to reliably access that region for the > duration of the mremap (modulo trapping SIGSEGV on the old address range which > sounds unpractical and flakey). If users wants secondary MMUs not to lose > access to a large region under mremap they should reduce the mremap size > accordingly in userland and run multiple calls. Overall this will run faster so > it's actually going to reduce the time the region is under mremap for the > primary MMU which should provide a net benefit to apps. > > For KVM this is a noop because the guest physical memory is never mremapped, > there's just no point it ever moving it while guest runs. One target of this > optimization is JVM GC (so unrelated to the mmu notifier logic). > > Signed-off-by: Andrea Arcangeli Acked-by: Johannes Weiner -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org