From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: William Lee Irwin III <wli@holomorphy.com>,
Christoph Lameter <clameter@sgi.com>,
linux-mm@kvack.org
Subject: Re: ZERO_PAGE refcounting causes cache line bouncing
Date: Mon, 19 Mar 2007 17:41:22 +1100 [thread overview]
Message-ID: <45FE3092.3030202@yahoo.com.au> (raw)
In-Reply-To: <45FE2CA0.3080204@yahoo.com.au>
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)
> if (unlikely(details) && details->nonlinear_vma
> && linear_page_index(details->nonlinear_vma,
> @@ -2152,15 +2153,12 @@ static int do_anonymous_page(struct mm_s
> } else {
> /* Map the ZERO_PAGE - vm_page_prot is readonly */
> page = ZERO_PAGE(address);
> - page_cache_get(page);
> entry = mk_pte(page, vma->vm_page_prot);
>
> ptl = pte_lockptr(mm, pmd);
> spin_lock(ptl);
> if (!pte_none(*page_table))
> - goto release;
> - inc_mm_counter(mm, file_rss);
> - page_add_file_rmap(page);
> + goto unlock;
> }
>
> set_pte_at(mm, address, page_table, entry);
--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2007-03-19 6:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-16 22:17 ZERO_PAGE refcounting causes cache line bouncing Christoph Lameter
2007-03-17 4:35 ` William Lee Irwin III
2007-03-19 5:56 ` Nick Piggin
2007-03-19 6:24 ` Nick Piggin
2007-03-19 6:41 ` Nick Piggin [this message]
2007-03-19 10:04 ` Nick Piggin
2007-03-19 17:06 ` Christoph Lameter
2007-03-20 2:53 ` Nick Piggin
2007-03-19 12:03 ` Robin Holt
2007-03-20 2:35 ` Nick Piggin
2007-03-19 12:46 ` William Lee Irwin III
2007-03-20 2:34 ` Nick Piggin
2007-03-19 17:04 ` Christoph Lameter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45FE3092.3030202@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=clameter@sgi.com \
--cc=linux-mm@kvack.org \
--cc=wli@holomorphy.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.