Input: evdev - add a schedule point in evdev_write()
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 5 Oct 2018 00:45:54 +0000 (17:45 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 5 Oct 2018 18:42:31 +0000 (11:42 -0700)
Large writes to evdev interface may cause rcu stalls. Let's add
cond_resched() to the loop to avoid this.

Reviewed-by: Paul E. McKenney <paulmck@linux.ibm.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/evdev.c

index 370206f987f9600021bace25f658b6d6befbffc1..f48369d6f3a0f36ef1ab412ac95a2b2b51d55b3d 100644 (file)
@@ -564,6 +564,7 @@ static ssize_t evdev_write(struct file *file, const char __user *buffer,
 
                input_inject_event(&evdev->handle,
                                   event.type, event.code, event.value);
+               cond_resched();
        }
 
  out: