Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752689AbYL0GH0 (ORCPT ); Sat, 27 Dec 2008 01:07:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750960AbYL0GHM (ORCPT ); Sat, 27 Dec 2008 01:07:12 -0500 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:56679 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750849AbYL0GHL (ORCPT ); Sat, 27 Dec 2008 01:07:11 -0500 From: KOSAKI Motohiro To: Yinghai Lu Subject: Re: [PATCH] perf_counter: more barrier in blank weak function Cc: kosaki.motohiro@jp.fujitsu.com, Sam Ravnborg , David Howells , mingo@elte.hu, Kamalesh Babulal , Andrew Morton , Stephen Rothwell , linux-next@vger.kernel.org, LKML , mel@csn.ul.ie In-Reply-To: <4955B782.3030407@kernel.org> References: <20081226102716.GA31450@uranus.ravnborg.org> <4955B782.3030407@kernel.org> Message-Id: <20081227150534.F472.KOSAKI.MOTOHIRO@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.42 [ja] Date: Sat, 27 Dec 2008 15:07:06 +0900 (JST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1066 Lines: 31 > > Impact: fix panic possible panic etc > > some compiler seems to inline the weak global function if no line in it > > Signed-off-by: Yinghai Lu > > diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c > index d7a79f3..37f7716 100644 > --- a/kernel/perf_counter.c > +++ b/kernel/perf_counter.c > @@ -45,8 +45,8 @@ hw_perf_counter_init(struct perf_counter *counter) > } > > u64 __weak hw_perf_save_disable(void) { return 0; } > -void __weak hw_perf_restore(u64 ctrl) { } > -void __weak hw_perf_counter_setup(void) { } > +void __weak hw_perf_restore(u64 ctrl) { barrier(); } > +void __weak hw_perf_counter_setup(void) { barrier(); } We need comment into the function. I expect anyone think "hm, this barrier() is meaningless. let's cleanup." in the future. we should avoid it. -- 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/