Skip to content

Commit

Permalink
[S390] vtime: cleanup per_cpu usage.
Browse files Browse the repository at this point in the history
Replace per_cpu(... , smp_processor_id()) with __get_cpu_var()

Signed-off-by: Jan Glauber <jan.glauber@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Jan Glauber authored and Martin Schwidefsky committed Apr 27, 2007
1 parent 131a395 commit db77aa5
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions arch/s390/kernel/vtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static inline void set_vtimer(__u64 expires)
S390_lowcore.last_update_timer = expires;

/* store expire time for this CPU timer */
per_cpu(virt_cpu_timer, smp_processor_id()).to_expire = expires;
__get_cpu_var(virt_cpu_timer).to_expire = expires;
}
#else
static inline void set_vtimer(__u64 expires)
Expand All @@ -137,15 +137,15 @@ static inline void set_vtimer(__u64 expires)
asm volatile ("SPT %0" : : "m" (S390_lowcore.last_update_timer));

/* store expire time for this CPU timer */
per_cpu(virt_cpu_timer, smp_processor_id()).to_expire = expires;
__get_cpu_var(virt_cpu_timer).to_expire = expires;
}
#endif

static void start_cpu_timer(void)
{
struct vtimer_queue *vt_list;

vt_list = &per_cpu(virt_cpu_timer, smp_processor_id());
vt_list = &__get_cpu_var(virt_cpu_timer);

/* CPU timer interrupt is pending, don't reprogramm it */
if (vt_list->idle & 1LL<<63)
Expand All @@ -159,7 +159,7 @@ static void stop_cpu_timer(void)
{
struct vtimer_queue *vt_list;

vt_list = &per_cpu(virt_cpu_timer, smp_processor_id());
vt_list = &__get_cpu_var(virt_cpu_timer);

/* nothing to do */
if (list_empty(&vt_list->list)) {
Expand Down Expand Up @@ -219,7 +219,7 @@ static void do_callbacks(struct list_head *cb_list)
if (list_empty(cb_list))
return;

vt_list = &per_cpu(virt_cpu_timer, smp_processor_id());
vt_list = &__get_cpu_var(virt_cpu_timer);

list_for_each_entry_safe(event, tmp, cb_list, entry) {
fn = event->function;
Expand All @@ -244,7 +244,6 @@ static void do_callbacks(struct list_head *cb_list)
*/
static void do_cpu_timer_interrupt(__u16 error_code)
{
int cpu;
__u64 next, delta;
struct vtimer_queue *vt_list;
struct vtimer_list *event, *tmp;
Expand All @@ -253,8 +252,7 @@ static void do_cpu_timer_interrupt(__u16 error_code)
struct list_head cb_list;

INIT_LIST_HEAD(&cb_list);
cpu = smp_processor_id();
vt_list = &per_cpu(virt_cpu_timer, cpu);
vt_list = &__get_cpu_var(virt_cpu_timer);

/* walk timer list, fire all expired events */
spin_lock(&vt_list->lock);
Expand Down Expand Up @@ -534,7 +532,7 @@ void init_cpu_vtimer(void)
/* enable cpu timer interrupts */
__ctl_set_bit(0,10);

vt_list = &per_cpu(virt_cpu_timer, smp_processor_id());
vt_list = &__get_cpu_var(virt_cpu_timer);
INIT_LIST_HEAD(&vt_list->list);
spin_lock_init(&vt_list->lock);
vt_list->to_expire = 0;
Expand Down

0 comments on commit db77aa5

Please sign in to comment.