Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755429Ab0DUOig (ORCPT ); Wed, 21 Apr 2010 10:38:36 -0400 Received: from mga01.intel.com ([192.55.52.88]:41548 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755393Ab0DUOif (ORCPT ); Wed, 21 Apr 2010 10:38:35 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.52,250,1270450800"; d="scan'208";a="791473369" Subject: Re: [RFC] perf_events: support for uncore a.k.a. nest units From: Lin Ming To: Peter Zijlstra Cc: "eranian@gmail.com" , "Gary.Mohr@Bull.com" , Corey Ashford , LKML In-Reply-To: <1271859755.1776.108.camel@laptop> References: <1271424250.4807.2277.camel@twins> <1271764547.13968.69.camel@minggr.sh.intel.com> <1271764993.1676.431.camel@laptop> <1271837295.3794.3.camel@minggr.sh.intel.com> <1271839190.3794.5.camel@minggr.sh.intel.com> <1271842974.3794.16.camel@minggr.sh.intel.com> <1271843869.1776.65.camel@laptop> <1271887942.3054.33.camel@localhost> <1271859755.1776.108.camel@laptop> Content-Type: text/plain; charset="UTF-8" Date: Wed, 21 Apr 2010 22:38:22 +0000 Message-Id: <1271889502.7414.14.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.28.0 (2.28.0-2.fc12) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1241 Lines: 46 On Wed, 2010-04-21 at 22:22 +0800, Peter Zijlstra wrote: > On Wed, 2010-04-21 at 22:12 +0000, Lin Ming wrote: > > + ret = pmu->commit_txn(pmu); > > + if (!ret) { > > + pmu->stop_txn(pmu); > > + return 0; > > + } > > > > group_error: > > + pmu->stop_txn(pmu); > > If you let commit_txn() also clear the state you can save some logic and > a method. I add this ->stop_txn(pmu) because the rollback code also need to clear the state. > > But yes, this looks good. If you don't remove the weak interface just > yet, you can do a patch per architecture that uses this (at least > powerpc and sparc do), and remove the weak thing at the end once all > users are gone. > OK, I'll do that for powerpc and sparc. And need to check if there are transaction methods in group_sched_in for other arch, as below. group_sched_in(...) { if (pmu->start_txn) pmu->start_txn(pmu); if (pmu->commit_txn) pmu->commit_txn(pmu) } Thanks, Lin Ming -- 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/