ufs: only pass LK_ADAPTIVE if LK_NODDLKTREAT is set
This restores the pre-adaptive spinning state for SU which livelocks otherwise. Note this is a bug in SU. Reported by: pho
This commit is contained in:
parent
db99ec5656
commit
e5e10c82ec
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=363875
@ -445,7 +445,13 @@ ffs_lock(ap)
|
||||
struct lock *lkp;
|
||||
int result;
|
||||
|
||||
ap->a_flags |= LK_ADAPTIVE;
|
||||
/*
|
||||
* Adaptive spinning mixed with SU leads to trouble. use a giant hammer
|
||||
* and only use it when LK_NODDLKTREAT is set. Currently this means it
|
||||
* is only used during path lookup.
|
||||
*/
|
||||
if ((ap->a_flags & LK_NODDLKTREAT) != 0)
|
||||
ap->a_flags |= LK_ADAPTIVE;
|
||||
switch (ap->a_flags & LK_TYPE_MASK) {
|
||||
case LK_SHARED:
|
||||
case LK_UPGRADE:
|
||||
@ -483,7 +489,11 @@ ffs_lock(ap)
|
||||
}
|
||||
return (result);
|
||||
#else
|
||||
ap->a_flags |= LK_ADAPTIVE;
|
||||
/*
|
||||
* See above for an explanation.
|
||||
*/
|
||||
if ((ap->a_flags & LK_NODDLKTREAT) != 0)
|
||||
ap->a_flags |= LK_ADAPTIVE;
|
||||
return (VOP_LOCK1_APV(&ufs_vnodeops, ap));
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user