Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758435AbaDXQdG (ORCPT ); Thu, 24 Apr 2014 12:33:06 -0400 Received: from e38.co.us.ibm.com ([32.97.110.159]:34268 "EHLO e38.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758390AbaDXQdB (ORCPT ); Thu, 24 Apr 2014 12:33:01 -0400 Date: Thu, 24 Apr 2014 08:16:00 -0700 From: "Paul E. McKenney" To: Rik van Riel Cc: Jiri Kosina , linux-kernel@vger.kernel.org, joern@logfs.org, peterz@infradead.org, Andrew Morton , cxie@redhat.com, Greg Kroah-Hartman , Jiri Slaby Subject: Re: [PATCH RFC] sysrq,rcu: suppress RCU stall warnings while sysrq runs Message-ID: <20140424151600.GM4496@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20140423125352.704f9fb2@annuminas.surriel.com> <535833AE.6010505@redhat.com> <20140424014648.GK4496@linux.vnet.ibm.com> <20140424090452.3482f95c@annuminas.surriel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140424090452.3482f95c@annuminas.surriel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14042416-1344-0000-0000-00000120E65B Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 24, 2014 at 09:04:52AM -0400, Rik van Riel wrote: > As suggested by Paul McKenney... > > This seems small and simple enough that it should not introduce any > extra maintenance work in the future. > > ---8<--- > > 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 > Suggested-by: Paul McKenney I guess this means you like the idea. ;-) Reviewed-by: Paul E. McKenney > --- > drivers/tty/sysrq.c | 2 ++ > include/linux/rcupdate.h | 2 ++ > kernel/rcu/update.c | 11 +++++++++++ > 3 files changed, 15 insertions(+) > > diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c > index 3c61e9b..dd53af9 100644 > --- a/drivers/tty/sysrq.c > +++ b/drivers/tty/sysrq.c > @@ -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 > @@ -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) > diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h > index 00a7fd6..b9a95f8 100644 > --- a/include/linux/rcupdate.h > +++ b/include/linux/rcupdate.h > @@ -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); > diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c > index 4c0a9b0..2ac3289 100644 > --- a/kernel/rcu/update.c > +++ b/kernel/rcu/update.c > @@ -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; > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/