Skip to content

Commit 4e857c5

Browse files
Peter Zijlstraingomolnar
authored andcommitted
arch: Mass conversion of smp_mb__*()
Mostly scripted conversion of the smp_mb__* barriers. Signed-off-by: Peter Zijlstra <peterz@infradead.org> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Link: http://lkml.kernel.org/n/tip-55dhyhocezdw1dg7u19hmh1u@git.kernel.org Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: linux-arch@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 1b15611 commit 4e857c5

106 files changed

Lines changed: 284 additions & 288 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎block/blk-iopoll.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ EXPORT_SYMBOL(blk_iopoll_sched);
4949
void __blk_iopoll_complete(struct blk_iopoll *iop)
5050
{
5151
list_del(&iop->list);
52-
smp_mb__before_clear_bit();
52+
smp_mb__before_atomic();
5353
clear_bit_unlock(IOPOLL_F_SCHED, &iop->state);
5454
}
5555
EXPORT_SYMBOL(__blk_iopoll_complete);
@@ -161,7 +161,7 @@ EXPORT_SYMBOL(blk_iopoll_disable);
161161
void blk_iopoll_enable(struct blk_iopoll *iop)
162162
{
163163
BUG_ON(!test_bit(IOPOLL_F_SCHED, &iop->state));
164-
smp_mb__before_clear_bit();
164+
smp_mb__before_atomic();
165165
clear_bit_unlock(IOPOLL_F_SCHED, &iop->state);
166166
}
167167
EXPORT_SYMBOL(blk_iopoll_enable);

‎crypto/chainiv.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static int async_chainiv_schedule_work(struct async_chainiv_ctx *ctx)
126126
int err = ctx->err;
127127

128128
if (!ctx->queue.qlen) {
129-
smp_mb__before_clear_bit();
129+
smp_mb__before_atomic();
130130
clear_bit(CHAINIV_STATE_INUSE, &ctx->state);
131131

132132
if (!ctx->queue.qlen ||

‎drivers/base/power/domain.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static bool genpd_sd_counter_dec(struct generic_pm_domain *genpd)
105105
static void genpd_sd_counter_inc(struct generic_pm_domain *genpd)
106106
{
107107
atomic_inc(&genpd->sd_count);
108-
smp_mb__after_atomic_inc();
108+
smp_mb__after_atomic();
109109
}
110110

111111
static void genpd_acquire_lock(struct generic_pm_domain *genpd)

‎drivers/block/mtip32xx/mtip32xx.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,9 @@ static int get_slot(struct mtip_port *port)
224224
*/
225225
static inline void release_slot(struct mtip_port *port, int tag)
226226
{
227-
smp_mb__before_clear_bit();
227+
smp_mb__before_atomic();
228228
clear_bit(tag, port->allocated);
229-
smp_mb__after_clear_bit();
229+
smp_mb__after_atomic();
230230
}
231231

232232
/*

‎drivers/cpuidle/coupled.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev, atomic_t *a)
159159
{
160160
int n = dev->coupled->online_count;
161161

162-
smp_mb__before_atomic_inc();
162+
smp_mb__before_atomic();
163163
atomic_inc(a);
164164

165165
while (atomic_read(a) < n)

‎drivers/firewire/ohci.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3498,7 +3498,7 @@ static int ohci_flush_iso_completions(struct fw_iso_context *base)
34983498
}
34993499

35003500
clear_bit_unlock(0, &ctx->flushing_completions);
3501-
smp_mb__after_clear_bit();
3501+
smp_mb__after_atomic();
35023502
}
35033503

35043504
tasklet_enable(&ctx->context.tasklet);

‎drivers/gpu/drm/drm_irq.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static void vblank_disable_and_save(struct drm_device *dev, int crtc)
156156
*/
157157
if ((vblrc > 0) && (abs64(diff_ns) > 1000000)) {
158158
atomic_inc(&dev->vblank[crtc].count);
159-
smp_mb__after_atomic_inc();
159+
smp_mb__after_atomic();
160160
}
161161

162162
/* Invalidate all timestamps while vblank irq's are off. */
@@ -864,9 +864,9 @@ static void drm_update_vblank_count(struct drm_device *dev, int crtc)
864864
vblanktimestamp(dev, crtc, tslot) = t_vblank;
865865
}
866866

867-
smp_mb__before_atomic_inc();
867+
smp_mb__before_atomic();
868868
atomic_add(diff, &dev->vblank[crtc].count);
869-
smp_mb__after_atomic_inc();
869+
smp_mb__after_atomic();
870870
}
871871

872872
/**
@@ -1330,9 +1330,9 @@ bool drm_handle_vblank(struct drm_device *dev, int crtc)
13301330
/* Increment cooked vblank count. This also atomically commits
13311331
* the timestamp computed above.
13321332
*/
1333-
smp_mb__before_atomic_inc();
1333+
smp_mb__before_atomic();
13341334
atomic_inc(&dev->vblank[crtc].count);
1335-
smp_mb__after_atomic_inc();
1335+
smp_mb__after_atomic();
13361336
} else {
13371337
DRM_DEBUG("crtc %d: Redundant vblirq ignored. diff_ns = %d\n",
13381338
crtc, (int) diff_ns);

‎drivers/gpu/drm/i915/i915_irq.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2147,7 +2147,7 @@ static void i915_error_work_func(struct work_struct *work)
21472147
* updates before
21482148
* the counter increment.
21492149
*/
2150-
smp_mb__before_atomic_inc();
2150+
smp_mb__before_atomic();
21512151
atomic_inc(&dev_priv->gpu_error.reset_counter);
21522152

21532153
kobject_uevent_env(&dev->primary->kdev->kobj,

‎drivers/md/bcache/bcache.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ static inline bool cached_dev_get(struct cached_dev *dc)
828828
return false;
829829

830830
/* Paired with the mb in cached_dev_attach */
831-
smp_mb__after_atomic_inc();
831+
smp_mb__after_atomic();
832832
return true;
833833
}
834834

‎drivers/md/bcache/closure.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ static inline void set_closure_fn(struct closure *cl, closure_fn *fn,
243243
cl->fn = fn;
244244
cl->wq = wq;
245245
/* between atomic_dec() in closure_put() */
246-
smp_mb__before_atomic_dec();
246+
smp_mb__before_atomic();
247247
}
248248

249249
static inline void closure_queue(struct closure *cl)

0 commit comments

Comments
 (0)