Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 921
b: refs/heads/master
c: 8df5a50
h: refs/heads/master
i:
  919: 6c7dfa0
v: v3
  • Loading branch information
Stephane Eranian authored and Tony Luck committed May 3, 2005
1 parent f206ca3 commit 3f56d40
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 012914dad25bd5cacf88af4429eecda62a06020d
refs/heads/master: 8df5a500a3e97f7811cdce0f553ca1917ccd4220
13 changes: 13 additions & 0 deletions trunk/arch/ia64/kernel/perfmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,8 @@ pfm_unregister_buffer_fmt(pfm_uuid_t uuid)
}
EXPORT_SYMBOL(pfm_unregister_buffer_fmt);

extern void update_pal_halt_status(int);

static int
pfm_reserve_session(struct task_struct *task, int is_syswide, unsigned int cpu)
{
Expand Down Expand Up @@ -1311,6 +1313,11 @@ pfm_reserve_session(struct task_struct *task, int is_syswide, unsigned int cpu)
is_syswide,
cpu));

/*
* disable default_idle() to go to PAL_HALT
*/
update_pal_halt_status(0);

UNLOCK_PFS(flags);

return 0;
Expand Down Expand Up @@ -1366,6 +1373,12 @@ pfm_unreserve_session(pfm_context_t *ctx, int is_syswide, unsigned int cpu)
is_syswide,
cpu));

/*
* if possible, enable default_idle() to go into PAL_HALT
*/
if (pfm_sessions.pfs_task_sessions == 0 && pfm_sessions.pfs_sys_sessions == 0)
update_pal_halt_status(1);

UNLOCK_PFS(flags);

return 0;
Expand Down
14 changes: 11 additions & 3 deletions trunk/arch/ia64/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,24 +173,32 @@ do_notify_resume_user (sigset_t *oldset, struct sigscratch *scr, long in_syscall
ia64_do_signal(oldset, scr, in_syscall);
}

static int pal_halt = 1;
static int pal_halt = 1;
static int can_do_pal_halt = 1;

static int __init nohalt_setup(char * str)
{
pal_halt = 0;
return 1;
}
__setup("nohalt", nohalt_setup);

int
update_pal_halt_status(int status)
{
can_do_pal_halt = pal_halt && status;
}

/*
* We use this if we don't have any better idle routine..
*/
void
default_idle (void)
{
unsigned long pmu_active = ia64_getreg(_IA64_REG_PSR) & (IA64_PSR_PP | IA64_PSR_UP);
int can_do_pal;

while (!need_resched())
if (pal_halt && !pmu_active)
if (can_do_pal_halt)
safe_halt();
else
cpu_relax();
Expand Down

0 comments on commit 3f56d40

Please sign in to comment.