From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Haavard Skinnemoen <hskinnemoen@atmel.com>,
Linux-MM <linux-mm@kvack.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Nick Piggin <npiggin@kernel.dk>,
Xen-devel <xen-devel@lists.xensource.com>,
Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Subject: Re: [PATCH 2/9] mm: add apply_to_page_range_batch()
Date: Wed, 12 Jan 2011 13:15:26 +1100 [thread overview]
Message-ID: <4D2D0EBE.7040406@goop.org> (raw)
In-Reply-To: <20110110212628.GC15016@dumpdata.com>
On 01/11/2011 08:26 AM, Konrad Rzeszutek Wilk wrote:
> . snip..
>> static int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd,
>> unsigned long addr, unsigned long end,
>> - pte_fn_t fn, void *data)
>> + pte_batch_fn_t fn, void *data)
>> {
>> pte_t *pte;
>> int err;
>> - pgtable_t token;
>> spinlock_t *uninitialized_var(ptl);
>>
>> pte = (mm == &init_mm) ?
>> @@ -1940,25 +1939,17 @@ static int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd,
>> BUG_ON(pmd_huge(*pmd));
>>
>> arch_enter_lazy_mmu_mode();
>> -
>> - token = pmd_pgtable(*pmd);
>> -
>> - do {
>> - err = fn(pte++, addr, data);
>> - if (err)
>> - break;
>> - } while (addr += PAGE_SIZE, addr != end);
>> -
>> + err = fn(pte, (end - addr) / PAGE_SIZE, addr, data);
>> arch_leave_lazy_mmu_mode();
>>
>> if (mm != &init_mm)
>> - pte_unmap_unlock(pte-1, ptl);
>> + pte_unmap_unlock(pte, ptl);
> That looks like a bug fix as well? Did this hit us before the change or was
> it masked by the fact that the code never go to here?
No, it isn't. In the original code, "pte" would end up pointing into
the next page as the end state of the loop; the "-1" points it back to
the correct page. With the new version, pte remains unchanged.
J
--
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/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-01-12 2:15 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-15 22:19 [PATCH 0/9] Add apply_to_page_range_batch() and use it Jeremy Fitzhardinge
2010-12-15 22:19 ` [PATCH 1/9] mm: remove unused "token" argument from apply_to_page_range callback Jeremy Fitzhardinge
2010-12-15 22:19 ` [PATCH 2/9] mm: add apply_to_page_range_batch() Jeremy Fitzhardinge
2011-01-10 21:26 ` Konrad Rzeszutek Wilk
2011-01-12 2:15 ` Jeremy Fitzhardinge [this message]
2010-12-15 22:19 ` [PATCH 3/9] ioremap: use apply_to_page_range_batch() for ioremap_page_range() Jeremy Fitzhardinge
2010-12-15 22:19 ` [PATCH 4/9] vmalloc: use plain pte_clear() for unmaps Jeremy Fitzhardinge
2010-12-15 22:19 ` [PATCH 5/9] vmalloc: use apply_to_page_range_batch() for vunmap_page_range() Jeremy Fitzhardinge
2010-12-15 22:19 ` [PATCH 6/9] vmalloc: use apply_to_page_range_batch() for vmap_page_range_noflush() Jeremy Fitzhardinge
2010-12-15 22:19 ` [PATCH 7/9] vmalloc: use apply_to_page_range_batch() in alloc_vm_area() Jeremy Fitzhardinge
2010-12-15 22:19 ` [PATCH 8/9] xen/mmu: use apply_to_page_range_batch() in xen_remap_domain_mfn_range() Jeremy Fitzhardinge
2010-12-15 22:19 ` [PATCH 9/9] xen/grant-table: use apply_to_page_range_batch() Jeremy Fitzhardinge
2011-01-24 22:55 [PATCH 0/9] Add apply_to_page_range_batch() and use it Jeremy Fitzhardinge
2011-01-24 22:56 ` [PATCH 2/9] mm: add apply_to_page_range_batch() Jeremy Fitzhardinge
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=4D2D0EBE.7040406@goop.org \
--to=jeremy@goop.org \
--cc=akpm@linux-foundation.org \
--cc=hskinnemoen@atmel.com \
--cc=jeremy.fitzhardinge@citrix.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=npiggin@kernel.dk \
--cc=xen-devel@lists.xensource.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox