Atomically check and set dropped zevent count
ratelimit_dropped isn't protected by a lock and is expected to be updated atomically. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #11822
This commit is contained in:
parent
6613ea3b33
commit
917f4b334c
|
@ -657,8 +657,7 @@ zfs_zevent_next(zfs_zevent_t *ze, nvlist_t **event, uint64_t *event_size,
|
||||||
|
|
||||||
#ifdef _KERNEL
|
#ifdef _KERNEL
|
||||||
/* Include events dropped due to rate limiting */
|
/* Include events dropped due to rate limiting */
|
||||||
*dropped += ratelimit_dropped;
|
*dropped += atomic_swap_64(&ratelimit_dropped, 0);
|
||||||
ratelimit_dropped = 0;
|
|
||||||
#endif
|
#endif
|
||||||
ze->ze_dropped = 0;
|
ze->ze_dropped = 0;
|
||||||
out:
|
out:
|
||||||
|
|
Loading…
Reference in New Issue