public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>,
	Corey Ashford <cjashfor@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	John Kacur <jkacur@redhat.com>
Subject: [PATCH 7/7] perf_counter: remove perf_counter_context::nr_enabled
Date: Sat, 23 May 2009 18:29:01 +0200	[thread overview]
Message-ID: <20090523163013.032998331@chello.nl> (raw)
In-Reply-To: 20090523162854.599719825@chello.nl

[-- Attachment #1: perf_counter-ctrl-all-cleanup.patch --]
[-- Type: text/plain, Size: 2787 bytes --]

now that pctrl() no longer disables other people's counters, remove the
PMU cache code that deals with that.

LKML-Reference: <new-submission>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
 include/linux/perf_counter.h |    1 -
 kernel/perf_counter.c        |   11 +----------
 2 files changed, 1 insertion(+), 11 deletions(-)

Index: linux-2.6/include/linux/perf_counter.h
===================================================================
--- linux-2.6.orig/include/linux/perf_counter.h
+++ linux-2.6/include/linux/perf_counter.h
@@ -516,7 +516,6 @@ struct perf_counter_context {
 	struct list_head	event_list;
 	int			nr_counters;
 	int			nr_active;
-	int			nr_enabled;
 	int			is_active;
 	atomic_t		refcount;
 	struct task_struct	*task;
Index: linux-2.6/kernel/perf_counter.c
===================================================================
--- linux-2.6.orig/kernel/perf_counter.c
+++ linux-2.6/kernel/perf_counter.c
@@ -134,8 +134,6 @@ list_add_counter(struct perf_counter *co
 
 	list_add_rcu(&counter->event_entry, &ctx->event_list);
 	ctx->nr_counters++;
-	if (counter->state >= PERF_COUNTER_STATE_INACTIVE)
-		ctx->nr_enabled++;
 }
 
 /*
@@ -150,8 +148,6 @@ list_del_counter(struct perf_counter *co
 	if (list_empty(&counter->list_entry))
 		return;
 	ctx->nr_counters--;
-	if (counter->state >= PERF_COUNTER_STATE_INACTIVE)
-		ctx->nr_enabled--;
 
 	list_del_init(&counter->list_entry);
 	list_del_rcu(&counter->event_entry);
@@ -406,7 +402,6 @@ static void __perf_counter_disable(void 
 		else
 			counter_sched_out(counter, cpuctx, ctx);
 		counter->state = PERF_COUNTER_STATE_OFF;
-		ctx->nr_enabled--;
 	}
 
 	spin_unlock_irqrestore(&ctx->lock, flags);
@@ -448,7 +443,6 @@ static void perf_counter_disable(struct 
 	if (counter->state == PERF_COUNTER_STATE_INACTIVE) {
 		update_counter_times(counter);
 		counter->state = PERF_COUNTER_STATE_OFF;
-		ctx->nr_enabled--;
 	}
 
 	spin_unlock_irq(&ctx->lock);
@@ -759,7 +753,6 @@ static void __perf_counter_enable(void *
 		goto unlock;
 	counter->state = PERF_COUNTER_STATE_INACTIVE;
 	counter->tstamp_enabled = ctx->time - counter->total_time_enabled;
-	ctx->nr_enabled++;
 
 	/*
 	 * If the counter is in a group and isn't the group leader,
@@ -850,7 +843,6 @@ static void perf_counter_enable(struct p
 		counter->state = PERF_COUNTER_STATE_INACTIVE;
 		counter->tstamp_enabled =
 			ctx->time - counter->total_time_enabled;
-		ctx->nr_enabled++;
 	}
  out:
 	spin_unlock_irq(&ctx->lock);
@@ -910,8 +902,7 @@ static int context_equiv(struct perf_cou
 			 struct perf_counter_context *ctx2)
 {
 	return ctx1->parent_ctx && ctx1->parent_ctx == ctx2->parent_ctx
-		&& ctx1->parent_gen == ctx2->parent_gen
-		&& ctx1->nr_enabled == ctx2->nr_enabled;
+		&& ctx1->parent_gen == ctx2->parent_gen;
 }
 
 /*

-- 


  parent reply	other threads:[~2009-05-23 16:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-23 16:28 [PATCH 0/7] perf counter patches Peter Zijlstra
2009-05-23 16:28 ` [PATCH 1/7] perf_counter: fix dynamic irq_period logging Peter Zijlstra
2009-05-24  7:01   ` [tip:perfcounters/core] perf_counter: Fix " tip-bot for Peter Zijlstra
2009-05-25  0:08   ` [PATCH 1/7] perf_counter: fix " Paul Mackerras
2009-05-25  7:19     ` Peter Zijlstra
2009-05-23 16:28 ` [PATCH 2/7] perf_counter: sanitize counter->mutex Peter Zijlstra
2009-05-24  7:01   ` [tip:perfcounters/core] perf_counter: Sanitize counter->mutex tip-bot for Peter Zijlstra
2009-05-23 16:28 ` [PATCH 3/7] perf_counter: sanitize context locking Peter Zijlstra
2009-05-24  7:01   ` [tip:perfcounters/core] perf_counter: Sanitize " tip-bot for Peter Zijlstra
2009-05-23 16:28 ` [PATCH 4/7] perf_counter: fix userspace build Peter Zijlstra
2009-05-24  7:01   ` [tip:perfcounters/core] perf_counter: Fix " tip-bot for Peter Zijlstra
2009-05-23 16:28 ` [PATCH 5/7] perf_counter: simplify context cleanup Peter Zijlstra
2009-05-24  7:01   ` [tip:perfcounters/core] perf_counter: Simplify " tip-bot for Peter Zijlstra
2009-05-23 16:29 ` [PATCH 6/7] perf_counter: change pctrl() behaviour Peter Zijlstra
2009-05-23 19:04   ` Peter Zijlstra
2009-05-24  7:02   ` [tip:perfcounters/core] perf_counter: Change " tip-bot for Peter Zijlstra
2009-05-23 16:29 ` Peter Zijlstra [this message]
2009-05-24  7:02   ` [tip:perfcounters/core] perf_counter: Remove perf_counter_context::nr_enabled tip-bot for Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090523163013.032998331@chello.nl \
    --to=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=cjashfor@linux.vnet.ibm.com \
    --cc=jkacur@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox