Skip to contentSkip to conversation

Input: uinput - add a schedule point in uinput_inject_events()

PATCH In review Dmitry Torokhov 2 participants 2 messages Oct 5, 2018

Subsystems (2)
lore
Share & tools
lore

Dmitry Torokhov

author maintainer
#0 lore raw

PATCH 1/1 Input: uinput - add a schedule point in uinput_inject_events()

Large writes to uinput interface may cause rcu stalls. Let's add cond_resched() to the loop to avoid this.

---
 drivers/input/misc/uinput.c | 1 +
 1 file changed, 1 insertion(+)
drivers/input/misc/uinput.c +1 -0
index eb14ddf69346..8ec483e8688b 100644
@@ -598,6 +598,7 @@ static ssize_t uinput_inject_events(struct uinput_device *udev,
 
 		input_event(udev->dev, ev.type, ev.code, ev.value);
 		bytes += input_event_size();
+		cond_resched();
 	}
 
 	return bytes;
Signature · 5 lines
2.19.0.605.g01d371f741-goog


-- 
Dmitry
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Dmitry Torokhov

Large writes to uinput interface may cause rcu stalls. Let's add cond_resched() to the loop to avoid this.

Quoted 23 lines
---
 drivers/input/misc/uinput.c | 1 +
 1 file changed, 1 insertion(+)
drivers/input/misc/uinput.c +1 -0
index eb14ddf69346..8ec483e8688b 100644
@@ -598,6 +598,7 @@ static ssize_t uinput_inject_events(struct uinput_device *udev,
 
 		input_event(udev->dev, ev.type, ev.code, ev.value);
 		bytes += input_event_size();
+		cond_resched();
 	}
 
 	return bytes;
Signature · 5 lines
2.19.0.605.g01d371f741-goog


-- 
Dmitry