From: Hugh Dickins <hugh@veritas.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Christoph Lameter <christoph@lameter.com>, linux-kernel@vger.kernel.org
Subject: [PATCH mm] page fault patches: fix highpte in do_anon_page
Date: Sat, 30 Jul 2005 21:07:07 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.61.0507302103590.3933@goblin.wat.veritas.com> (raw)
Fix "scheduling while atomic" messages below do_anonymous_page when
CONFIG_HIGHPTE=y: must unmap and remap the page_table around page
allocation. And let's shift the usual pte_unmap to the minor_fault exit.
Signed-off-by: Hugh Dickins <hugh@veritas.com>
---
Please don't interpret this fix as my approving the do_anonymous_page
without page_table_lock patches! I'm still averse to this special
route with different locking rules; but let's get it right for testing.
mm/memory.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
--- 2.6.13-rc3-mm3/mm/memory.c 2005-07-29 14:11:33.000000000 +0100
+++ linux/mm/memory.c 2005-07-29 20:58:54.000000000 +0100
@@ -1796,12 +1796,12 @@ do_anonymous_page(struct mm_struct *mm,
} else {
inc_page_state(cmpxchg_fail_anon_read);
}
- pte_unmap(page_table);
goto minor_fault;
}
/* This leaves the write case */
page_table_atomic_stop(mm);
+ pte_unmap(page_table);
if (unlikely(anon_vma_prepare(vma)))
goto oom;
@@ -1812,10 +1812,10 @@ do_anonymous_page(struct mm_struct *mm,
entry = maybe_mkwrite(pte_mkdirty(mk_pte(page,
vma->vm_page_prot)),
vma);
+ page_table = pte_offset_map(pmd, addr);
page_table_atomic_start(mm);
if (!ptep_cmpxchg(mm, addr, page_table, orig_entry, entry)) {
- pte_unmap(page_table);
page_cache_release(page);
inc_page_state(cmpxchg_fail_anon_write);
goto minor_fault;
@@ -1829,12 +1829,12 @@ do_anonymous_page(struct mm_struct *mm,
page_add_anon_rmap(page, vma, addr);
lru_cache_add_active(page);
inc_mm_counter(mm, rss);
- pte_unmap(page_table);
update_mmu_cache(vma, addr, entry);
lazy_mmu_prot_update(entry);
minor_fault:
page_table_atomic_stop(mm);
+ pte_unmap(page_table);
return VM_FAULT_MINOR;
oom:
reply other threads:[~2005-07-30 20:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=Pine.LNX.4.61.0507302103590.3933@goblin.wat.veritas.com \
--to=hugh@veritas.com \
--cc=akpm@osdl.org \
--cc=christoph@lameter.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®