Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 338848
b: refs/heads/master
c: 04aa530
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Gleixner committed Nov 12, 2012
1 parent 1d246aa commit 7e05263
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 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: f3de44edf376d18773febca6a37800c042bada7d
refs/heads/master: 04aa530ec04f61875b99c12721162e2964e3318c
23 changes: 21 additions & 2 deletions trunk/kernel/irq/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,7 @@ static void
irq_thread_check_affinity(struct irq_desc *desc, struct irqaction *action)
{
cpumask_var_t mask;
bool valid = true;

if (!test_and_clear_bit(IRQTF_AFFINITY, &action->thread_flags))
return;
Expand All @@ -746,10 +747,18 @@ irq_thread_check_affinity(struct irq_desc *desc, struct irqaction *action)
}

raw_spin_lock_irq(&desc->lock);
cpumask_copy(mask, desc->irq_data.affinity);
/*
* This code is triggered unconditionally. Check the affinity
* mask pointer. For CPU_MASK_OFFSTACK=n this is optimized out.
*/
if (desc->irq_data.affinity)
cpumask_copy(mask, desc->irq_data.affinity);
else
valid = false;
raw_spin_unlock_irq(&desc->lock);

set_cpus_allowed_ptr(current, mask);
if (valid)
set_cpus_allowed_ptr(current, mask);
free_cpumask_var(mask);
}
#else
Expand Down Expand Up @@ -954,6 +963,16 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
*/
get_task_struct(t);
new->thread = t;
/*
* Tell the thread to set its affinity. This is
* important for shared interrupt handlers as we do
* not invoke setup_affinity() for the secondary
* handlers as everything is already set up. Even for
* interrupts marked with IRQF_NO_BALANCE this is
* correct as we want the thread to move to the cpu(s)
* on which the requesting code placed the interrupt.
*/
set_bit(IRQTF_AFFINITY, &new->thread_flags);
}

if (!alloc_cpumask_var(&mask, GFP_KERNEL)) {
Expand Down

0 comments on commit 7e05263

Please sign in to comment.