From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753037AbbLQSnJ (ORCPT ); Thu, 17 Dec 2015 13:43:09 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:44411 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751224AbbLQSnH (ORCPT ); Thu, 17 Dec 2015 13:43:07 -0500 Date: Thu, 17 Dec 2015 19:42:55 +0100 From: Peter Zijlstra To: "Suzuki K. Poulose" Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com, punit.agrawal@arm.com, arm@kernel.org Subject: Re: [PATCH v4 05/12] arm-cci: PMU: Add support for transactions Message-ID: <20151217184255.GI6344@twins.programming.kicks-ass.net> References: <1450374559-23315-1-git-send-email-suzuki.poulose@arm.com> <1450374559-23315-6-git-send-email-suzuki.poulose@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1450374559-23315-6-git-send-email-suzuki.poulose@arm.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 17, 2015 at 05:49:12PM +0000, Suzuki K. Poulose wrote: > This patch adds the transaction hooks for CCI PMU, which can be > later exploited to amortise the cost of writing the counters for > CCI-500 PMU. > > We keep track of only the 'ADD' transactions. While we are in a > transaction, we keep track of the indices allocated for the events > and delay the following operations until the transaction is committed. > 1) Programming the event on the counter > 2) Enabling the counter > 3) Setting the period for the event. So that's not really what the txn interface is for, its meant to amortize event scheduling. The above doesn't look like it has a failure case, in which case you can achieve the same simpler, using pmu::pmu_{dis,en}able(). From mboxrd@z Thu Jan 1 00:00:00 1970 From: peterz@infradead.org (Peter Zijlstra) Date: Thu, 17 Dec 2015 19:42:55 +0100 Subject: [PATCH v4 05/12] arm-cci: PMU: Add support for transactions In-Reply-To: <1450374559-23315-6-git-send-email-suzuki.poulose@arm.com> References: <1450374559-23315-1-git-send-email-suzuki.poulose@arm.com> <1450374559-23315-6-git-send-email-suzuki.poulose@arm.com> Message-ID: <20151217184255.GI6344@twins.programming.kicks-ass.net> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, Dec 17, 2015 at 05:49:12PM +0000, Suzuki K. Poulose wrote: > This patch adds the transaction hooks for CCI PMU, which can be > later exploited to amortise the cost of writing the counters for > CCI-500 PMU. > > We keep track of only the 'ADD' transactions. While we are in a > transaction, we keep track of the indices allocated for the events > and delay the following operations until the transaction is committed. > 1) Programming the event on the counter > 2) Enabling the counter > 3) Setting the period for the event. So that's not really what the txn interface is for, its meant to amortize event scheduling. The above doesn't look like it has a failure case, in which case you can achieve the same simpler, using pmu::pmu_{dis,en}able().