Randomize the delay when waiting for VSC flag in mlx5core.
The PRM suggests random 0 - 10ms to prevent multiple waiters on the same interval in order to avoid starvation. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies
This commit is contained in:
parent
eff4361d88
commit
7bf46a63ce
@ -52,7 +52,7 @@ int mlx5_vsc_lock(struct mlx5_core_dev *mdev)
|
||||
* The PRM suggests random 0 - 10ms to prevent multiple
|
||||
* waiters on the same interval in order to avoid starvation
|
||||
*/
|
||||
DELAY((random() % 11) * 1000);
|
||||
DELAY((random() % 9000) + 1000);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ mlx5_vsc_wait_on_flag(struct mlx5_core_dev *mdev, u32 expected)
|
||||
break;
|
||||
|
||||
retries++;
|
||||
DELAY(10);
|
||||
DELAY((random() % 90) + 10);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user