kernel - Attempt to fix a rare vm_page_queues panic
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 28 Dec 2013 05:37:42 +0000 (21:37 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 28 Dec 2013 05:37:42 +0000 (21:37 -0800)
commitbb0d60931c54c7121a931f0ebf915700feac863d
treeb70740fc22153ef7b8c62d2e74babdce9de44803
parenta44410dd8663abb121417692995d3b365f32fd6e
kernel - Attempt to fix a rare vm_page_queues panic

* Change the way the vm_page_t markers are used in the pageout daemon.
  The structures are not stable because they are declared on the stack,
  but the vm pageout scan functions were assuming that a TAILQ_NEXT()
  call would yield a stable vm_page_t structure that could then be locked
  with vm_page_and_queue_spin_lock().

* Fix the problem by holding the appropriate vm_page_queues[] spinlock
  across the TAILQ_NEXT() lookup.

* The panic could not be definitively traced to this issue so we will have
  to see if it reoccurs.

* This also fixes a potential infinite marker hop-over case when multiple
  cpus are trying to scan the same queue at the same time.  However, it
  would be exceedingly rare for this case to actually occur since only
  the pageout and swapcache daemons could compete in this way.

Reported-by: swildner
sys/vm/vm_fault.c
sys/vm/vm_page.c
sys/vm/vm_pageout.c