From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <45FE6040.4090809@yahoo.com.au> Date: Mon, 19 Mar 2007 21:04:48 +1100 From: Nick Piggin MIME-Version: 1.0 Subject: Re: ZERO_PAGE refcounting causes cache line bouncing References: <20070317043545.GH8915@holomorphy.com> <45FE261F.3030903@yahoo.com.au> <45FE2CA0.3080204@yahoo.com.au> <45FE3092.3030202@yahoo.com.au> In-Reply-To: <45FE3092.3030202@yahoo.com.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org Return-Path: To: Nick Piggin Cc: William Lee Irwin III , Christoph Lameter , linux-mm@kvack.org List-ID: Nick Piggin wrote: > Nick Piggin wrote: > >> Something like this roughly should get rid of ZERO_PAGE _count and >> _mapcount >> manipulation for anonymous pages. (others still exist, XIP and >> /dev/zero, but >> they should not be a large concern AFAIKS). >> >> I haven't booted this, but it is a quick forward port + some fixes and >> simplifications. >> >> >> ------------------------------------------------------------------------ >> >> Index: linux-2.6/mm/memory.c >> =================================================================== >> --- linux-2.6.orig/mm/memory.c >> +++ linux-2.6/mm/memory.c >> @@ -665,7 +665,8 @@ static unsigned long zap_pte_range(struc >> ptent = ptep_get_and_clear_full(mm, addr, pte, >> tlb->fullmm); >> tlb_remove_tlb_entry(tlb, pte, addr); >> - if (unlikely(!page)) >> + if (unlikely(!page || >> + (!vma->vm_file && page == ZERO_PAGE(addr)))) >> continue; > > > Hmm, well I suppose it would be cleaner if this check used the one in > handle_pte_fault instead of !vma->vm_file ie. (!vma->vm_ops || > !vma->vm_ops->nopage) Bah, I also missed a reject for a similar hunk required in copy_one_pte. I don't think there is anything more required after that, though... I will actually test it tomorrow and send an updated patch with proper changelog. -- SUSE Labs, Novell Inc. Send instant messages to your online friends http://au.messenger.yahoo.com -- 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/ . Don't email: email@kvack.org