From: Aram Sargsyan Date: Thu, 27 Feb 2025 16:14:55 +0000 (+0000) Subject: Use relaxed memory ordering for quota->max and quota->soft X-Git-Tag: v9.18.35~6^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80d7d11f3779f92440f0f94dac559bcc41916aaf;p=thirdparty%2Fbind9.git Use relaxed memory ordering for quota->max and quota->soft These variables are not critical for memory ordering issues and we can use the relaxed memory ordering, as done in the main branch. --- diff --git a/lib/isc/quota.c b/lib/isc/quota.c index fa604419add..ccafd240ea0 100644 --- a/lib/isc/quota.c +++ b/lib/isc/quota.c @@ -45,22 +45,22 @@ isc_quota_destroy(isc_quota_t *quota) { INSIST(atomic_load("a->used) == 0); INSIST(atomic_load("a->waiting) == 0); INSIST(ISC_LIST_EMPTY(quota->cbs)); - atomic_store_release("a->max, 0); + atomic_store_relaxed("a->max, 0); atomic_store_release("a->used, 0); - atomic_store_release("a->soft, 0); + atomic_store_relaxed("a->soft, 0); isc_mutex_destroy("a->cblock); } void isc_quota_soft(isc_quota_t *quota, unsigned int soft) { REQUIRE(VALID_QUOTA(quota)); - atomic_store_release("a->soft, soft); + atomic_store_relaxed("a->soft, soft); } void isc_quota_max(isc_quota_t *quota, unsigned int max) { REQUIRE(VALID_QUOTA(quota)); - atomic_store_release("a->max, max); + atomic_store_relaxed("a->max, max); } unsigned int @@ -84,8 +84,8 @@ isc_quota_getused(isc_quota_t *quota) { static isc_result_t quota_reserve(isc_quota_t *quota) { isc_result_t result; - uint_fast32_t max = atomic_load_acquire("a->max); - uint_fast32_t soft = atomic_load_acquire("a->soft); + uint_fast32_t max = atomic_load_relaxed("a->max); + uint_fast32_t soft = atomic_load_relaxed("a->soft); uint_fast32_t used = atomic_load_acquire("a->used); do { if (max != 0 && used >= max) {