Skip to content

Commit b983b27

Browse files
Dimitri Sivanichtorvalds
authored andcommitted
misc: sgi-gru: Don't disable preemption in GRU driver
Disabling preemption in the GRU driver is unnecessary, and clashes with sleeping locks in several code paths. Remove preempt_disable and preempt_enable from the GRU driver. Signed-off-by: Dimitri Sivanich <sivanich@hpe.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent ff9d409 commit b983b27

File tree

3 files changed

+0
-8
lines changed

3 files changed

+0
-8
lines changed

drivers/misc/sgi-gru/grukservices.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ static int gru_get_cpu_resources(int dsr_bytes, void **cb, void **dsr)
258258
int lcpu;
259259

260260
BUG_ON(dsr_bytes > GRU_NUM_KERNEL_DSR_BYTES);
261-
preempt_disable();
262261
bs = gru_lock_kernel_context(-1);
263262
lcpu = uv_blade_processor_id();
264263
*cb = bs->kernel_cb + lcpu * GRU_HANDLE_STRIDE;
@@ -272,7 +271,6 @@ static int gru_get_cpu_resources(int dsr_bytes, void **cb, void **dsr)
272271
static void gru_free_cpu_resources(void *cb, void *dsr)
273272
{
274273
gru_unlock_kernel_context(uv_numa_blade_id());
275-
preempt_enable();
276274
}
277275

278276
/*

drivers/misc/sgi-gru/grumain.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -937,10 +937,8 @@ vm_fault_t gru_fault(struct vm_fault *vmf)
937937

938938
again:
939939
mutex_lock(&gts->ts_ctxlock);
940-
preempt_disable();
941940

942941
if (gru_check_context_placement(gts)) {
943-
preempt_enable();
944942
mutex_unlock(&gts->ts_ctxlock);
945943
gru_unload_context(gts, 1);
946944
return VM_FAULT_NOPAGE;
@@ -949,7 +947,6 @@ vm_fault_t gru_fault(struct vm_fault *vmf)
949947
if (!gts->ts_gru) {
950948
STAT(load_user_context);
951949
if (!gru_assign_gru_context(gts)) {
952-
preempt_enable();
953950
mutex_unlock(&gts->ts_ctxlock);
954951
set_current_state(TASK_INTERRUPTIBLE);
955952
schedule_timeout(GRU_ASSIGN_DELAY); /* true hack ZZZ */
@@ -965,7 +962,6 @@ vm_fault_t gru_fault(struct vm_fault *vmf)
965962
vma->vm_page_prot);
966963
}
967964

968-
preempt_enable();
969965
mutex_unlock(&gts->ts_ctxlock);
970966

971967
return VM_FAULT_NOPAGE;

drivers/misc/sgi-gru/grutlbpurge.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ static struct gru_tlb_global_handle *get_lock_tgh_handle(struct gru_state
6565
struct gru_tlb_global_handle *tgh;
6666
int n;
6767

68-
preempt_disable();
6968
if (uv_numa_blade_id() == gru->gs_blade_id)
7069
n = get_on_blade_tgh(gru);
7170
else
@@ -79,7 +78,6 @@ static struct gru_tlb_global_handle *get_lock_tgh_handle(struct gru_state
7978
static void get_unlock_tgh_handle(struct gru_tlb_global_handle *tgh)
8079
{
8180
unlock_tgh_handle(tgh);
82-
preempt_enable();
8381
}
8482

8583
/*

0 commit comments

Comments
 (0)