- don't check hold_count without the page lock held

- don't leak the page lock if m->object is NULL
  (assuming that that check will in fact even be valid when m->object is protected by the page lock)
This commit is contained in:
Kip Macy 2010-04-30 19:40:37 +00:00
parent a26a72d90b
commit e8f263195d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=207448

View File

@ -775,16 +775,17 @@ vm_pageout_scan(int pass)
if (m->flags & PG_MARKER)
continue;
/*
* A held page may be undergoing I/O, so skip it.
*/
if (m->hold_count) {
vm_page_requeue(m);
if (!vm_page_trylock(m)) {
addl_page_shortage++;
continue;
}
if (!vm_page_trylock(m) || (object = m->object) == NULL) {
/*
* A held page may be undergoing I/O, so skip it.
*/
if (m->hold_count || (object = m->object) == NULL) {
vm_page_unlock(m);
vm_page_requeue(m);
addl_page_shortage++;
continue;
}