From: William Lee Irwin III <wli@holomorphy.com>
To: linux-kernel@vger.kernel.org, trivial@rustcorp.com.au,
kernel-janitor-discuss@lists.sourceforge.net
Subject: Re: forget_pte()
Date: Sun, 2 Jun 2002 22:38:32 -0700 [thread overview]
Message-ID: <20020603053832.GP10243@holomorphy.com> (raw)
In-Reply-To: <20020601164002.GC10243@holomorphy.com>
On Sat, Jun 01, 2002 at 09:40:02AM -0700, William Lee Irwin III wrote:
...
patch updated to incorporate rusty's suggestion:
===== mm/memory.c 1.70 vs edited =====
--- 1.70/mm/memory.c Fri May 31 18:18:07 2002
+++ edited/mm/memory.c Sun Jun 2 22:37:17 2002
@@ -310,17 +310,6 @@
return -ENOMEM;
}
-/*
- * Return indicates whether a page was freed so caller can adjust rss
- */
-static inline void forget_pte(pte_t page)
-{
- if (!pte_none(page)) {
- printk("forget_pte: old mapping existed!\n");
- BUG();
- }
-}
-
static void zap_pte_range(mmu_gather_t *tlb, pmd_t * pmd, unsigned long address, unsigned long size)
{
unsigned long offset;
@@ -779,7 +768,8 @@
pte_t zero_pte = pte_wrprotect(mk_pte(ZERO_PAGE(address), prot));
pte_t oldpage = ptep_get_and_clear(pte);
set_pte(pte, zero_pte);
- forget_pte(oldpage);
+ /* PTE's must be unmapped */
+ BUG_ON(!pte_none(oldpage));
address += PAGE_SIZE;
pte++;
} while (address && (address < end));
@@ -857,7 +847,8 @@
if (!pfn_valid(pfn) || PageReserved(pfn_to_page(pfn)))
set_pte(pte, pfn_pte(pfn, prot));
- forget_pte(oldpage);
+ /* PTE's must be unmapped */
+ BUG_ON(!pte_none(oldpage));
address += PAGE_SIZE;
pfn++;
pte++;
prev parent reply other threads:[~2002-06-03 5:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-01 16:40 forget_pte() William Lee Irwin III
2002-06-03 3:04 ` forget_pte() Rusty Russell
2002-06-03 5:35 ` forget_pte() William Lee Irwin III
2002-06-03 5:38 ` William Lee Irwin III [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=20020603053832.GP10243@holomorphy.com \
--to=wli@holomorphy.com \
--cc=kernel-janitor-discuss@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=trivial@rustcorp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox