mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
block: Disable preemption during IPI consideration
The function `__blk_complete_request` attempts to acquire the current CPU. It determines where the demanding request should be processed. In doing so, it checks if the current CPU and the previously requested CPU share the same cache, and if so, to place the request on the local CPU. The issue with acquiring the current CPU with using `smp_processor_id` is that the current task might be preempted mid-request completion. This will either delay block requests from being executed, or fail to execute entirely. Use `get_cpu` and `put_cpu` to prevent this oops from occurring. See `blk-mq.c` for more details. Change-Id: I4b97c1eb91f4194920baaafbb6e488dfc38e07ab Signed-off-by: Tyler Nijmeh <tylernij@gmail.com> Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This commit is contained in:
parent
06c6147719
commit
cbec1294e6
@ -105,7 +105,7 @@ void __blk_complete_request(struct request *req)
|
||||
BUG_ON(!q->softirq_done_fn);
|
||||
|
||||
local_irq_save(flags);
|
||||
cpu = smp_processor_id();
|
||||
cpu = get_cpu();
|
||||
|
||||
/*
|
||||
* Select completion CPU
|
||||
@ -147,6 +147,7 @@ do_local:
|
||||
} else if (raise_blk_irq(ccpu, req))
|
||||
goto do_local;
|
||||
|
||||
put_cpu();
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user