For architectures not using direct map , and requiring real KVA page for

sf buf allocation, use wakeup() instead of wakeup_one() to notify sf
buffer waiters about free buffer.

sf_buf_alloc() calls msleep(PCATCH) when SFB_CATCH flag was given,
and for simultaneous wakeup and signal delivery, msleep() returns
EINTR/ERESTART despite the thread was selected for wakeup_one(). As
result, we loose a wakeup, and some other waiter will not be woken up.

Reported and tested by:	az
Reviewed by:	alc, jhb
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2011-01-18 21:57:02 +00:00
parent 14be64618e
commit 55aabb7fd1
6 changed files with 6 additions and 6 deletions

View File

@ -175,7 +175,7 @@ sf_buf_free(struct sf_buf *sf)
sf->m = NULL;
LIST_REMOVE(sf, list_entry);
if (sf_buf_alloc_want > 0)
wakeup_one(&sf_buf_freelist);
wakeup(&sf_buf_freelist);
}
mtx_unlock(&sf_buf_lock);
#endif

View File

@ -916,7 +916,7 @@ sf_buf_free(struct sf_buf *sf)
LIST_REMOVE(sf, list_entry);
#endif
if (sf_buf_alloc_want > 0)
wakeup_one(&sf_buf_freelist);
wakeup(&sf_buf_freelist);
}
mtx_unlock(&sf_buf_lock);
}

View File

@ -528,7 +528,7 @@ sf_buf_free(struct sf_buf *sf)
SLIST_INSERT_HEAD(&sf_freelist.sf_head, sf, free_list);
nsfbufsused--;
if (sf_buf_alloc_want > 0)
wakeup_one(&sf_freelist);
wakeup(&sf_freelist);
mtx_unlock(&sf_freelist.sf_lock);
}

View File

@ -347,7 +347,7 @@ sf_buf_free(struct sf_buf *sf)
nsfbufsused--;
if (sf_buf_alloc_want > 0)
wakeup_one(&sf_buf_freelist);
wakeup(&sf_buf_freelist);
}
mtx_unlock(&sf_buf_lock);
}

View File

@ -346,7 +346,7 @@ sf_buf_free(struct sf_buf *sf)
nsfbufsused--;
if (sf_buf_alloc_want > 0)
wakeup_one(&sf_buf_freelist);
wakeup(&sf_buf_freelist);
}
mtx_unlock(&sf_buf_lock);
}

View File

@ -483,7 +483,7 @@ sf_buf_free(struct sf_buf *sf)
SLIST_INSERT_HEAD(&sf_freelist.sf_head, sf, free_list);
nsfbufsused--;
if (sf_buf_alloc_want > 0)
wakeup_one(&sf_freelist);
wakeup(&sf_freelist);
mtx_unlock(&sf_freelist.sf_lock);
}