Skip to content

Commit 9745cdb

Browse files
colincrossrafaeljw
authored andcommitted
select: use freezable blocking call
Avoid waking up every thread sleeping in a select call during suspend and resume by calling a freezable blocking call. Previous patches modified the freezer to avoid sending wakeups to threads that are blocked in freezable blocking calls. This call was selected to be converted to a freezable call because it doesn't hold any locks or release any resources when interrupted that might be needed by another freezing task or a kernel driver during suspend, and is a common site where idle userspace tasks are blocked. Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Colin Cross <ccross@android.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 1c441e9 commit 9745cdb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎fs/select.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <linux/rcupdate.h>
2828
#include <linux/hrtimer.h>
2929
#include <linux/sched/rt.h>
30+
#include <linux/freezer.h>
3031

3132
#include <asm/uaccess.h>
3233

@@ -236,7 +237,8 @@ int poll_schedule_timeout(struct poll_wqueues *pwq, int state,
236237

237238
set_current_state(state);
238239
if (!pwq->triggered)
239-
rc = schedule_hrtimeout_range(expires, slack, HRTIMER_MODE_ABS);
240+
rc = freezable_schedule_hrtimeout_range(expires, slack,
241+
HRTIMER_MODE_ABS);
240242
__set_current_state(TASK_RUNNING);
241243

242244
/*

0 commit comments

Comments
 (0)