Hi,
If /usr fills up during relinking kernel, the console spits out
masses of these warnings.
uvn_flush: obj=0x0, offset=0x4760000. error during pageout.
uvn_flush: WARNING: changes to page may be lost!
uvn_flush: obj=0x0, offset=0x4760000. error during pageout.
uvn_flush: WARNING: changes to page may be lost!
uvn_flush: obj=0x0, offset=0x4760000. error during pageout.
uvn_flush: WARNING: changes to page may be lost!
The machine becomes unusable for several minutes.
I think we should rate limit the printf. As this is not a hot path,
kernel lock seems best to protect struct timeval lasttime.
ok?
bluhm
Index: uvm/uvm_vnode.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/sys/uvm/uvm_vnode.c,v
retrieving revision 1.121
diff -u -p -r1.121 uvm_vnode.c
--- uvm/uvm_vnode.c 15 Dec 2021 12:53:53 -0000 1.121
+++ uvm/uvm_vnode.c 13 Apr 2022 15:10:40 -0000
@@ -744,7 +744,7 @@ ReTry:
*/
#ifdef DIAGNOSTIC
if (flags & PGO_SYNCIO)
- panic("uvn_flush: PGO_SYNCIO return 'try again' error (impossible)");
+ panic("%s: PGO_SYNCIO return 'try again' error (impossible)", __func__);
#endif
flags |= PGO_SYNCIO;
if (flags & PGO_FREE)
@@ -808,14 +808,22 @@ ReTry:
} else if (flags & PGO_FREE &&
result != VM_PAGER_PEND) {
if (result != VM_PAGER_OK) {
- printf("uvn_flush: obj=%p, "
- "offset=0x%llx. error "
- "during pageout.\n",
- pp->uobject,
- (long long)pp->offset);
- printf("uvn_flush: WARNING: "
- "changes to page may be "
- "lost!\n");
+ static struct timeval lasttime;
+ static const struct timeval interval =
+ { 5, 0 };
+
+ KERNEL_LOCK()
+ if (ratecheck(&lasttime, &interval)) {
+ printf("%s: obj=%p, "
+ "offset=0x%llx. error "
+ "during pageout.\n",
+ __func__, pp->uobject,
+ (long long)pp->offset);
+ printf("%s: WARNING: "
+ "changes to page may be "
+ "lost!\n", __func__);
+ }
+ KERNEL_UNLOCK()
retval = FALSE;
}
pmap_page_protect(ptmp, PROT_NONE);