From 3a36b573dee586e6e7f54baf8c89ae4c5788ad98 Mon Sep 17 00:00:00 2001 From: Alex Hornung Date: Tue, 20 Apr 2010 16:49:58 +0000 Subject: [PATCH] dsched_fq - remove pointless atomic ops Reported-by: Aggelos Economopoulos --- sys/dsched/fq/dsched_fq_diskops.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/dsched/fq/dsched_fq_diskops.c b/sys/dsched/fq/dsched_fq_diskops.c index 08d81af348..84c49e20b9 100644 --- a/sys/dsched/fq/dsched_fq_diskops.c +++ b/sys/dsched/fq/dsched_fq_diskops.c @@ -271,9 +271,8 @@ fq_queue(struct disk *dp, struct bio *obio) if (atomic_cmpset_int(&tdio->rebalance, 1, 0)) fq_balance_self(tdio); - /* XXX: probably rather pointless doing this atomically */ - max_tp = atomic_fetchadd_int(&tdio->max_tp, 0); - transactions = atomic_fetchadd_int(&tdio->issued, 0); + max_tp = tdio->max_tp; + transactions = tdio->issued; /* | No rate limiting || Hasn't reached limit rate | */ if ((max_tp == 0) || (transactions < max_tp)) { @@ -381,7 +380,7 @@ fq_completed(struct bio *bp) wakeup(diskctx); /* Wake up fq_dispatcher */ } transactions = atomic_fetchadd_int(&tdio->transactions, 1); - latency = atomic_fetchadd_int(&tdio->avg_latency, 0); + latency = tdio->avg_latency; if (latency != 0) { /* Moving averager, ((n-1)*avg_{n-1} + x) / n */ -- 2.41.0