aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJes Sorensen <jes@sgi.com>2006-01-19 02:46:52 -0500
committerTony Luck <tony.luck@intel.com>2006-01-19 14:17:56 -0500
commit60f1c4443c4d391d8dfbe709f13296067b6c8021 (patch)
treed8c65c092fa1af315c994d9f6001c89999e22e20 /arch
parent92ff2ecd0deddc4c5fb2140d5861d0ddd50e9e57 (diff)
[IA64] sem2mutex: arch/ia64/kernel/perfmon.c
Migrate perfmon from using an old semaphore to a completion handler. Signed-off-by: Jes Sorensen <jes@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/ia64/kernel/perfmon.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 2ea4b39efffa..9c5194b385da 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -40,6 +40,7 @@
40#include <linux/bitops.h> 40#include <linux/bitops.h>
41#include <linux/capability.h> 41#include <linux/capability.h>
42#include <linux/rcupdate.h> 42#include <linux/rcupdate.h>
43#include <linux/completion.h>
43 44
44#include <asm/errno.h> 45#include <asm/errno.h>
45#include <asm/intrinsics.h> 46#include <asm/intrinsics.h>
@@ -286,7 +287,7 @@ typedef struct pfm_context {
286 287
287 unsigned long ctx_ovfl_regs[4]; /* which registers overflowed (notification) */ 288 unsigned long ctx_ovfl_regs[4]; /* which registers overflowed (notification) */
288 289
289 struct semaphore ctx_restart_sem; /* use for blocking notification mode */ 290 struct completion ctx_restart_done; /* use for blocking notification mode */
290 291
291 unsigned long ctx_used_pmds[4]; /* bitmask of PMD used */ 292 unsigned long ctx_used_pmds[4]; /* bitmask of PMD used */
292 unsigned long ctx_all_pmds[4]; /* bitmask of all accessible PMDs */ 293 unsigned long ctx_all_pmds[4]; /* bitmask of all accessible PMDs */
@@ -1991,7 +1992,7 @@ pfm_close(struct inode *inode, struct file *filp)
1991 /* 1992 /*
1992 * force task to wake up from MASKED state 1993 * force task to wake up from MASKED state
1993 */ 1994 */
1994 up(&ctx->ctx_restart_sem); 1995 complete(&ctx->ctx_restart_done);
1995 1996
1996 DPRINT(("waking up ctx_state=%d\n", state)); 1997 DPRINT(("waking up ctx_state=%d\n", state));
1997 1998
@@ -2706,7 +2707,7 @@ pfm_context_create(pfm_context_t *ctx, void *arg, int count, struct pt_regs *reg
2706 /* 2707 /*
2707 * init restart semaphore to locked 2708 * init restart semaphore to locked
2708 */ 2709 */
2709 sema_init(&ctx->ctx_restart_sem, 0); 2710 init_completion(&ctx->ctx_restart_done);
2710 2711
2711 /* 2712 /*
2712 * activation is used in SMP only 2713 * activation is used in SMP only
@@ -3687,7 +3688,7 @@ pfm_restart(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
3687 */ 3688 */
3688 if (CTX_OVFL_NOBLOCK(ctx) == 0 && state == PFM_CTX_MASKED) { 3689 if (CTX_OVFL_NOBLOCK(ctx) == 0 && state == PFM_CTX_MASKED) {
3689 DPRINT(("unblocking [%d] \n", task->pid)); 3690 DPRINT(("unblocking [%d] \n", task->pid));
3690 up(&ctx->ctx_restart_sem); 3691 complete(&ctx->ctx_restart_done);
3691 } else { 3692 } else {
3692 DPRINT(("[%d] armed exit trap\n", task->pid)); 3693 DPRINT(("[%d] armed exit trap\n", task->pid));
3693 3694
@@ -5089,7 +5090,7 @@ pfm_handle_work(void)
5089 * may go through without blocking on SMP systems 5090 * may go through without blocking on SMP systems
5090 * if restart has been received already by the time we call down() 5091 * if restart has been received already by the time we call down()
5091 */ 5092 */
5092 ret = down_interruptible(&ctx->ctx_restart_sem); 5093 ret = wait_for_completion_interruptible(&ctx->ctx_restart_done);
5093 5094
5094 DPRINT(("after block sleeping ret=%d\n", ret)); 5095 DPRINT(("after block sleeping ret=%d\n", ret));
5095 5096