Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756144Ab3HFTAP (ORCPT ); Tue, 6 Aug 2013 15:00:15 -0400 Received: from a193-30.smtp-out.amazonses.com ([199.255.193.30]:8059 "EHLO a193-30.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755765Ab3HFTAO (ORCPT ); Tue, 6 Aug 2013 15:00:14 -0400 X-Greylist: delayed 556 seconds by postgrey-1.27 at vger.kernel.org; Tue, 06 Aug 2013 15:00:13 EDT Date: Tue, 6 Aug 2013 18:50:56 +0000 From: Christoph Lameter To: Steven Rostedt cc: linux-kernel@vger.kernel.org Subject: Re: x86: use this_cpu for debug_stack_usage In-Reply-To: <1375811455.25420.39.camel@gandalf.local.home> Message-ID: <0000014054f7bbe5-97cac4df-1811-4f3f-8bfe-8f754774e006-000000@email.amazonses.com> References: <000001405493dacb-4d662921-2531-400a-a426-4f76c8066ede-000000@email.amazonses.com> <1375811455.25420.39.camel@gandalf.local.home> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SES-Outgoing: 199.255.193.30 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 961 Lines: 29 On Tue, 6 Aug 2013, Steven Rostedt wrote: > I don't remember why I didn't use this in the first place. Perhaps I was > still in the "get_cpu" mind set. > > Also, what's the difference between "__this_cpu_inc()" and > "this_cpu_inc()"? The fallback logic for arches not supporting segment prefixes is differnt. this_cpu_inc() disables interrupts. __this_cpu_inc() is used when you know that the scheduler cannot move the process. The code generated by both is the same on x86. > > int is_debug_stack(unsigned long addr); > > void debug_stack_set_zero(void); > > Might as well change is_debug_stack() to use __this_cpu_read() instead > of __get_cpu_var(). True and that will also shave off some instructions. -- 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/