git: a4d5853c6734 - stable/14 - amd64: use pc_is_full() helper function
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 13 Nov 2026 18:41:15 UTC
The branch stable/14 has been updated by mhorne:
URL: https://cgit.FreeBSD.org/src/commit/?id=a4d5853c673494c8c502728daafe2e1d08445aa1
commit a4d5853c673494c8c502728daafe2e1d08445aa1
Author: Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2024-07-09 18:43:33 +0000
Commit: Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2026-11-13 18:41:02 +0000
amd64: use pc_is_full() helper function
This seems to have been missed in a few places. No functional change
intended.
Reviewed by: kib
MFC after: 1 week
Fixes: 4d90a5afc51b ("sys: Consolidate common implementation details...")
Differential Revision: https://reviews.freebsd.org/D45920
(cherry picked from commit e7f849e25bbca9a74c9d3a5b633f9cd01ba95a55)
---
sys/amd64/amd64/pmap.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index af0bb5cea262..1ffadd8283b2 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -5595,8 +5595,7 @@ retry:
pv = &pc->pc_pventry[field * 64 + bit];
pc->pc_map[field] &= ~(1ul << bit);
/* If this was the last item, move it to tail */
- if (pc->pc_map[0] == 0 && pc->pc_map[1] == 0 &&
- pc->pc_map[2] == 0) {
+ if (pc_is_full(pc)) {
TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list);
TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc,
pc_list);
@@ -5807,8 +5806,7 @@ pmap_pv_demote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa,
va_last = va + NBPDR - PAGE_SIZE;
for (;;) {
pc = TAILQ_FIRST(&pmap->pm_pvchunk);
- KASSERT(pc->pc_map[0] != 0 || pc->pc_map[1] != 0 ||
- pc->pc_map[2] != 0, ("pmap_pv_demote_pde: missing spare"));
+ KASSERT(!pc_is_full(pc), ("pmap_pv_demote_pde: missing spare"));
for (field = 0; field < _NPCM; field++) {
while (pc->pc_map[field]) {
bit = bsfq(pc->pc_map[field]);
@@ -5829,7 +5827,7 @@ pmap_pv_demote_pde(pmap_t pmap, vm_offset_t va, vm_paddr_t pa,
TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, pc_list);
}
out:
- if (pc->pc_map[0] == 0 && pc->pc_map[1] == 0 && pc->pc_map[2] == 0) {
+ if (pc_is_full(pc)) {
TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list);
TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, pc_list);
}