Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 87486
b: refs/heads/master
c: 264e3e8
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Mar 19, 2008
1 parent a19009f commit c2a571f
Show file tree
Hide file tree
Showing 10 changed files with 171 additions and 101 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: 8d8002f642886ae256a3c5d70fe8aff4faf3631a
refs/heads/master: 264e3e889d86e552b4191d69bb60f4f3b383135a
11 changes: 0 additions & 11 deletions trunk/drivers/acpi/ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ static struct acpi_ec {
struct mutex lock;
wait_queue_head_t wait;
struct list_head list;
atomic_t irq_count;
u8 handlers_installed;
} *boot_ec, *first_ec;

Expand Down Expand Up @@ -182,8 +181,6 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, int force_poll)
{
int ret = 0;

atomic_set(&ec->irq_count, 0);

if (unlikely(event == ACPI_EC_EVENT_OBF_1 &&
test_bit(EC_FLAGS_NO_OBF1_GPE, &ec->flags)))
force_poll = 1;
Expand Down Expand Up @@ -230,7 +227,6 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, int force_poll)
while (time_before(jiffies, delay)) {
if (acpi_ec_check_status(ec, event))
goto end;
msleep(5);
}
}
pr_err(PREFIX "acpi_ec_wait timeout,"
Expand Down Expand Up @@ -533,13 +529,6 @@ static u32 acpi_ec_gpe_handler(void *data)
struct acpi_ec *ec = data;

pr_debug(PREFIX "~~~> interrupt\n");
atomic_inc(&ec->irq_count);
if (atomic_read(&ec->irq_count) > 5) {
pr_err(PREFIX "GPE storm detected, disabling EC GPE\n");
acpi_disable_gpe(NULL, ec->gpe, ACPI_ISR);
clear_bit(EC_FLAGS_GPE_MODE, &ec->flags);
return ACPI_INTERRUPT_HANDLED;
}
clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
if (test_bit(EC_FLAGS_GPE_MODE, &ec->flags))
wake_up(&ec->wait);
Expand Down
36 changes: 27 additions & 9 deletions trunk/drivers/ide/ide-taskfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,25 @@ void task_end_request(ide_drive_t *drive, struct request *rq, u8 stat)
ide_end_request(drive, 1, rq->nr_sectors);
}

/*
* We got an interrupt on a task_in case, but no errors and no DRQ.
*
* It might be a spurious irq (shared irq), but it might be a
* command that had no output.
*/
static ide_startstop_t task_in_unexpected(ide_drive_t *drive, struct request *rq, u8 stat)
{
/* Command all done? */
if (OK_STAT(stat, READY_STAT, BUSY_STAT)) {
task_end_request(drive, rq, stat);
return ide_stopped;
}

/* Assume it was a spurious irq */
ide_set_handler(drive, &task_in_intr, WAIT_WORSTCASE, NULL);
return ide_started;
}

/*
* Handler for command with PIO data-in phase (Read/Read Multiple).
*/
Expand All @@ -431,18 +450,17 @@ static ide_startstop_t task_in_intr(ide_drive_t *drive)
struct request *rq = HWGROUP(drive)->rq;
u8 stat = ide_read_status(drive);

/* new way for dealing with premature shared PCI interrupts */
if (!OK_STAT(stat, DRQ_STAT, BAD_R_STAT)) {
if (stat & (ERR_STAT | DRQ_STAT))
return task_error(drive, rq, __FUNCTION__, stat);
/* No data yet, so wait for another IRQ. */
ide_set_handler(drive, &task_in_intr, WAIT_WORSTCASE, NULL);
return ide_started;
}
/* Error? */
if (stat & ERR_STAT)
return task_error(drive, rq, __FUNCTION__, stat);

/* Didn't want any data? Odd. */
if (!(stat & DRQ_STAT))
return task_in_unexpected(drive, rq, stat);

ide_pio_datablock(drive, rq, 0);

/* If it was the last datablock check status and finish transfer. */
/* Are we done? Check status and finish transfer. */
if (!hwif->nleft) {
stat = wait_drive_not_busy(drive);
if (!OK_STAT(stat, 0, BAD_STAT))
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,9 @@ struct sched_entity {
u64 vruntime;
u64 prev_sum_exec_runtime;

u64 last_wakeup;
u64 avg_overlap;

#ifdef CONFIG_SCHEDSTATS
u64 wait_start;
u64 wait_max;
Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@
| SD_BALANCE_FORK \
| SD_BALANCE_EXEC \
| SD_WAKE_AFFINE \
| SD_WAKE_IDLE \
| SD_SHARE_PKG_RESOURCES\
| BALANCE_FOR_MC_POWER, \
.last_balance = jiffies, \
Expand Down
11 changes: 10 additions & 1 deletion trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1396,6 +1396,12 @@ task_hot(struct task_struct *p, u64 now, struct sched_domain *sd)
{
s64 delta;

/*
* Buddy candidates are cache hot:
*/
if (&p->se == cfs_rq_of(&p->se)->next)
return 1;

if (p->sched_class != &fair_sched_class)
return 0;

Expand Down Expand Up @@ -1855,10 +1861,11 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, int sync)
schedstat_inc(p, se.nr_wakeups_remote);
update_rq_clock(rq);
activate_task(rq, p, 1);
check_preempt_curr(rq, p);
success = 1;

out_running:
check_preempt_curr(rq, p);

p->state = TASK_RUNNING;
#ifdef CONFIG_SMP
if (p->sched_class->task_wake_up)
Expand Down Expand Up @@ -1892,6 +1899,8 @@ static void __sched_fork(struct task_struct *p)
p->se.exec_start = 0;
p->se.sum_exec_runtime = 0;
p->se.prev_sum_exec_runtime = 0;
p->se.last_wakeup = 0;
p->se.avg_overlap = 0;

#ifdef CONFIG_SCHEDSTATS
p->se.wait_start = 0;
Expand Down
1 change: 1 addition & 0 deletions trunk/kernel/sched_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m)
PN(se.exec_start);
PN(se.vruntime);
PN(se.sum_exec_runtime);
PN(se.avg_overlap);

nr_switches = p->nvcsw + p->nivcsw;

Expand Down
Loading

0 comments on commit c2a571f

Please sign in to comment.