1. 29 10月, 2009 2 次提交
    • R
      percpu: remove per_cpu__ prefix. · dd17c8f7
      Rusty Russell 提交于
      Now that the return from alloc_percpu is compatible with the address
      of per-cpu vars, it makes sense to hand around the address of per-cpu
      variables.  To make this sane, we remove the per_cpu__ prefix we used
      created to stop people accidentally using these vars directly.
      
      Now we have sparse, we can use that (next patch).
      
      tj: * Updated to convert stuff which were missed by or added after the
            original patch.
      
          * Kill per_cpu_var() macro.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reviewed-by: NChristoph Lameter <cl@linux-foundation.org>
      dd17c8f7
    • T
      percpu: remove some sparse warnings · 0f5e4816
      Tejun Heo 提交于
      Make the following changes to remove some sparse warnings.
      
      * Make DEFINE_PER_CPU_SECTION() declare __pcpu_unique_* before
        defining it.
      
      * Annotate pcpu_extend_area_map() that it is entered with pcpu_lock
        held, releases it and then reacquires it.
      
      * Make percpu related macros use unique nested variable names.
      
      * While at it, add pcpu prefix to __size_call[_return]() macros as
        to-be-implemented sparse annotations will add percpu specific stuff
        to these macros.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reviewed-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      0f5e4816
  2. 04 9月, 2009 1 次提交
  3. 04 8月, 2009 1 次提交
    • T
      x86, percpu: Fix DECLARE/DEFINE_PER_CPU_PAGE_ALIGNED() · 3e352aa8
      Tejun Heo 提交于
      DECLARE/DEFINE_PER_CPU_PAGE_ALIGNED() put percpu variables in
      .page_aligned section without adding any alignment restrictions.
      Currently, this doesn't cause any problem because all users of the
      macros have explicit page alignment and page-sized but it's much safer
      to enforce page alignment from the macros.  After all, it's what they
      claim to do.
      
      Add __aligned(PAGE_SIZE) to DECLARE/DEFINE_PER_CPU_PAGE_ALIGNED() and
      drop explicit alignment from it users.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      3e352aa8
  4. 01 7月, 2009 1 次提交
    • T
      alpha: fix percpu build breakage · b01e8dc3
      Tejun Heo 提交于
      alpha percpu access requires custom SHIFT_PERCPU_PTR() definition for
      modules to work around addressing range limitation.  This is done via
      generating inline assembly using C preprocessing which forces the
      assembler to generate external reference.  This happens behind the
      compiler's back and makes the compiler think that static percpu variables
      in modules are unused.
      
      This used to be worked around by using __unused attribute for percpu
      variables which prevent the compiler from omitting the variable; however,
      recent declare/definition attribute unification change broke this as
      __used can't be used for declaration.  Also, in the process,
      PER_CPU_ATTRIBUTES definition in alpha percpu.h got broken.
      
      This patch adds PER_CPU_DEF_ATTRIBUTES which is only used for definitions
      and make alpha use it to add __used for percpu variables in modules.  This
      also fixes the PER_CPU_ATTRIBUTES double definition bug.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Tested-by: Nmaximilian attems <max@stro.at>
      Acked-by: NIvan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b01e8dc3
  5. 29 6月, 2009 1 次提交
  6. 24 6月, 2009 1 次提交
    • T
      percpu: implement optional weak percpu definitions · 7c756e6e
      Tejun Heo 提交于
      Some archs (alpha and s390) need to use weak definitions for percpu
      variables in modules so that the compiler generates external
      references for them.
      
      This patch implements weak percpu definitions which arch can enable by
      defining ARCH_NEEDS_WEAK_PER_CPU in arch percpu header file.  This
      weak definition adds the following two restrictions on percpu variable
      definitions.
      
        1. percpu symbols must be unique whether static or not
        2. percpu variables can't be defined inside a function
      
      To ensure that these restrictions are observed in generic code, config
      option DEBUG_FORCE_WEAK_PER_CPU enables weak percpu definitions for
      all cases.
      
      This patch is inspired by Ivan Kokshaysky's alpha percpu patch.
      
      [ Impact: stricter rules for percpu variables, one more debug config option ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      7c756e6e
  7. 22 4月, 2009 1 次提交