File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 20
20
#include <linux/moduleparam.h>
21
21
#include <linux/random.h>
22
22
#include <linux/rcupdate.h>
23
+ #include <linux/sched/sysctl.h>
23
24
#include <linux/seq_file.h>
24
25
#include <linux/slab.h>
25
26
#include <linux/spinlock.h>
@@ -621,7 +622,16 @@ static void toggle_allocation_gate(struct work_struct *work)
621
622
/* Enable static key, and await allocation to happen. */
622
623
static_branch_enable (& kfence_allocation_key );
623
624
624
- wait_event_timeout (allocation_wait , atomic_read (& kfence_allocation_gate ), HZ );
625
+ if (sysctl_hung_task_timeout_secs ) {
626
+ /*
627
+ * During low activity with no allocations we might wait a
628
+ * while; let's avoid the hung task warning.
629
+ */
630
+ wait_event_timeout (allocation_wait , atomic_read (& kfence_allocation_gate ),
631
+ sysctl_hung_task_timeout_secs * HZ / 2 );
632
+ } else {
633
+ wait_event (allocation_wait , atomic_read (& kfence_allocation_gate ));
634
+ }
625
635
626
636
/* Disable static key and reset timer. */
627
637
static_branch_disable (& kfence_allocation_key );
You can’t perform that action at this time.
0 commit comments