kernel - Fix atomic op comparison
commit743146ae2a6000d439d5977d490403d7fdf54979
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 24 Jul 2016 07:56:04 +0000 (24 00:56 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 24 Jul 2016 07:56:04 +0000 (24 00:56 -0700)
treeab8f78aa5c04602969ab3759b78f94330dccb800
parent1a5c7e0f9aa6bc9a632a92b6b832cfe676746f7f
kernel - Fix atomic op comparison

* The sequence was testing a signed integer and then testing the same
  variable using atomic_fetchadd_int(&var, 0).  Unfortunately, the
  atomic-op returns an unsigned value so the result is that when the
  buffer count was exhausted, the program would hard-loop without
  calling tsleep.

* Fixed by casting the atomic op.

* Should fix the hardlock issue once and for all.
sys/vm/vm_pager.c