From: Matt Mackall <mpm@selenic.com>
To: Dave Hansen <dave@linux.vnet.ibm.com>
Cc: Hans Rosenfeld <hans.rosenfeld@amd.com>, linux-mm@kvack.org
Subject: Re: [RFC v3][PATCH 2/2] fix large pages in pagemap
Date: Wed, 11 Jun 2008 10:27:46 -0500 [thread overview]
Message-ID: <1213198066.20045.42.camel@calx> (raw)
In-Reply-To: <1213142787.7261.27.camel@nimitz>
On Tue, 2008-06-10 at 17:06 -0700, Dave Hansen wrote:
>
> +static unsigned long pte_to_pagemap_entry(pte_t pte)
> +{
> + unsigned long pme = 0;
> + if (is_swap_pte(pte))
> + pme = PM_PFRAME(swap_pte_to_pagemap_entry(pte))
> + | PM_PSHIFT(PAGE_SHIFT) | PM_SWAP;
> + else if (pte_present(pte))
> + pme = PM_PFRAME(pte_pfn(pte))
> + | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT;
> + return pme;
> +}
> +
> static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
> struct mm_walk *walk)
> {
> + struct vm_area_struct *vma;
> struct pagemapread *pm = walk->private;
> pte_t *pte;
> int err = 0;
>
> + /* find the first VMA at or above 'addr' */
> + vma = find_vma(walk->mm, addr);
Tab weirdness.
> for (; addr != end; addr += PAGE_SIZE) {
> u64 pfn = PM_NOT_PRESENT;
> - pte = pte_offset_map(pmd, addr);
> - if (is_swap_pte(*pte))
> - pfn = PM_PFRAME(swap_pte_to_pagemap_entry(*pte))
> - | PM_PSHIFT(PAGE_SHIFT) | PM_SWAP;
> - else if (pte_present(*pte))
> - pfn = PM_PFRAME(pte_pfn(*pte))
> - | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT;
> - /* unmap so we're not in atomic when we copy to userspace */
> - pte_unmap(pte);
> +
> + /* check to see if we've left 'vma' behind
> + * and need a new, higher one */
> + if (vma && (addr >= vma->vm_end))
> + vma = find_vma(walk->mm, addr);
> +
> + /* check that 'vma' actually covers this address,
> + * and that it isn't a huge page vma */
> + if (vma && (vma->vm_start <= addr) &&
> + !is_vm_hugetlb_page(vma)) {
> + pte = pte_offset_map(pmd, addr);
> + pfn = pte_to_pagemap_entry(*pte);
> + /*
> + * unmap so we're not in atomic
> + * when we copy to userspace
> + */
> + pte_unmap(pte);
This barely warranted a one line comment but now its four. But anyway,
this and 1/2:
Acked-by: Matt Mackall <mpm@selenic.com>
Thanks for getting back to this.
--
Mathematics is the supreme nostalgia of our time.
--
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>
prev parent reply other threads:[~2008-06-11 15:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-06 18:55 [RFC v2][PATCH 1/2] pass mm into pagewalkers Dave Hansen
2008-06-06 18:55 ` [RFC v2][PATCH 2/2] fix large pages in pagemap Dave Hansen
2008-06-10 23:26 ` Matt Mackall
2008-06-11 0:06 ` [RFC v3][PATCH " Dave Hansen
2008-06-11 15:27 ` Matt Mackall [this message]
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=1213198066.20045.42.camel@calx \
--to=mpm@selenic.com \
--cc=dave@linux.vnet.ibm.com \
--cc=hans.rosenfeld@amd.com \
--cc=linux-mm@kvack.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox