svn commit: r308288 - head/sys/vm

Konstantin Belousov kib at FreeBSD.org
Fri Nov 4 12:58:52 UTC 2016


Author: kib
Date: Fri Nov  4 12:58:50 2016
New Revision: 308288
URL: https://svnweb.freebsd.org/changeset/base/308288

Log:
  Do not sleep in vm_wait() if pagedaemon did not yet started.  Panic instead.
  
  Requests which cannot be satisfied by allocators at boot time often
  have unrealizable parameters.  Waiting for the pagedaemon' start would
  hang the boot if done in the thread0 context and just never succeed if
  executed from another thread.  In fact, for very early stages, sleep
  attempt panics with obscure diagnostic about the scheduler state, and
  explicit panic in vm_wait() makes the investigation much shorter by
  cut off the examination of the thread and scheduler.
  
  Theoretically, some subsystem might grab a resource to exhaustion, and
  free it later in the boot process.  If this unlikely scenario does
  appear for real, the way to diagnose the trouble can be revisited.
  
  Reported by:	emaste
  Reviewed by:	markj
  Sponsored by:	The FreeBSD Foundation
  MFC after:	2 weeks
  Differential revision:	https://reviews.freebsd.org/D8421

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c	Fri Nov  4 11:40:11 2016	(r308287)
+++ head/sys/vm/vm_page.c	Fri Nov  4 12:58:50 2016	(r308288)
@@ -2738,6 +2738,8 @@ vm_wait(void)
 		msleep(&vm_pageout_pages_needed, &vm_page_queue_free_mtx,
 		    PDROP | PSWP, "VMWait", 0);
 	} else {
+		if (__predict_false(pageproc == NULL))
+			panic("vm_wait in early boot");
 		if (!vm_pageout_wanted) {
 			vm_pageout_wanted = true;
 			wakeup(&vm_pageout_wanted);


More information about the svn-src-head mailing list