From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754729AbaD1TU7 (ORCPT ); Mon, 28 Apr 2014 15:20:59 -0400 Received: from merlin.infradead.org ([205.233.59.134]:45264 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751902AbaD1TU4 (ORCPT ); Mon, 28 Apr 2014 15:20:56 -0400 Message-ID: <535E8D14.7080405@infradead.org> Date: Mon, 28 Apr 2014 10:17:08 -0700 From: Randy Dunlap User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: paulmck@linux.vnet.ibm.com CC: Rik van Riel , akpm@linux-foundation.org, linux-kernel@vger.kernel.org, Richard Weinberger , linux-next@vger.kernel.org, umgwanakikbuti@gmail.com Subject: Re: mmotm 2014-04-24-13-07 uploaded References: <20140424200837.727695A407C@corp2gmr1-2.hot.corp.google.com> <535992DD.3060808@infradead.org> <20140425100459.7824f676@annuminas.surriel.com> <535AC91A.1070504@infradead.org> <535ACB0E.4070600@infradead.org> <20140427062650.GW4496@linux.vnet.ibm.com> <20140428135540.GA14661@linux.vnet.ibm.com> In-Reply-To: <20140428135540.GA14661@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/28/14 06:55, Paul E. McKenney wrote: > On Sat, Apr 26, 2014 at 11:26:50PM -0700, Paul E. McKenney wrote: >> On Fri, Apr 25, 2014 at 01:52:30PM -0700, Randy Dunlap wrote: >>> On 04/25/14 13:44, Randy Dunlap wrote: >>>> On 04/25/14 07:04, Rik van Riel wrote: >>>>> On Thu, 24 Apr 2014 15:40:29 -0700 >>>>> Randy Dunlap wrote: >>>>> >>>>> >>>>>> uml on x86_64 defconfig: >>>>>> >>>>>> drivers/built-in.o: In function `__handle_sysrq': >>>>>> drivers/tty/sysrq.c:514: undefined reference to `rcu_sysrq_start' >>>>>> drivers/tty/sysrq.c:558: undefined reference to `rcu_sysrq_end' >>>>> >>>>> Randy, does the patch below fix it? >>> >>> CONFIG_TINY_RCU=y >>> >>> tiny.c does not provide these functions... Paul... >>> >>>> Hm, no, it does not. I'll look into it. >>>> >>>>> Mike, this patch should also address your concerns. >>>>> >>>>> Andrew, this can be a -fix patch for the sysctl-rcu patch, >>>>> assuming it fixes things :) >>>>> >>>>> Signed-off-by: Rik van Riel >>>> --- >>>>> drivers/tty/sysrq.c | 1 + >>>>> kernel/rcu/update.c | 3 ++- >>>>> 2 files changed, 3 insertions(+), 1 deletion(-) >>>>> >>>>> diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c >>>>> index dd53af9..0867433 100644 >>>>> --- a/drivers/tty/sysrq.c >>>>> +++ b/drivers/tty/sysrq.c >>>>> @@ -46,6 +46,7 @@ >>>>> #include >>>>> #include >>>>> #include >>>>> +#include >>>>> >>>>> #include >>>>> #include >>>>> diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c >>>>> index 2ac3289..d22309c 100644 >>>>> --- a/kernel/rcu/update.c >>>>> +++ b/kernel/rcu/update.c >>>>> @@ -322,7 +322,8 @@ int rcu_jiffies_till_stall_check(void) >>>>> >>>>> void rcu_sysrq_start(void) >>>>> { >>>>> - rcu_cpu_stall_suppress = 2; >>>>> + if (!rcu_cpu_stall_suppress) >>>>> + rcu_cpu_stall_suppress = 2; >>>>> } >>>>> >>>>> void rcu_sysrq_end(void) >> >> You would think that I would have learned by now that RCU requires a bit >> more care... Anyway, patch containing only the APIs that -should- work >> is below. Currently testing it on the usual set of configs. > > Right... Adding a "static inline" would help, wouldn't it? Updated > patch below. > > Thanx, Paul > > ------------------------------------------------------------------------ > > rcu: Provide API to suppress stall warnings while sysrc runs > > 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 commit provides rcu_sysrq_start() and rcu_sysrq_end() APIs to > temporarily suppress RCU CPU stall warnings while a sysrq request is > handled. > > Signed-off-by: Rik van Riel > [ paulmck: Fix TINY_RCU build error. ] > Signed-off-by: Paul E. McKenney > > diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h > index a6f2664a1b77..ca6fe55913b7 100644 > --- a/include/linux/rcupdate.h > +++ b/include/linux/rcupdate.h > @@ -248,6 +248,18 @@ void rcu_idle_exit(void); > void rcu_irq_enter(void); > void rcu_irq_exit(void); > > +#ifdef CONFIG_RCU_STALL_COMMON > +void rcu_sysrq_start(void); > +void rcu_sysrq_end(void); > +#else /* #ifdef CONFIG_RCU_STALL_COMMON */ > +static inline void rcu_sysrq_start(void) > +{ > +} > +static inline void rcu_sysrq_end(void) > +{ > +} > +#endif /* #else #ifdef CONFIG_RCU_STALL_COMMON */ > + > #ifdef CONFIG_RCU_USER_QS > void rcu_user_enter(void); > void rcu_user_exit(void); > diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c > index ed7a0d72562c..a2aeb4df0f60 100644 > --- a/kernel/rcu/update.c > +++ b/kernel/rcu/update.c > @@ -320,6 +320,18 @@ int rcu_jiffies_till_stall_check(void) > return till_stall_check * HZ + RCU_STALL_DELAY_DELTA; > } > > +void rcu_sysrq_start(void) > +{ > + if (!rcu_cpu_stall_suppress) > + 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; > > -- uml defconfig on x86_64: CC arch/um/kernel/asm-offsets.s In file included from include/linux/sem.h:5:0, from include/linux/sched.h:35, from arch/x86/um/shared/sysdep/kernel-offsets.h:2, from arch/um/kernel/asm-offsets.c:1: include/linux/rcupdate.h:257:20: error: static declaration of 'rcu_sysrq_start' follows non-static declaration include/linux/rcupdate.h:250:6: note: previous declaration of 'rcu_sysrq_start' was here include/linux/rcupdate.h:260:20: error: static declaration of 'rcu_sysrq_end' follows non-static declaration include/linux/rcupdate.h:251:6: note: previous declaration of 'rcu_sysrq_end' was here make[2]: *** [arch/um/kernel/asm-offsets.s] Error 1 Please test your patch(es). -- ~Randy