|
|
@@ -580,7 +580,9 @@ void queue_iova(struct iova_domain *iovad,
|
|
|
|
|
|
spin_unlock_irqrestore(&fq->lock, flags);
|
|
|
|
|
|
- if (atomic_cmpxchg(&iovad->fq_timer_on, 0, 1) == 0)
|
|
|
+ /* Avoid false sharing as much as possible. */
|
|
|
+ if (!atomic_read(&iovad->fq_timer_on) &&
|
|
|
+ !atomic_cmpxchg(&iovad->fq_timer_on, 0, 1))
|
|
|
mod_timer(&iovad->fq_timer,
|
|
|
jiffies + msecs_to_jiffies(IOVA_FQ_TIMEOUT));
|
|
|
}
|