Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-3.3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/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 e920d5971d '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

+16 -16
+15 -14
include/linux/percpu.h
··· 348 348 #define _this_cpu_generic_to_op(pcp, val, op) \ 349 349 do { \ 350 350 unsigned long flags; \ 351 - local_irq_save(flags); \ 351 + raw_local_irq_save(flags); \ 352 352 *__this_cpu_ptr(&(pcp)) op val; \ 353 - local_irq_restore(flags); \ 353 + raw_local_irq_restore(flags); \ 354 354 } while (0) 355 355 356 356 #ifndef this_cpu_write ··· 449 449 ({ \ 450 450 typeof(pcp) ret__; \ 451 451 unsigned long flags; \ 452 - local_irq_save(flags); \ 452 + raw_local_irq_save(flags); \ 453 453 __this_cpu_add(pcp, val); \ 454 454 ret__ = __this_cpu_read(pcp); \ 455 - local_irq_restore(flags); \ 455 + raw_local_irq_restore(flags); \ 456 456 ret__; \ 457 457 }) 458 458 ··· 479 479 #define _this_cpu_generic_xchg(pcp, nval) \ 480 480 ({ typeof(pcp) ret__; \ 481 481 unsigned long flags; \ 482 - local_irq_save(flags); \ 482 + raw_local_irq_save(flags); \ 483 483 ret__ = __this_cpu_read(pcp); \ 484 484 __this_cpu_write(pcp, nval); \ 485 - local_irq_restore(flags); \ 485 + raw_local_irq_restore(flags); \ 486 486 ret__; \ 487 487 }) 488 488 ··· 507 507 ({ \ 508 508 typeof(pcp) ret__; \ 509 509 unsigned long flags; \ 510 - local_irq_save(flags); \ 510 + raw_local_irq_save(flags); \ 511 511 ret__ = __this_cpu_read(pcp); \ 512 512 if (ret__ == (oval)) \ 513 513 __this_cpu_write(pcp, nval); \ 514 - local_irq_restore(flags); \ 514 + raw_local_irq_restore(flags); \ 515 515 ret__; \ 516 516 }) 517 517 ··· 544 544 ({ \ 545 545 int ret__; \ 546 546 unsigned long flags; \ 547 - local_irq_save(flags); \ 547 + raw_local_irq_save(flags); \ 548 548 ret__ = __this_cpu_generic_cmpxchg_double(pcp1, pcp2, \ 549 549 oval1, oval2, nval1, nval2); \ 550 - local_irq_restore(flags); \ 550 + raw_local_irq_restore(flags); \ 551 551 ret__; \ 552 552 }) 553 553 ··· 718 718 # ifndef __this_cpu_add_return_8 719 719 # define __this_cpu_add_return_8(pcp, val) __this_cpu_generic_add_return(pcp, val) 720 720 # endif 721 - # define __this_cpu_add_return(pcp, val) __pcpu_size_call_return2(this_cpu_add_return_, pcp, val) 721 + # define __this_cpu_add_return(pcp, val) \ 722 + __pcpu_size_call_return2(__this_cpu_add_return_, pcp, val) 722 723 #endif 723 724 724 - #define __this_cpu_sub_return(pcp, val) this_cpu_add_return(pcp, -(val)) 725 - #define __this_cpu_inc_return(pcp) this_cpu_add_return(pcp, 1) 726 - #define __this_cpu_dec_return(pcp) this_cpu_add_return(pcp, -1) 725 + #define __this_cpu_sub_return(pcp, val) __this_cpu_add_return(pcp, -(val)) 726 + #define __this_cpu_inc_return(pcp) __this_cpu_add_return(pcp, 1) 727 + #define __this_cpu_dec_return(pcp) __this_cpu_add_return(pcp, -1) 727 728 728 729 #define __this_cpu_generic_xchg(pcp, nval) \ 729 730 ({ typeof(pcp) ret__; \
+1 -2
mm/percpu-vm.c
··· 184 184 page_end - page_start); 185 185 } 186 186 187 - for (i = page_start; i < page_end; i++) 188 - __clear_bit(i, populated); 187 + bitmap_clear(populated, page_start, page_end - page_start); 189 188 } 190 189 191 190 /**