Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40927
b: refs/heads/master
c: 9446868
h: refs/heads/master
i:
  40925: 6d183d6
  40923: 7669173
  40919: 9e7e1f6
  40911: d1f5127
  40895: 8a2e5c6
v: v3
  • Loading branch information
Andi Kleen authored and Andi Kleen committed Nov 14, 2006
1 parent c43eac9 commit 9b6ec94
Show file tree
Hide file tree
Showing 3 changed files with 11 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: 8c131af1db510793f87dc43edbc8950a35370df3
refs/heads/master: 9446868b5383eb87f76b2d4389dea4bb968a6657
3 changes: 1 addition & 2 deletions trunk/arch/x86_64/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,8 @@ void enter_idle(void)

static void __exit_idle(void)
{
if (read_pda(isidle) == 0)
if (test_and_clear_bit_pda(0, isidle) == 0)
return;
write_pda(isidle, 0);
atomic_notifier_call_chain(&idle_notifier, IDLE_END, NULL);
}

Expand Down
9 changes: 9 additions & 0 deletions trunk/include/asm-x86_64/pda.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@ extern struct x8664_pda _proxy_pda;
#define sub_pda(field,val) pda_to_op("sub",field,val)
#define or_pda(field,val) pda_to_op("or",field,val)

/* This is not atomic against other CPUs -- CPU preemption needs to be off */
#define test_and_clear_bit_pda(bit,field) ({ \
int old__; \
asm volatile("btr %2,%%gs:%c3\n\tsbbl %0,%0" \
: "=r" (old__), "+m" (_proxy_pda.field) \
: "dIr" (bit), "i" (pda_offset(field)) : "memory"); \
old__; \
})

#endif

#define PDA_STACKOFFSET (5*8)
Expand Down

0 comments on commit 9b6ec94

Please sign in to comment.