public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephane Eranian <eranian@frankl.hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] important perfmon fix for 2.4.20
Date: Fri, 03 Jan 2003 19:53:12 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105590709805636@msgid-missing> (raw)

[-- Attachment #1: Type: text/plain, Size: 415 bytes --]

Hi,

I discovered a problem with perfmon in the latest 2.4.20 kernel from Bjorn.

System wide monitoring in SMP system was broken due to a bug introduced in
my previous patch. The task pinning was done incorrectly, leading to conflicts
detected by pfmon. Other tools running system wide are also affected.

Please apply the attached patch to your 2.4.20 tree to correct the problem.

Happy New Year!

-- 
-Stephane

[-- Attachment #2: perfmon-030103.diff --]
[-- Type: text/plain, Size: 1565 bytes --]

--- linux.2420-official/arch/ia64/kernel/perfmon.c	2003-01-03 10:09:11.000000000 -0800
+++ build.2420-new/arch/ia64/kernel/perfmon.c	2003-01-03 11:15:53.000000000 -0800
@@ -261,7 +261,7 @@
 
 	u64			ctx_saved_psr;		/* copy of psr used for lazy ctxsw */
 	unsigned long		ctx_saved_cpus_allowed;	/* copy of the task cpus_allowed (system wide) */
-	unsigned long		ctx_cpu;		/* cpu to which perfmon is applied (system wide) */
+	unsigned long		ctx_cpu_mask;		/* where owner can run, 1 bit set system wide) */
 
 	atomic_t		ctx_saving_in_progress;	/* flag indicating actual save in progress */
 	atomic_t		ctx_is_busy;		/* context accessed by overflow handler */
@@ -1089,7 +1089,7 @@
 {
 	pfarg_context_t tmp;
 	void *uaddr = NULL;
-	int ret, cpu = 0;
+	int ret;
 	int ctx_flags;
 	pid_t notify_pid;
 
@@ -1204,7 +1204,7 @@
 	ctx->ctx_fl_protected = 0;
 
 	/* for system wide mode only (only 1 bit set) */
-	ctx->ctx_cpu         = cpu;
+	ctx->ctx_cpu_mask = tmp.ctx_cpu_mask;
 
 	atomic_set(&ctx->ctx_last_cpu,-1); /* SMP only, means no CPU */
 
@@ -1237,7 +1237,7 @@
 	 */
 	if (ctx->ctx_fl_system) {
 		ctx->ctx_saved_cpus_allowed = task->cpus_allowed;
-		task->cpus_allowed = 1UL << cpu;
+		task->cpus_allowed = ctx->ctx_cpu_mask;
 		task->need_resched = 1;
 		DBprintk(("[%d] rescheduled allowed=0x%lx\n", task->pid,task->cpus_allowed));
 	}
@@ -4048,7 +4048,7 @@
 
 	UNLOCK_CTX(ctx);
 
-	pfm_unreserve_session(task, ctx->ctx_fl_system, 1UL << ctx->ctx_cpu);
+	pfm_unreserve_session(task, ctx->ctx_fl_system, ctx->ctx_cpu_mask);
 
 	if (ctx->ctx_fl_system) {
 		/*

                 reply	other threads:[~2003-01-03 19:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=marc-linux-ia64-105590709805636@msgid-missing \
    --to=eranian@frankl.hpl.hp.com \
    --cc=linux-ia64@vger.kernel.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