From patchwork Tue Mar 18 14:37:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Christoph Lameter (Ampere)" X-Patchwork-Id: 3848381 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 88768BF540 for ; Tue, 18 Mar 2014 14:38:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D9F0F203AD for ; Tue, 18 Mar 2014 14:38:38 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1F7E42037F for ; Tue, 18 Mar 2014 14:38:34 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WPv9x-0006Ln-9Z; Tue, 18 Mar 2014 14:38:29 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WPv9u-0004Uy-RO; Tue, 18 Mar 2014 14:38:26 +0000 Received: from qmta11.emeryville.ca.mail.comcast.net ([2001:558:fe2d:44:76:96:27:211]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WPv9r-0004TT-9t for linux-arm-kernel@lists.infradead.org; Tue, 18 Mar 2014 14:38:23 +0000 Received: from omta12.emeryville.ca.mail.comcast.net ([76.96.30.44]) by qmta11.emeryville.ca.mail.comcast.net with comcast id f0s41n0030x6nqcAB2e1J7; Tue, 18 Mar 2014 14:38:01 +0000 Received: from gentwo.org ([98.213.233.247]) by omta12.emeryville.ca.mail.comcast.net with comcast id f2dz1n0065Lw0ES8Y2dzrP; Tue, 18 Mar 2014 14:38:00 +0000 Received: by gentwo.org (Postfix, from userid 1001) id BE7691041; Tue, 18 Mar 2014 09:37:58 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id BBFA0FED; Tue, 18 Mar 2014 09:37:58 -0500 (CDT) Date: Tue, 18 Mar 2014 09:37:58 -0500 (CDT) From: Christoph Lameter X-X-Sender: cl@nuc To: Grygorii Strashko Subject: Re: [linux-next][regression] [PATCH] percpu: add preemption checks to __this_cpu ops In-Reply-To: <53285FE7.5010203@ti.com> Message-ID: References: <53285FE7.5010203@ti.com> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1395153481; bh=Ps259SnAEFMU315mVSMIBUMexbDFKYKV8quwj+gKaeM=; h=Received:Received:Received:Received:Date:From:To:Subject: Message-ID:Content-Type; b=L7+1wGFpTBiQz3Ugg3mAMne1Ghi/ylS0ObeUEvt9S7TKVUlNGKXJrGiRj6md83qZr Ed2T7NaZW1gW5QoVw1z7CVDaFO5MjOq4abw8fmieS5NQ+05iip7765H6DvjeOvWu7L o4wlRAbXZHRXiJbPeC059pWD0JATmrdDiVOeeZYrS6qzUjI7FjOTYVTVLIKJ58aMgv 922GkK34sDvTE5jzKQTr2H8VlY/Lr1O1fq+9KZkKhPsJLHtOVJdAcjPlbi+R/oRFaT Xfv7M73GgQfRrVoABFKSh8aLcrqE1pmuUGlSKd2FC/60lHuERrNE2ODKuQxoOPvcL9 gXMOnIJttuz0A== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140318_103823_574808_9721C723 X-CRM114-Status: GOOD ( 11.90 ) X-Spam-Score: -1.9 (-) Cc: linux-kernel@vger.kernel.org, Santosh Shilimkar , Tejun Heo , Andrew Morton , Ingo Molnar , linux-arm X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, 18 Mar 2014, Grygorii Strashko wrote: > diff --git a/lib/smp_processor_id.c b/lib/smp_processor_id.c > index a270dce..73a2004 100644 > --- a/lib/smp_processor_id.c > +++ b/lib/smp_processor_id.c > @@ -58,9 +58,6 @@ EXPORT_SYMBOL(debug_smp_processor_id); > > notrace void __this_cpu_preempt_check(const char *op) > { > - char text[40]; > - > - snprintf(text, sizeof(text), "__this_cpu_%s()", op); > - check_preemption_disabled(text); > + check_preemption_disabled(op); > } > EXPORT_SYMBOL(__this_cpu_preempt_check); So it looks like there is an early this cpu operation in a context that cannot handle snprintf. But the checks in check_preemption_disabled() avoid processing there so that works. We could fix this by moving the string concatenation operation into the check function. Tested-by: Grygorii Strashko Index: linux/lib/smp_processor_id.c =================================================================== --- linux.orig/lib/smp_processor_id.c 2014-03-18 09:36:31.330450525 -0500 +++ linux/lib/smp_processor_id.c 2014-03-18 09:36:37.822315534 -0500 @@ -7,7 +7,8 @@ #include #include -notrace static unsigned int check_preemption_disabled(char *what) +notrace static unsigned int check_preemption_disabled(const char *what1, + const char *what2) { int this_cpu = raw_smp_processor_id(); @@ -38,8 +39,8 @@ if (!printk_ratelimit()) goto out_enable; - printk(KERN_ERR "BUG: using %s in preemptible [%08x] code: %s/%d\n", - what, preempt_count() - 1, current->comm, current->pid); + printk(KERN_ERR "BUG: using %s%s() in preemptible [%08x] code: %s/%d\n", + what1, what2, preempt_count() - 1, current->comm, current->pid); print_symbol("caller is %s\n", (long)__builtin_return_address(0)); dump_stack(); @@ -52,15 +53,12 @@ notrace unsigned int debug_smp_processor_id(void) { - return check_preemption_disabled("smp_processor_id()"); + return check_preemption_disabled("smp_processor_id",""); } EXPORT_SYMBOL(debug_smp_processor_id); notrace void __this_cpu_preempt_check(const char *op) { - char text[40]; - - snprintf(text, sizeof(text), "__this_cpu_%s()", op); - check_preemption_disabled(text); + check_preemption_disabled("__this_cpu_", op); } EXPORT_SYMBOL(__this_cpu_preempt_check);