From mboxrd@z Thu Jan 1 00:00:00 1970 From: Raghavendra K T Subject: Re: [PATCH RFC 1/2] qspinlock: Introducing a 4-byte queue spinlock implementation Date: Fri, 02 Aug 2013 02:06:18 +0530 Message-ID: <51FAC6C2.7090508@linux.vnet.ibm.com> References: <1375324631-32868-1-git-send-email-Waiman.Long@hp.com> <1375324631-32868-2-git-send-email-Waiman.Long@hp.com> <20130801094029.GK3008@twins.programming.kicks-ass.net> <51FAA1C3.2050507@hp.com> <51FAA5F8.2070209@linux.vnet.ibm.com> <20130801201018.GR3008@twins.programming.kicks-ass.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130801201018.GR3008@twins.programming.kicks-ass.net> Sender: linux-kernel-owner@vger.kernel.org To: Peter Zijlstra Cc: Waiman Long , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Arnd Bergmann , linux-arch@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Steven Rostedt , Andrew Morton , Richard Weinberger , Catalin Marinas , Greg Kroah-Hartman , Matt Fleming , Herbert Xu , Akinobu Mita , Rusty Russell , Michel Lespinasse , Andi Kleen , Rik van Riel , "Paul E. McKenney" , Linus Torvalds , George Spelvin , Harvey Harrison List-Id: linux-arch.vger.kernel.org On 08/02/2013 01:40 AM, Peter Zijlstra wrote: > On Thu, Aug 01, 2013 at 11:46:24PM +0530, Raghavendra K T wrote: >> On 08/01/2013 11:28 PM, Waiman Long wrote: >>> On 08/01/2013 05:40 AM, Peter Zijlstra wrote: >>>> On Wed, Jul 31, 2013 at 10:37:10PM -0400, Waiman Long wrote: >>>> >> [...] >>>> >>>>> + */ >>>>> + for (qn_idx = 1; qn_idx< MAX_QNODES; qn_idx++) { >>>>> + if (!node[qn_idx].used) >>>>> + break; >>>> } >>>> >>>>> + if (unlikely(qn_idx == MAX_QNODES)) { >>>>> + /* >>>>> + * This shouldn't happen, print a warning message >>>>> + *& busy spinning on the lock. >>>>> + */ >>>>> + pr_warn("qspinlock: queue node table exhausted at " >>>>> + "cpu %d!\n", cpu_nr); >>>> This could make your machine die hard.. not all contexts can printk(). >>> >>> Do you have any suggestion? I could skip the warning and silently do the >>> busy spinning. I just want some way to notify the user of this rare event. >> >> We have used debugfs in pv-spinlock to avoid that since printk uses >> spinlock again. may be it will help to profile many other parts of >> code too. > > I always use early_printk(), but that requires you set up your serial > console properly and joe-user won't have done that. > Thanks Peter. Yes. this is more convenient. /me remembers using early_printk during pvops patch debugging without setting up serial console ;) From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e28smtp08.in.ibm.com ([122.248.162.8]:35528 "EHLO e28smtp08.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756140Ab3HAU36 (ORCPT ); Thu, 1 Aug 2013 16:29:58 -0400 Received: from /spool/local by e28smtp08.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 2 Aug 2013 01:49:42 +0530 Message-ID: <51FAC6C2.7090508@linux.vnet.ibm.com> Date: Fri, 02 Aug 2013 02:06:18 +0530 From: Raghavendra K T MIME-Version: 1.0 Subject: Re: [PATCH RFC 1/2] qspinlock: Introducing a 4-byte queue spinlock implementation References: <1375324631-32868-1-git-send-email-Waiman.Long@hp.com> <1375324631-32868-2-git-send-email-Waiman.Long@hp.com> <20130801094029.GK3008@twins.programming.kicks-ass.net> <51FAA1C3.2050507@hp.com> <51FAA5F8.2070209@linux.vnet.ibm.com> <20130801201018.GR3008@twins.programming.kicks-ass.net> In-Reply-To: <20130801201018.GR3008@twins.programming.kicks-ass.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Peter Zijlstra Cc: Waiman Long , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Arnd Bergmann , linux-arch@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Steven Rostedt , Andrew Morton , Richard Weinberger , Catalin Marinas , Greg Kroah-Hartman , Matt Fleming , Herbert Xu , Akinobu Mita , Rusty Russell , Michel Lespinasse , Andi Kleen , Rik van Riel , "Paul E. McKenney" , Linus Torvalds , George Spelvin , Harvey Harrison , "Chandramouleeswaran, Aswin" , "Norton, Scott J" Message-ID: <20130801203618.oM13kJ7xWx8IlVdc5Sxfm42qK7m5-qZSOZl8ngnrZco@z> On 08/02/2013 01:40 AM, Peter Zijlstra wrote: > On Thu, Aug 01, 2013 at 11:46:24PM +0530, Raghavendra K T wrote: >> On 08/01/2013 11:28 PM, Waiman Long wrote: >>> On 08/01/2013 05:40 AM, Peter Zijlstra wrote: >>>> On Wed, Jul 31, 2013 at 10:37:10PM -0400, Waiman Long wrote: >>>> >> [...] >>>> >>>>> + */ >>>>> + for (qn_idx = 1; qn_idx< MAX_QNODES; qn_idx++) { >>>>> + if (!node[qn_idx].used) >>>>> + break; >>>> } >>>> >>>>> + if (unlikely(qn_idx == MAX_QNODES)) { >>>>> + /* >>>>> + * This shouldn't happen, print a warning message >>>>> + *& busy spinning on the lock. >>>>> + */ >>>>> + pr_warn("qspinlock: queue node table exhausted at " >>>>> + "cpu %d!\n", cpu_nr); >>>> This could make your machine die hard.. not all contexts can printk(). >>> >>> Do you have any suggestion? I could skip the warning and silently do the >>> busy spinning. I just want some way to notify the user of this rare event. >> >> We have used debugfs in pv-spinlock to avoid that since printk uses >> spinlock again. may be it will help to profile many other parts of >> code too. > > I always use early_printk(), but that requires you set up your serial > console properly and joe-user won't have done that. > Thanks Peter. Yes. this is more convenient. /me remembers using early_printk during pvops patch debugging without setting up serial console ;)