Move and revise a comment about the relation between the object's paging-
in-progress count and the vnode. Prior to r188331, we always acquired the vnode lock before incrementing the object's paging-in-progress count. Now, we increment it before attempting to acquire the vnode lock with LK_NOWAIT, but we never sleep acquiring the vnode lock while we have the count incremented. Reviewed by: kib MFC after: 3 days
This commit is contained in:
parent
8acf168aab
commit
dda4d36957
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=308174
@ -420,8 +420,7 @@ RetryFault:;
|
|||||||
* they will stay around as well.
|
* they will stay around as well.
|
||||||
*
|
*
|
||||||
* Bump the paging-in-progress count to prevent size changes (e.g.
|
* Bump the paging-in-progress count to prevent size changes (e.g.
|
||||||
* truncation operations) during I/O. This must be done after
|
* truncation operations) during I/O.
|
||||||
* obtaining the vnode lock in order to avoid possible deadlocks.
|
|
||||||
*/
|
*/
|
||||||
vm_object_reference_locked(fs.first_object);
|
vm_object_reference_locked(fs.first_object);
|
||||||
vm_object_pip_add(fs.first_object, 1);
|
vm_object_pip_add(fs.first_object, 1);
|
||||||
@ -647,7 +646,13 @@ RetryFault:;
|
|||||||
|
|
||||||
if (locked != LK_EXCLUSIVE)
|
if (locked != LK_EXCLUSIVE)
|
||||||
locked = LK_SHARED;
|
locked = LK_SHARED;
|
||||||
/* Do not sleep for vnode lock while fs.m is busy */
|
|
||||||
|
/*
|
||||||
|
* We must not sleep acquiring the vnode lock
|
||||||
|
* while we have the page exclusive busied or
|
||||||
|
* the object's paging-in-progress count
|
||||||
|
* incremented. Otherwise, we could deadlock.
|
||||||
|
*/
|
||||||
error = vget(vp, locked | LK_CANRECURSE |
|
error = vget(vp, locked | LK_CANRECURSE |
|
||||||
LK_NOWAIT, curthread);
|
LK_NOWAIT, curthread);
|
||||||
if (error != 0) {
|
if (error != 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user