FreeBSD Bugzilla – Attachment 199188 Details for
Bug 233088
Kernel Panic, mainly during high I/O stress (poudriere bulk)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch
pmap_remove_l2.diff (text/plain), 2.31 KB, created by
Mark Johnston
on 2018-11-13 01:00:19 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Mark Johnston
Created:
2018-11-13 01:00:19 UTC
Size:
2.31 KB
patch
obsolete
>diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c >index 1e8f61fa1a5e..9c4e88793656 100644 >--- a/sys/arm64/arm64/pmap.c >+++ b/sys/arm64/arm64/pmap.c >@@ -532,7 +532,7 @@ CTASSERT(L1_BLOCK == L2_BLOCK); > > /* > * Checks if the page is dirty. We currently lack proper tracking of this on >- * arm64 so for now assume is a page mapped as rw was accessed it is. >+ * arm64 so for now assume if a page mapped as rw was accessed it is dirty. > */ > static inline int > pmap_page_dirty(pt_entry_t pte) >@@ -2382,6 +2382,35 @@ pmap_pv_insert_l2(pmap_t pmap, vm_offset_t va, pd_entry_t l2e, u_int flags, > return (true); > } > >+static void >+pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va) >+{ >+ pt_entry_t newl2; >+ vm_page_t ml3; >+ vm_paddr_t ml3pa; >+ >+ KASSERT(!VIRT_IN_DMAP(va), ("removing direct mapping of %#lx", va)); >+ KASSERT(pmap == kernel_pmap, ("pmap %p is not kernel_pmap", pmap)); >+ PMAP_LOCK_ASSERT(pmap, MA_OWNED); >+ >+ ml3 = pmap_remove_pt_page(pmap, va); >+ if (ml3 == NULL) >+ panic("pmap_remove_kernel_l2: Missing pt page"); >+ >+ ml3pa = VM_PAGE_TO_PHYS(ml3); >+ newl2 = ml3pa | ATTR_DEFAULT | ATTR_IDX(ml3->md.pv_memattr) | L2_TABLE; >+ >+ /* >+ * Initialize the page table page. >+ */ >+ pagezero((void *)PHYS_TO_DMAP(ml3pa)); >+ >+ /* >+ * Demote the mapping. >+ */ >+ (void)pmap_load_store(l2, newl2); >+} >+ > /* > * pmap_remove_l2: do the things to unmap a level 2 superpage in a process > */ >@@ -2419,16 +2448,18 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, > vm_page_aflag_clear(m, PGA_WRITEABLE); > } > } >- KASSERT(pmap != kernel_pmap, >- ("Attempting to remove an l2 kernel page")); >- ml3 = pmap_remove_pt_page(pmap, sva); >- if (ml3 != NULL) { >- pmap_resident_count_dec(pmap, 1); >- KASSERT(ml3->wire_count == NL3PG, >- ("pmap_remove_l2: l3 page wire count error")); >- ml3->wire_count = 1; >- vm_page_unwire_noq(ml3); >- pmap_add_delayed_free_list(ml3, free, FALSE); >+ if (pmap == kernel_pmap) { >+ pmap_remove_kernel_l2(pmap, l2, sva); >+ } else { >+ ml3 = pmap_remove_pt_page(pmap, sva); >+ if (ml3 != NULL) { >+ pmap_resident_count_dec(pmap, 1); >+ KASSERT(ml3->wire_count == NL3PG, >+ ("pmap_remove_l2: l3 page wire count error")); >+ ml3->wire_count = 1; >+ vm_page_unwire_noq(ml3); >+ pmap_add_delayed_free_list(ml3, free, FALSE); >+ } > } > return (pmap_unuse_pt(pmap, sva, l1e, free)); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 233088
:
199094
|
199188
|
199259