Skip to content

Commit

Permalink
sysrq,rcu: suppress RCU stall warnings while sysrq runs
Browse files Browse the repository at this point in the history
Some sysrq handlers can run for a long time, because they dump a lot
of data onto a serial console. Having RCU stall warnings pop up in
the middle of them only makes the problem worse.

This patch temporarily disables RCU stall warnings while a sysrq
request is handled.

Signed-off-by: Rik van Riel <[email protected]>
Suggested-by: Paul McKenney <[email protected]>
Reviewed-by: Paul E. McKenney <[email protected]>
Cc: Jiri Kosina <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Joern Engel <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Madper Xie <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Rik van Riel authored and hnaz committed Apr 24, 2014
1 parent fd2efee commit efc352d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/tty/sysrq.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ void __handle_sysrq(int key, bool check_mask)
int orig_log_level;
int i;

rcu_sysrq_start();
rcu_read_lock();
/*
* Raise the apparent loglevel to maximum so that the sysrq header
Expand Down Expand Up @@ -554,6 +555,7 @@ void __handle_sysrq(int key, bool check_mask)
console_loglevel = orig_log_level;
}
rcu_read_unlock();
rcu_sysrq_end();
}

void handle_sysrq(int key)
Expand Down
2 changes: 2 additions & 0 deletions include/linux/rcupdate.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ void rcu_idle_enter(void);
void rcu_idle_exit(void);
void rcu_irq_enter(void);
void rcu_irq_exit(void);
void rcu_sysrq_start(void);
void rcu_sysrq_end(void);

#ifdef CONFIG_RCU_USER_QS
void rcu_user_enter(void);
Expand Down
11 changes: 11 additions & 0 deletions kernel/rcu/update.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,17 @@ int rcu_jiffies_till_stall_check(void)
return till_stall_check * HZ + RCU_STALL_DELAY_DELTA;
}

void rcu_sysrq_start(void)
{
rcu_cpu_stall_suppress = 2;
}

void rcu_sysrq_end(void)
{
if (rcu_cpu_stall_suppress == 2)
rcu_cpu_stall_suppress = 0;
}

static int rcu_panic(struct notifier_block *this, unsigned long ev, void *ptr)
{
rcu_cpu_stall_suppress = 1;
Expand Down

0 comments on commit efc352d

Please sign in to comment.