From 50dc6da8904e64722cda1f457a9178a21d87e2eb Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Sat, 18 Jan 2014 12:42:47 +0100 Subject: [PATCH] connection: only schedule timeout scan for async operation --- connection.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/connection.c b/connection.c index f1c2590..af7c697 100644 --- a/connection.c +++ b/connection.c @@ -1128,7 +1128,16 @@ int kdbus_conn_kmsg_send(struct kdbus_ep *ep, atomic_inc(&reply->conn->reply_count); mutex_unlock(&conn_src->lock); - kdbus_conn_timeout_schedule_scan(conn_src); + /* + * For async operation, schedule the scan now. It won't do + * any real work at this point, but walk the list of all + * pending replies and re-arm the timer to the closest + * entry. + * For synchronous operation, the timeout will be handled + * by wait_event_interruptible_timeout(). + */ + if (!reply_wait) + kdbus_conn_timeout_schedule_scan(conn_src); } if (conn_src) { -- 2.34.1