]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
misc: sgi-gru: Don't disable preemption in GRU driver
authorDimitri Sivanich <sivanich@hpe.com>
Thu, 19 Sep 2024 12:34:50 +0000 (07:34 -0500)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 9 Oct 2024 19:47:01 +0000 (12:47 -0700)
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>
drivers/misc/sgi-gru/grukservices.c
drivers/misc/sgi-gru/grumain.c
drivers/misc/sgi-gru/grutlbpurge.c

index 37e804bbb1f281c046c7d70cefb444d8097712bb..205945ce9e86a6b3d2349574f0fd798993a64724 100644 (file)
@@ -258,7 +258,6 @@ static int gru_get_cpu_resources(int dsr_bytes, void **cb, void **dsr)
        int lcpu;
 
        BUG_ON(dsr_bytes > GRU_NUM_KERNEL_DSR_BYTES);
-       preempt_disable();
        bs = gru_lock_kernel_context(-1);
        lcpu = uv_blade_processor_id();
        *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)
 static void gru_free_cpu_resources(void *cb, void *dsr)
 {
        gru_unlock_kernel_context(uv_numa_blade_id());
-       preempt_enable();
 }
 
 /*
index 0f5b09e290c899818ef83a866ac2e64201d10429..3036c15f3689259345a1bdf34fff89c9aab84297 100644 (file)
@@ -937,10 +937,8 @@ vm_fault_t gru_fault(struct vm_fault *vmf)
 
 again:
        mutex_lock(&gts->ts_ctxlock);
-       preempt_disable();
 
        if (gru_check_context_placement(gts)) {
-               preempt_enable();
                mutex_unlock(&gts->ts_ctxlock);
                gru_unload_context(gts, 1);
                return VM_FAULT_NOPAGE;
@@ -949,7 +947,6 @@ again:
        if (!gts->ts_gru) {
                STAT(load_user_context);
                if (!gru_assign_gru_context(gts)) {
-                       preempt_enable();
                        mutex_unlock(&gts->ts_ctxlock);
                        set_current_state(TASK_INTERRUPTIBLE);
                        schedule_timeout(GRU_ASSIGN_DELAY);  /* true hack ZZZ */
@@ -965,7 +962,6 @@ again:
                                vma->vm_page_prot);
        }
 
-       preempt_enable();
        mutex_unlock(&gts->ts_ctxlock);
 
        return VM_FAULT_NOPAGE;
index 10921cd2608dfa3bfabe58d49630f43cd034bbb1..1107dd3e2e9fa43b867cee20253284b697d53643 100644 (file)
@@ -65,7 +65,6 @@ static struct gru_tlb_global_handle *get_lock_tgh_handle(struct gru_state
        struct gru_tlb_global_handle *tgh;
        int n;
 
-       preempt_disable();
        if (uv_numa_blade_id() == gru->gs_blade_id)
                n = get_on_blade_tgh(gru);
        else
@@ -79,7 +78,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)
 {
        unlock_tgh_handle(tgh);
-       preempt_enable();
 }
 
 /*