[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <174186549360.14745.8639976419196139513.tip-bot2@tip-bot2>
Date: Thu, 13 Mar 2025 11:31:33 -0000
From: "tip-bot2 for Eric Dumazet" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Eric Dumazet <edumazet@...gle.com>, Thomas Gleixner <tglx@...utronix.de>,
Frederic Weisbecker <frederic@...nel.org>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: timers/core] posix-timers: Add cond_resched() to
posix_timer_add() search loop
The following commit has been merged into the timers/core branch of tip:
Commit-ID: 5f2909c6cd13564a07ae692a95457f52295c4f22
Gitweb: https://git.kernel.org/tip/5f2909c6cd13564a07ae692a95457f52295c4f22
Author: Eric Dumazet <edumazet@...gle.com>
AuthorDate: Sat, 08 Mar 2025 17:48:17 +01:00
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Thu, 13 Mar 2025 12:07:16 +01:00
posix-timers: Add cond_resched() to posix_timer_add() search loop
With a large number of POSIX timers the search for a valid ID might cause a
soft lockup on PREEMPT_NONE/VOLUNTARY kernels.
Add cond_resched() to the loop to prevent that.
[ tglx: Split out from Eric's series ]
Signed-off-by: Eric Dumazet <edumazet@...gle.com>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Reviewed-by: Frederic Weisbecker <frederic@...nel.org>
Link: https://lore.kernel.org/all/20250214135911.2037402-2-edumazet@google.com
Link: https://lore.kernel.org/all/20250308155623.635612865@linutronix.de
---
kernel/time/posix-timers.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index 24d7eab..de25253 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -144,6 +144,7 @@ static int posix_timer_add(struct k_itimer *timer)
return id;
}
spin_unlock(&hash_lock);
+ cond_resched();
}
/* POSIX return code when no timer ID could be allocated */
return -EAGAIN;
Powered by blists - more mailing lists