w1: add a scheduling point to the slave search
PATCH 1/1 w1: add a scheduling point to the slave search
sgi_w1 busy-waits through each time slot and has no triplet operation, so one 64-bit search pass holds the CPU for more than 20 ms. Without full preemption that delays every task woken meanwhile on a single CPU, enough to underrun an audio ring while the bus is searched.
Call cond_resched() once per triplet.
--- drivers/w1/w1.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/w1/w1.c +3 -0
@@ -1055,6 +1055,9 @@ void w1_search(struct w1_master *dev, u8 search_type, w1_slave_found_callback cbdev_dbg (&dev->dev,"Abort w1_search\n" );return ; } + +/* Busy-waiting masters can hold the CPU for a whole pass */ +cond_resched (); }mutex_unlock (&dev->bus_mutex);
base-commit: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907
Signature · 1 line
2.47.3
Quoted 8 lines · Imre Kaloz
sgi_w1busy-waits through each time slot and has no triplet operation, so one 64-bit search pass holds the CPU for more than 20 ms. Without full preemption that delays every task woken meanwhile on a single CPU, enough to underrun an audio ring while the bus is searched.Call
cond_resched()once per triplet.[...]
Applied, thanks!
[1/1] w1: add a scheduling point to the slave search
https://git.kernel.org/krzk/linux-w1/c/3ade61837e8e61420e37edb818abc9a6199fec6a
Best regards,
Signature · 1 line
Krzysztof Kozlowski <[email protected]>