| Summary: | [pmap] [patch] Possible race conditions in pmap.c | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | gemini | ||||
| Component: | kern | Assignee: | Alan Cox <alc> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | CC: | gemini | ||||
| Priority: | Normal | ||||||
| Version: | 4.5-RELEASE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
|
Description
gemini
2004-08-29 18:10:28 UTC
The VM_WAIT is, indeed, unnecessary. I suspect, but haven't verified,
that it is an artifact of merging PAE support.
There is not, however, a race. The reason is that we never call
pmap_page_lookup() on a missing or busy page table page. So, the check
for a busy page is pointless and confusing. (HEAD and RELENG_5 have
remedied this.)
To see why, observe that pmap_page_lookup() is called only after
inspection of the page directory entry ("pde") has shown that the page
table page exists. So, unless the page directory entry has been
corrupted by a hardware error or different bug, the pmap_page_lookup()
will succeed in finding a page.
A page table is only marked busy for a short time in
_pmap_unwire_pte_hold(), pmap_release() and _pmap_allocpte(). Since
the kernel is non-preemptive, the busy flag should be cleared before
it is tested anywhere. For a problem to occur, an interrupt handler
would have to free a page that is mapped into a user address space.
That is not supposed to happen (and would itself be an error).
I'm happy to elaborate on any of these points if you like.
Regards,
Alan
Responsible Changed From-To: freebsd-bugs->alc State Changed From-To: open->closed The hypothesized race condition does not exist. |