From: Andrew Morton <akpm@linux-foundation.org>
To: Matt Mackall <mpm@selenic.com>
Cc: linuxppc-dev@ozlabs.org, m.kozlowski@tuxland.pl,
paulus@samba.org, linux-kernel@vger.kernel.org
Subject: Re: 2.6.24-rc8-mm1: powerpc oopses
Date: Thu, 17 Jan 2008 16:29:13 -0800 [thread overview]
Message-ID: <20080117162913.0323c517.akpm@linux-foundation.org> (raw)
In-Reply-To: <1200615168.3839.26.camel@cinder.waste.org>
On Thu, 17 Jan 2008 18:12:48 -0600
Matt Mackall <mpm@selenic.com> wrote:
>
> > Do we need the ifdef? pte_offset_map/pte_unmap should be super-cheap on
> > !CONFIG_HIGHPTE builds.
>
> In that case, pte_unmap is free, pte_offset_map is just a bit of math.
> So yeah, we can simplify this. How about:
>
> diff -r 5595adaea70f fs/proc/task_mmu.c
> --- a/fs/proc/task_mmu.c Thu Jan 17 13:26:54 2008 -0600
> +++ b/fs/proc/task_mmu.c Thu Jan 17 18:11:13 2008 -0600
> @@ -582,20 +583,20 @@
> {
> struct pagemapread *pm = private;
> pte_t *pte;
> - int err = 0;
> + int offset = 0, err = 0;
>
> - pte = pte_offset_map(pmd, addr);
> - for (; addr != end; pte++, addr += PAGE_SIZE) {
> + for (; addr != end; offset++, addr += PAGE_SIZE) {
> u64 pfn = PM_NOT_PRESENT;
> - if (is_swap_pte(*pte))
> - pfn = swap_pte_to_pagemap_entry(*pte);
> - else if (pte_present(*pte))
> - pfn = pte_pfn(*pte);
> + pte = pte_offset_map(pmd, addr);
> + if (is_swap_pte(pte[offset]))
> + pfn = swap_pte_to_pagemap_entry(pte[offset]);
> + else if (pte_present(pte[offset]))
> + pfn = pte_pfn(pte[offset]);
> + pte_unmap(pte);
> err = add_to_pagemap(addr, pfn, pm);
> if (err)
> return err;
> }
> - pte_unmap(pte - 1);
>
> cond_resched();
>
Do we need `offset' at all?
You have
static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
void *private)
{
struct pagemapread *pm = private;
pte_t *pte;
int offset = 0, err = 0;
for (; addr != end; offset++, addr += PAGE_SIZE) {
u64 pfn = PM_NOT_PRESENT;
pte = pte_offset_map(pmd, addr);
if (is_swap_pte(pte[offset]))
pfn = swap_pte_to_pagemap_entry(pte[offset]);
else if (pte_present(pte[offset]))
pfn = pte_pfn(pte[offset]);
pte_unmap(pte);
err = add_to_pagemap(addr, pfn, pm);
if (err)
return err;
}
cond_resched();
return err;
}
but I think we just do s/pte[offset]/*pte/. The virtual address should be
the only thing we need to increment as we walk across the addresses here?
next prev parent reply other threads:[~2008-01-18 0:29 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20080117023514.9df393cf.akpm@linux-foundation.org>
2008-01-17 18:18 ` 2.6.24-rc8-mm1: powerpc: include/asm/nvram.h:62: error: field 'partition' has incomplete type Mariusz Kozlowski
2008-01-17 19:27 ` Andrew Morton
2008-01-17 19:06 ` 2.6.24-rc8-mm1 powerpc build errors Olof Johansson
2008-01-17 19:35 ` Andrew Morton
2008-01-17 22:00 ` Greg KH
2008-01-17 22:15 ` 2.6.24-rc8-mm1: powerpc oopses Mariusz Kozlowski
2008-01-17 22:51 ` Andrew Morton
2008-01-17 23:39 ` Matt Mackall
2008-01-18 0:05 ` Andrew Morton
2008-01-18 0:12 ` Matt Mackall
2008-01-18 0:29 ` Andrew Morton [this message]
2008-01-18 0:47 ` Matt Mackall
2008-01-18 1:07 ` Andrew Morton
2008-01-18 1:16 ` Matt Mackall
2008-01-18 17:23 ` Mariusz Kozlowski
2008-01-18 17:33 ` Matt Mackall
2008-01-18 7:09 ` 2.6.24-rc8-mm1 build failure on headers_check Kamalesh Babulal
2008-01-18 7:38 ` Andrew Morton
2008-01-18 8:36 ` 2.6.24-rc8-mm1 Kernel oops will running kernbench Kamalesh Babulal
2008-01-18 8:44 ` Andrew Morton
2008-01-18 9:01 ` Paul Mackerras
2008-01-18 9:34 ` Kamalesh Babulal
2008-01-18 10:19 ` Paul Mackerras
2008-01-18 15:41 ` Milton Miller
2008-01-18 10:26 ` Paul Mackerras
2008-01-18 10:44 ` Kamalesh Babulal
2008-01-18 10:54 ` Balbir Singh
2008-01-25 6:05 ` 2.6.24 Kernel oops will running kernbench regression from 2.6.24-rc8-mm1 Kamalesh Babulal
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=20080117162913.0323c517.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=m.kozlowski@tuxland.pl \
--cc=mpm@selenic.com \
--cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).