aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel/perfmon.c
diff options
context:
space:
mode:
authorstephane.eranian@hp.com <stephane.eranian@hp.com>2005-07-28 08:18:00 -0400
committerTony Luck <tony.luck@intel.com>2005-08-10 19:21:58 -0400
commit6bf11e8c708f0e512ed733fc65a50770c5bc7b54 (patch)
treeefa54f2f19580f330ae71c3a9476d2261b172142 /arch/ia64/kernel/perfmon.c
parentbc68552faad0e134eb22281343d5ae5a4873fa80 (diff)
[IA64] fix perfmon context load
The PFM_LOAD_CONTEXT may fail silently and cause a session to remain reserved even though it should not. This can happen when the commands succeeds in reserving the session but fails when it actually tries to attach to the load_pid. In that case, the command has failed but will return 0. More importantly, the session will remain reserved. This patch fixes the problem. Signed-off-by: <stephane.eranian@hp.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/kernel/perfmon.c')
-rw-r--r--arch/ia64/kernel/perfmon.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index b8ebb8e427ef..f1201ac8a116 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -4312,6 +4312,7 @@ pfm_context_load(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
4312 DPRINT(("before cmpxchg() old_ctx=%p new_ctx=%p\n", 4312 DPRINT(("before cmpxchg() old_ctx=%p new_ctx=%p\n",
4313 thread->pfm_context, ctx)); 4313 thread->pfm_context, ctx));
4314 4314
4315 ret = -EBUSY;
4315 old = ia64_cmpxchg(acq, &thread->pfm_context, NULL, ctx, sizeof(pfm_context_t *)); 4316 old = ia64_cmpxchg(acq, &thread->pfm_context, NULL, ctx, sizeof(pfm_context_t *));
4316 if (old != NULL) { 4317 if (old != NULL) {
4317 DPRINT(("load_pid [%d] already has a context\n", req->load_pid)); 4318 DPRINT(("load_pid [%d] already has a context\n", req->load_pid));