1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-29 08:08:37 +00:00

riscv: remove a redundant check on PGA_WRITEABLE

This is achieved by the preceding call to pmap_page_is_write_mapped().
It appears the second check and comment were left mistakenly when the
intent was to remove them.

Reviewed by:	mhorne
MFC after:	1 week
Fixes:	638f867814 ("(6/6) Convert pmap to expect busy in write... ")
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1304
This commit is contained in:
wy-chung 2024-06-26 15:46:32 +08:00 committed by Mitchell Horne
parent d3bb35d4e5
commit 2eb64df7f5

View File

@ -4611,19 +4611,12 @@ pmap_clear_modify(vm_page_t m)
int md_gen, pvh_gen; int md_gen, pvh_gen;
KASSERT((m->oflags & VPO_UNMANAGED) == 0, KASSERT((m->oflags & VPO_UNMANAGED) == 0,
("pmap_clear_modify: page %p is not managed", m)); ("%s: page %p is not managed", __func__, m));
vm_page_assert_busied(m); vm_page_assert_busied(m);
if (!pmap_page_is_write_mapped(m)) if (!pmap_page_is_write_mapped(m))
return; return;
/*
* If the page is not PGA_WRITEABLE, then no PTEs can have PG_M set.
* If the object containing the page is locked and the page is not
* exclusive busied, then PGA_WRITEABLE cannot be concurrently set.
*/
if ((m->a.flags & PGA_WRITEABLE) == 0)
return;
pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy :
pa_to_pvh(VM_PAGE_TO_PHYS(m)); pa_to_pvh(VM_PAGE_TO_PHYS(m));
lock = VM_PAGE_TO_PV_LIST_LOCK(m); lock = VM_PAGE_TO_PV_LIST_LOCK(m);