Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Dimitri Sivanich and committed by
Linus Torvalds
b983b271 ff9d4099

-8
-2
drivers/misc/sgi-gru/grukservices.c
··· 258 258 int lcpu; 259 259 260 260 BUG_ON(dsr_bytes > GRU_NUM_KERNEL_DSR_BYTES); 261 - preempt_disable(); 262 261 bs = gru_lock_kernel_context(-1); 263 262 lcpu = uv_blade_processor_id(); 264 263 *cb = bs->kernel_cb + lcpu * GRU_HANDLE_STRIDE; ··· 271 272 static void gru_free_cpu_resources(void *cb, void *dsr) 272 273 { 273 274 gru_unlock_kernel_context(uv_numa_blade_id()); 274 - preempt_enable(); 275 275 } 276 276 277 277 /*
-4
drivers/misc/sgi-gru/grumain.c
··· 937 937 938 938 again: 939 939 mutex_lock(&gts->ts_ctxlock); 940 - preempt_disable(); 941 940 942 941 if (gru_check_context_placement(gts)) { 943 - preempt_enable(); 944 942 mutex_unlock(&gts->ts_ctxlock); 945 943 gru_unload_context(gts, 1); 946 944 return VM_FAULT_NOPAGE; ··· 947 949 if (!gts->ts_gru) { 948 950 STAT(load_user_context); 949 951 if (!gru_assign_gru_context(gts)) { 950 - preempt_enable(); 951 952 mutex_unlock(&gts->ts_ctxlock); 952 953 set_current_state(TASK_INTERRUPTIBLE); 953 954 schedule_timeout(GRU_ASSIGN_DELAY); /* true hack ZZZ */ ··· 962 965 vma->vm_page_prot); 963 966 } 964 967 965 - preempt_enable(); 966 968 mutex_unlock(&gts->ts_ctxlock); 967 969 968 970 return VM_FAULT_NOPAGE;
-2
drivers/misc/sgi-gru/grutlbpurge.c
··· 65 65 struct gru_tlb_global_handle *tgh; 66 66 int n; 67 67 68 - preempt_disable(); 69 68 if (uv_numa_blade_id() == gru->gs_blade_id) 70 69 n = get_on_blade_tgh(gru); 71 70 else ··· 78 79 static void get_unlock_tgh_handle(struct gru_tlb_global_handle *tgh) 79 80 { 80 81 unlock_tgh_handle(tgh); 81 - preempt_enable(); 82 82 } 83 83 84 84 /*