Skip to content

Commit ed5f482

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. 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 ed5f482

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)