Commit f5c10189 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull percpu updates from Tejun Heo:
 "Contains Alex Shi's three patches to remove percpu_xxx() which overlap
  with this_cpu_xxx().  There shouldn't be any functional change."

* 'for-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu:
  percpu: remove percpu_xxx() functions
  x86: replace percpu_xxx funcs with this_cpu_xxx
  net: replace percpu_xxx funcs with this_cpu_xxx or __this_cpu_xxx
parents c54894cd 641b695c
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -229,7 +229,7 @@ static inline void __user *arch_compat_alloc_user_space(long len)
		sp = task_pt_regs(current)->sp;
		sp = task_pt_regs(current)->sp;
	} else {
	} else {
		/* -128 for the x32 ABI redzone */
		/* -128 for the x32 ABI redzone */
		sp = percpu_read(old_rsp) - 128;
		sp = this_cpu_read(old_rsp) - 128;
	}
	}


	return (void __user *)round_down(sp - len, 16);
	return (void __user *)round_down(sp - len, 16);
+1 −1
Original line number Original line Diff line number Diff line
@@ -11,7 +11,7 @@ DECLARE_PER_CPU(struct task_struct *, current_task);


static __always_inline struct task_struct *get_current(void)
static __always_inline struct task_struct *get_current(void)
{
{
	return percpu_read_stable(current_task);
	return this_cpu_read_stable(current_task);
}
}


#define current get_current()
#define current get_current()
+1 −0
Original line number Original line Diff line number Diff line
@@ -6,6 +6,7 @@
#include <asm/mmu.h>
#include <asm/mmu.h>


#include <linux/smp.h>
#include <linux/smp.h>
#include <linux/percpu.h>


static inline void fill_ldt(struct desc_struct *desc, const struct user_desc *info)
static inline void fill_ldt(struct desc_struct *desc, const struct user_desc *info)
{
{
+3 −3
Original line number Original line Diff line number Diff line
@@ -290,14 +290,14 @@ static inline int __thread_has_fpu(struct task_struct *tsk)
static inline void __thread_clear_has_fpu(struct task_struct *tsk)
static inline void __thread_clear_has_fpu(struct task_struct *tsk)
{
{
	tsk->thread.fpu.has_fpu = 0;
	tsk->thread.fpu.has_fpu = 0;
	percpu_write(fpu_owner_task, NULL);
	this_cpu_write(fpu_owner_task, NULL);
}
}


/* Must be paired with a 'clts' before! */
/* Must be paired with a 'clts' before! */
static inline void __thread_set_has_fpu(struct task_struct *tsk)
static inline void __thread_set_has_fpu(struct task_struct *tsk)
{
{
	tsk->thread.fpu.has_fpu = 1;
	tsk->thread.fpu.has_fpu = 1;
	percpu_write(fpu_owner_task, tsk);
	this_cpu_write(fpu_owner_task, tsk);
}
}


/*
/*
@@ -344,7 +344,7 @@ typedef struct { int preload; } fpu_switch_t;
 */
 */
static inline int fpu_lazy_restore(struct task_struct *new, unsigned int cpu)
static inline int fpu_lazy_restore(struct task_struct *new, unsigned int cpu)
{
{
	return new == percpu_read_stable(fpu_owner_task) &&
	return new == this_cpu_read_stable(fpu_owner_task) &&
		cpu == new->thread.fpu.last_cpu;
		cpu == new->thread.fpu.last_cpu;
}
}


+5 −4
Original line number Original line Diff line number Diff line
@@ -35,14 +35,15 @@ DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);


#define __ARCH_IRQ_STAT
#define __ARCH_IRQ_STAT


#define inc_irq_stat(member)	percpu_inc(irq_stat.member)
#define inc_irq_stat(member)	this_cpu_inc(irq_stat.member)


#define local_softirq_pending()	percpu_read(irq_stat.__softirq_pending)
#define local_softirq_pending()	this_cpu_read(irq_stat.__softirq_pending)


#define __ARCH_SET_SOFTIRQ_PENDING
#define __ARCH_SET_SOFTIRQ_PENDING


#define set_softirq_pending(x)	percpu_write(irq_stat.__softirq_pending, (x))
#define set_softirq_pending(x)	\
#define or_softirq_pending(x)	percpu_or(irq_stat.__softirq_pending, (x))
		this_cpu_write(irq_stat.__softirq_pending, (x))
#define or_softirq_pending(x)	this_cpu_or(irq_stat.__softirq_pending, (x))


extern void ack_bad_irq(unsigned int irq);
extern void ack_bad_irq(unsigned int irq);


Loading