From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19817 invoked by alias); 19 Nov 2009 18:56:04 -0000 Received: (qmail 19809 invoked by uid 22791); 19 Nov 2009 18:56:03 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp1.linux-foundation.org (HELO smtp1.linux-foundation.org) (140.211.169.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 19 Nov 2009 18:54:59 +0000 Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id nAJIshqV030967 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 19 Nov 2009 10:54:44 -0800 Received: from localhost (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with ESMTP id nAJIsgvh025826; Thu, 19 Nov 2009 10:54:42 -0800 Date: Thu, 19 Nov 2009 18:56:00 -0000 From: Linus Torvalds To: Andrew Haley cc: Richard Guenther , rostedt@goodmis.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , LKML , Andrew Morton , Heiko Carstens , feng.tang@intel.com, Fr??d??ric Weisbecker , Peter Zijlstra , jakub@redhat.com, gcc@gcc.gnu.org Subject: Re: BUG: GCC-4.4.x changes the function frame on some functions In-Reply-To: Message-ID: References: <20091119072040.GA23579@elte.hu> <1258653562.22249.682.camel@gandalf.stny.rr.com> <84fc9c000911191003t244eb864o3d5b355ab5485f@mail.gmail.com> <4B058CCD.8050605@redhat.com> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MIMEDefang-Filter: lf$Revision: 1.188 $ Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-11/txt/msg00521.txt.bz2 On Thu, 19 Nov 2009, Linus Torvalds wrote: > > I bet other people than just the kernel use the mcount hook for subtler > things than just doing profiles. And even if they don't, the quoted code > generation is just crazy _crap_. For the kernel, if the only case is that timer_stat.c thing that Thomas pointed at, I guess we can at least work around it with something like the appended. The kernel code is certainly ugly too, no question about that. It's just that we'd like to be able to depend on mcount code generation not being insane even in the presense of ugly code.. The alternative would be to have some warning when this happens, so that we can at least see it. "mcount won't work reliably" Linus --- kernel/time/timer_stats.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/time/timer_stats.c b/kernel/time/timer_stats.c index ee5681f..488c7b8 100644 --- a/kernel/time/timer_stats.c +++ b/kernel/time/timer_stats.c @@ -76,7 +76,7 @@ struct entry { */ char comm[TASK_COMM_LEN + 1]; -} ____cacheline_aligned_in_smp; +}; /* * Spinlock protecting the tables - not taken during lookup: @@ -114,7 +114,7 @@ static ktime_t time_start, time_stop; #define MAX_ENTRIES (1UL << MAX_ENTRIES_BITS) static unsigned long nr_entries; -static struct entry entries[MAX_ENTRIES]; +static struct entry entries[MAX_ENTRIES] ____cacheline_aligned_in_smp; static atomic_t overflow_count;