From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757567Ab0ENL5J (ORCPT ); Fri, 14 May 2010 07:57:09 -0400 Received: from mx2.mail.elte.hu ([157.181.151.9]:51221 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754290Ab0ENL5F (ORCPT ); Fri, 14 May 2010 07:57:05 -0400 Date: Fri, 14 May 2010 13:56:55 +0200 From: Ingo Molnar To: Lin Ming Cc: Cyrill Gorcunov , Jaswinder Singh Rajput , Linux Kernel Mailing List , Peter Zijlstra Subject: Re: Performance Events hangs with Intel P4 system Message-ID: <20100514115655.GA18069@elte.hu> References: <1273834571.3530.82.camel@minggr.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1273834571.3530.82.camel@minggr.sh.intel.com> User-Agent: Mutt/1.5.20 (2009-08-17) X-ELTE-SpamScore: -1.0 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-1.0 required=5.9 tests=BAYES_20 autolearn=no SpamAssassin version=3.2.5 -1.0 BAYES_20 BODY: Bayesian spam probability is 5 to 20% [score: 0.0594] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Lin Ming wrote: > p4_event_bind::cntr is "unsigned char". > But p4_next_cntr has return type of "int". > So the explicit conversion is needed to get the correct result. > @@ -780,7 +780,7 @@ static int p4_pmu_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign > if (unlikely(escr_idx == -1)) > goto done; > > - if (hwc->idx != -1 && !p4_should_swap_ts(hwc->config, cpu)) { > + if (hwc->idx != (unsigned char)-1 && !p4_should_swap_ts(hwc->config, cpu)) { That cast is _extremely_ ugly. Please fix the signedness of the types instead. Ingo