Skip to content

Commit bfaaaf8

Browse files
committed
Input: evdev - Modify the process of closing the evdev device to use the synchronize_rcu_expedited interface to speed up the shutdown process.
deepin inclusion categroy: performace As Documentations saied: synchronize_rcu_expedited() instead of synchronize_rcu(). This reduces latency, but can increase CPU utilization, degrade real-time latency, and degrade energy efficiency. use it to optimize the shutdown process by our system developer report where some input dev shutdown cost many XXms. With the patched kernel, shutdown cost time from 5.96 to 5.11. Tested-by: qiancheng <qiancheng@uniontech.com> Signed-off-by: huangbibo <huangbibo@uniontech.com> Signed-off-by: tuhaowen <tuhaowen@uniontech.com> Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent 721c505 commit bfaaaf8

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/input/evdev.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,13 @@ static void evdev_detach_client(struct evdev *evdev,
383383
spin_lock(&evdev->client_lock);
384384
list_del_rcu(&client->node);
385385
spin_unlock(&evdev->client_lock);
386-
synchronize_rcu();
386+
387+
if (system_state == SYSTEM_HALT ||
388+
system_state == SYSTEM_POWER_OFF ||
389+
system_state == SYSTEM_RESTART)
390+
synchronize_rcu_expedited();
391+
else
392+
synchronize_rcu();
387393
}
388394

389395
static int evdev_open_device(struct evdev *evdev)

0 commit comments

Comments
 (0)