From: Alexander Nyberg <alexn@telia.com>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Andrew Morton <akpm@osdl.org>, Hugh Dickins <hugh@veritas.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [patch 2/6] mm: micro-optimise rmap
Date: Wed, 27 Jul 2005 13:30:05 +0200 [thread overview]
Message-ID: <1122463805.1166.3.camel@localhost.localdomain> (raw)
In-Reply-To: <42E5F19A.6050407@yahoo.com.au>
[Nick, your mail bounced while sending this privately so reply-all this
time]
> Index: linux-2.6/mm/rmap.c
> ===================================================================
> --- linux-2.6.orig/mm/rmap.c
> +++ linux-2.6/mm/rmap.c
> @@ -442,22 +442,23 @@ int page_referenced(struct page *page, i
> void page_add_anon_rmap(struct page *page,
> struct vm_area_struct *vma, unsigned long address)
> {
> - struct anon_vma *anon_vma = vma->anon_vma;
> - pgoff_t index;
> -
> BUG_ON(PageReserved(page));
> - BUG_ON(!anon_vma);
>
> inc_mm_counter(vma->vm_mm, anon_rss);
>
> - anon_vma = (void *) anon_vma + PAGE_MAPPING_ANON;
> - index = (address - vma->vm_start) >> PAGE_SHIFT;
> - index += vma->vm_pgoff;
> - index >>= PAGE_CACHE_SHIFT - PAGE_SHIFT;
> -
> if (atomic_inc_and_test(&page->_mapcount)) {
> - page->index = index;
> + struct anon_vma *anon_vma = vma->anon_vma;
> + pgoff_t index;
> +
> + BUG_ON(!anon_vma);
> + anon_vma = (void *) anon_vma + PAGE_MAPPING_ANON;
> page->mapping = (struct address_space *) anon_vma;
> +
> + index = (address - vma->vm_start) >> PAGE_SHIFT;
> + index += vma->vm_pgoff;
> + index >>= PAGE_CACHE_SHIFT - PAGE_SHIFT;
> + page->index = index;
> +
linear_page_index() here too?
next prev parent reply other threads:[~2005-07-27 11:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-26 8:15 [patch 0/6] remove PageReserved Nick Piggin
2005-07-26 8:16 ` [patch 1/6] mm: comment rmap Nick Piggin
2005-07-26 8:17 ` [patch 2/6] mm: micro-optimise rmap Nick Piggin
2005-07-26 8:18 ` [patch 3/6] mm: cleanup rmap Nick Piggin
2005-07-26 8:19 ` [patch 4/6] mm: remove atomic Nick Piggin
2005-07-26 8:20 ` [patch 5/6] mm: remap ZERO_PAGE mappings Nick Piggin
2005-07-26 8:20 ` [patch 6/6] mm: core remove PageReserved Nick Piggin
2005-07-26 8:56 ` [patch 6/6] mm: core remove PageReserved (take 2) Nick Piggin
2005-07-27 11:30 ` Alexander Nyberg [this message]
2005-07-28 0:53 ` [patch 2/6] mm: micro-optimise rmap Nick Piggin
2005-07-26 8:21 ` [patch 0/6] remove PageReserved Nick Piggin
2005-07-26 13:09 ` Kumar Gala
2005-07-27 0:22 ` Nick Piggin
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=1122463805.1166.3.camel@localhost.localdomain \
--to=alexn@telia.com \
--cc=akpm@osdl.org \
--cc=benh@kernel.crashing.org \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nickpiggin@yahoo.com.au \
/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.