Skip to content

Commit

Permalink
aio: remove no longer needed preempt_disable()
Browse files Browse the repository at this point in the history
Based on feedback from Jens Axboe on 263782c,
clean up get/put_reqs_available() to remove the no longer needed preempt_disable()
and preempt_enable() pair.

Signed-off-by: Benjamin LaHaise <[email protected]>
Cc: Jens Axboe <[email protected]>
  • Loading branch information
bcrl committed Jul 22, 2014
1 parent 6e830d5 commit be6fb45
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions fs/aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -814,10 +814,8 @@ static void put_reqs_available(struct kioctx *ctx, unsigned nr)
struct kioctx_cpu *kcpu;
unsigned long flags;

preempt_disable();
kcpu = this_cpu_ptr(ctx->cpu);

local_irq_save(flags);
kcpu = this_cpu_ptr(ctx->cpu);
kcpu->reqs_available += nr;

while (kcpu->reqs_available >= ctx->req_batch * 2) {
Expand All @@ -826,7 +824,6 @@ static void put_reqs_available(struct kioctx *ctx, unsigned nr)
}

local_irq_restore(flags);
preempt_enable();
}

static bool get_reqs_available(struct kioctx *ctx)
Expand All @@ -835,10 +832,8 @@ static bool get_reqs_available(struct kioctx *ctx)
bool ret = false;
unsigned long flags;

preempt_disable();
kcpu = this_cpu_ptr(ctx->cpu);

local_irq_save(flags);
kcpu = this_cpu_ptr(ctx->cpu);
if (!kcpu->reqs_available) {
int old, avail = atomic_read(&ctx->reqs_available);

Expand All @@ -858,7 +853,6 @@ static bool get_reqs_available(struct kioctx *ctx)
kcpu->reqs_available--;
out:
local_irq_restore(flags);
preempt_enable();
return ret;
}

Expand Down

0 comments on commit be6fb45

Please sign in to comment.