misc: sgi-gru: Don't disable preemption in GRU driver

[ Upstream commit b983b271662bd6104d429b0fd97af3333ba760bf ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Dimitri Sivanich
2024-09-19 07:34:50 -05:00
committed by Greg Kroah-Hartman
parent 34f2d9975a
commit 88a0888162
3 changed files with 0 additions and 8 deletions

View File

@@ -270,7 +270,6 @@ static int gru_get_cpu_resources(int dsr_bytes, void **cb, void **dsr)
int lcpu; int lcpu;
BUG_ON(dsr_bytes > GRU_NUM_KERNEL_DSR_BYTES); BUG_ON(dsr_bytes > GRU_NUM_KERNEL_DSR_BYTES);
preempt_disable();
bs = gru_lock_kernel_context(-1); bs = gru_lock_kernel_context(-1);
lcpu = uv_blade_processor_id(); lcpu = uv_blade_processor_id();
*cb = bs->kernel_cb + lcpu * GRU_HANDLE_STRIDE; *cb = bs->kernel_cb + lcpu * GRU_HANDLE_STRIDE;
@@ -284,7 +283,6 @@ static int gru_get_cpu_resources(int dsr_bytes, void **cb, void **dsr)
static void gru_free_cpu_resources(void *cb, void *dsr) static void gru_free_cpu_resources(void *cb, void *dsr)
{ {
gru_unlock_kernel_context(uv_numa_blade_id()); gru_unlock_kernel_context(uv_numa_blade_id());
preempt_enable();
} }
/* /*

View File

@@ -954,10 +954,8 @@ vm_fault_t gru_fault(struct vm_fault *vmf)
again: again:
mutex_lock(&gts->ts_ctxlock); mutex_lock(&gts->ts_ctxlock);
preempt_disable();
if (gru_check_context_placement(gts)) { if (gru_check_context_placement(gts)) {
preempt_enable();
mutex_unlock(&gts->ts_ctxlock); mutex_unlock(&gts->ts_ctxlock);
gru_unload_context(gts, 1); gru_unload_context(gts, 1);
return VM_FAULT_NOPAGE; return VM_FAULT_NOPAGE;
@@ -966,7 +964,6 @@ vm_fault_t gru_fault(struct vm_fault *vmf)
if (!gts->ts_gru) { if (!gts->ts_gru) {
STAT(load_user_context); STAT(load_user_context);
if (!gru_assign_gru_context(gts)) { if (!gru_assign_gru_context(gts)) {
preempt_enable();
mutex_unlock(&gts->ts_ctxlock); mutex_unlock(&gts->ts_ctxlock);
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(GRU_ASSIGN_DELAY); /* true hack ZZZ */ schedule_timeout(GRU_ASSIGN_DELAY); /* true hack ZZZ */
@@ -982,7 +979,6 @@ vm_fault_t gru_fault(struct vm_fault *vmf)
vma->vm_page_prot); vma->vm_page_prot);
} }
preempt_enable();
mutex_unlock(&gts->ts_ctxlock); mutex_unlock(&gts->ts_ctxlock);
return VM_FAULT_NOPAGE; return VM_FAULT_NOPAGE;

View File

@@ -78,7 +78,6 @@ static struct gru_tlb_global_handle *get_lock_tgh_handle(struct gru_state
struct gru_tlb_global_handle *tgh; struct gru_tlb_global_handle *tgh;
int n; int n;
preempt_disable();
if (uv_numa_blade_id() == gru->gs_blade_id) if (uv_numa_blade_id() == gru->gs_blade_id)
n = get_on_blade_tgh(gru); n = get_on_blade_tgh(gru);
else else
@@ -92,7 +91,6 @@ static struct gru_tlb_global_handle *get_lock_tgh_handle(struct gru_state
static void get_unlock_tgh_handle(struct gru_tlb_global_handle *tgh) static void get_unlock_tgh_handle(struct gru_tlb_global_handle *tgh)
{ {
unlock_tgh_handle(tgh); unlock_tgh_handle(tgh);
preempt_enable();
} }
/* /*