Skip to content

Commit

Permalink
Merge branch 'for-3.3-fixes' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/tj/percpu

Pull per-cpu patches from Tejun Heo:
 "This pull request contains four patches.  One replaces manual clearing
  with bitmap_clear(), two fix generic definition of __this_cpu ops so
  that they don't choose unnecessarily strict arch version.  One makes
  _this_cpu definition use raw_local_irq_*() so that it doesn't end up
  wrecking irq on/off state tracking when used from inside lockdep.

  Of the four patches, the raw_local_irq_*() update is the most
  important, so please feel free to cherry pick only that one patch and
  ignore the rest if you want to - commit e920d59 'percpu: use
  raw_local_irq_* in _this_cpu op'."

* 'for-3.3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu:
  percpu: fix __this_cpu_{sub,inc,dec}_return() definition
  percpu: use raw_local_irq_* in _this_cpu op
  percpu: fix generic definition of __this_cpu_add_and_return()
  percpu: use bitmap_clear
  • Loading branch information
torvalds committed Mar 5, 2012
2 parents 3a81a6e + adb7950 commit 789ce9b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
29 changes: 15 additions & 14 deletions include/linux/percpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,9 @@ do { \
#define _this_cpu_generic_to_op(pcp, val, op) \
do { \
unsigned long flags; \
local_irq_save(flags); \
raw_local_irq_save(flags); \
*__this_cpu_ptr(&(pcp)) op val; \
local_irq_restore(flags); \
raw_local_irq_restore(flags); \
} while (0)

#ifndef this_cpu_write
Expand Down Expand Up @@ -449,10 +449,10 @@ do { \
({ \
typeof(pcp) ret__; \
unsigned long flags; \
local_irq_save(flags); \
raw_local_irq_save(flags); \
__this_cpu_add(pcp, val); \
ret__ = __this_cpu_read(pcp); \
local_irq_restore(flags); \
raw_local_irq_restore(flags); \
ret__; \
})

Expand All @@ -479,10 +479,10 @@ do { \
#define _this_cpu_generic_xchg(pcp, nval) \
({ typeof(pcp) ret__; \
unsigned long flags; \
local_irq_save(flags); \
raw_local_irq_save(flags); \
ret__ = __this_cpu_read(pcp); \
__this_cpu_write(pcp, nval); \
local_irq_restore(flags); \
raw_local_irq_restore(flags); \
ret__; \
})

Expand All @@ -507,11 +507,11 @@ do { \
({ \
typeof(pcp) ret__; \
unsigned long flags; \
local_irq_save(flags); \
raw_local_irq_save(flags); \
ret__ = __this_cpu_read(pcp); \
if (ret__ == (oval)) \
__this_cpu_write(pcp, nval); \
local_irq_restore(flags); \
raw_local_irq_restore(flags); \
ret__; \
})

Expand Down Expand Up @@ -544,10 +544,10 @@ do { \
({ \
int ret__; \
unsigned long flags; \
local_irq_save(flags); \
raw_local_irq_save(flags); \
ret__ = __this_cpu_generic_cmpxchg_double(pcp1, pcp2, \
oval1, oval2, nval1, nval2); \
local_irq_restore(flags); \
raw_local_irq_restore(flags); \
ret__; \
})

Expand Down Expand Up @@ -718,12 +718,13 @@ do { \
# ifndef __this_cpu_add_return_8
# define __this_cpu_add_return_8(pcp, val) __this_cpu_generic_add_return(pcp, val)
# endif
# define __this_cpu_add_return(pcp, val) __pcpu_size_call_return2(this_cpu_add_return_, pcp, val)
# define __this_cpu_add_return(pcp, val) \
__pcpu_size_call_return2(__this_cpu_add_return_, pcp, val)
#endif

#define __this_cpu_sub_return(pcp, val) this_cpu_add_return(pcp, -(val))
#define __this_cpu_inc_return(pcp) this_cpu_add_return(pcp, 1)
#define __this_cpu_dec_return(pcp) this_cpu_add_return(pcp, -1)
#define __this_cpu_sub_return(pcp, val) __this_cpu_add_return(pcp, -(val))
#define __this_cpu_inc_return(pcp) __this_cpu_add_return(pcp, 1)
#define __this_cpu_dec_return(pcp) __this_cpu_add_return(pcp, -1)

#define __this_cpu_generic_xchg(pcp, nval) \
({ typeof(pcp) ret__; \
Expand Down
3 changes: 1 addition & 2 deletions mm/percpu-vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@ static void pcpu_unmap_pages(struct pcpu_chunk *chunk,
page_end - page_start);
}

for (i = page_start; i < page_end; i++)
__clear_bit(i, populated);
bitmap_clear(populated, page_start, page_end - page_start);
}

/**
Expand Down

0 comments on commit 789ce9b

Please sign in to comment.