Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158731
b: refs/heads/master
c: 4d576b5
h: refs/heads/master
i:
  158729: 7338c73
  158727: 3ba6e55
v: v3
  • Loading branch information
Jeremy Fitzhardinge committed Sep 9, 2009
1 parent be87516 commit 4b580a5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 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: 577eebeae34d340685d8985dfdb7dfe337c511e8
refs/heads/master: 4d576b57b50a92801e6493e76e5243d6cff193d2
19 changes: 11 additions & 8 deletions trunk/arch/x86/xen/spinlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ static noinline int xen_spin_lock_slow(struct raw_spinlock *lock, bool irq_enabl
struct xen_spinlock *prev;
int irq = __get_cpu_var(lock_kicker_irq);
int ret;
unsigned long flags;
u64 start;

/* If kicker interrupts not initialized yet, just spin */
Expand All @@ -199,16 +198,12 @@ static noinline int xen_spin_lock_slow(struct raw_spinlock *lock, bool irq_enabl
/* announce we're spinning */
prev = spinning_lock(xl);

flags = __raw_local_save_flags();
if (irq_enable) {
ADD_STATS(taken_slow_irqenable, 1);
raw_local_irq_enable();
}

ADD_STATS(taken_slow, 1);
ADD_STATS(taken_slow_nested, prev != NULL);

do {
unsigned long flags;

/* clear pending */
xen_clear_irq_pending(irq);

Expand All @@ -228,6 +223,12 @@ static noinline int xen_spin_lock_slow(struct raw_spinlock *lock, bool irq_enabl
goto out;
}

flags = __raw_local_save_flags();
if (irq_enable) {
ADD_STATS(taken_slow_irqenable, 1);
raw_local_irq_enable();
}

/*
* Block until irq becomes pending. If we're
* interrupted at this point (after the trylock but
Expand All @@ -238,13 +239,15 @@ static noinline int xen_spin_lock_slow(struct raw_spinlock *lock, bool irq_enabl
* pending.
*/
xen_poll_irq(irq);

raw_local_irq_restore(flags);

ADD_STATS(taken_slow_spurious, !xen_test_irq_pending(irq));
} while (!xen_test_irq_pending(irq)); /* check for spurious wakeups */

kstat_incr_irqs_this_cpu(irq, irq_to_desc(irq));

out:
raw_local_irq_restore(flags);
unspinning_lock(xl, prev);
spin_time_accum_blocked(start);

Expand Down

0 comments on commit 4b580a5

Please sign in to comment.