kernel - Fix atomic op comparison v4.6.0rc2
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 24 Jul 2016 07:56:04 +0000 (00:56 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 24 Jul 2016 08:03:39 +0000 (01:03 -0700)
commitdbc5f8a42089cbfd127d2dab0df8d97957caf312
tree405a7f3bf50bc5672a1bbd70c4888a661b7fd266
parent6cb49c4fc9c5e24c090fd6a1b9abbaadd8d170bc
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