27 Oct, 2010

1 commit

  • [DECLARE|DEFINE]_PER_CPU_MULTIPAGE_ALIGNED never really worked because
    the head percpu section was only page aligned. Now that the last user
    is gone (32-bit IRQ stacks), remove the generic percpu facility.

    Cc: Brian Gerst
    Acked-by: Tejun Heo
    Acked-by: Linus Torvalds
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

22 Oct, 2010

1 commit


21 Oct, 2010

1 commit

  • Add a new readmostly percpu section and API. This can be used to
    avoid dirtying data lines which are generally not written to, which is
    especially important for data which may be accessed by processors
    other than the one for which the percpu area belongs to.

    [ hpa: moved it *after* the page-aligned section, for obvious
    reasons. ]

    Signed-off-by: Shaohua Li
    LKML-Reference:
    Cc: Eric Dumazet
    Signed-off-by: H. Peter Anvin

    Shaohua Li
     

07 Sep, 2010

1 commit

  • The irq stacks, located in the percpu-area, need to be
    THREAD_SIZE aligned. Add the infrastucture to align percpu
    variables to larger-than-pagesize amounts within the percpu
    area, and use it to specify the alignment for the irq stacks.
    Also align the percpu area itself to THREAD_SIZE.

    This should make irq stacks work with 8K THREAD_SIZE.

    Signed-off-by: Alexander van Heukelum
    Cc: Tejun Heo
    Cc: hch@lst.de
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Alexander van Heukelum
     

01 Jun, 2010

1 commit

  • * 'for-35' of git://repo.or.cz/linux-kbuild: (81 commits)
    kbuild: Revert part of e8d400a to resolve a conflict
    kbuild: Fix checking of scm-identifier variable
    gconfig: add support to show hidden options that have prompts
    menuconfig: add support to show hidden options which have prompts
    gconfig: remove show_debug option
    gconfig: remove dbg_print_ptype() and dbg_print_stype()
    kconfig: fix zconfdump()
    kconfig: some small fixes
    add random binaries to .gitignore
    kbuild: Include gen_initramfs_list.sh and the file list in the .d file
    kconfig: recalc symbol value before showing search results
    .gitignore: ignore *.lzo files
    headerdep: perlcritic warning
    scripts/Makefile.lib: Align the output of LZO
    kbuild: Generate modules.builtin in make modules_install
    Revert "kbuild: specify absolute paths for cscope"
    kbuild: Do not unnecessarily regenerate modules.builtin
    headers_install: use local file handles
    headers_check: fix perl warnings
    export_report: fix perl warnings
    ...

    Linus Torvalds
     

03 Mar, 2010

1 commit


08 Dec, 2009

1 commit

  • If percpu pointer is const, __verify_pcpu_ptr() triggers warnings like
    the following.

    drivers/net/loopback.c: In function 'loopback_get_stats':
    drivers/net/loopback.c:109: warning: initialization discards qualifiers from pointer target type

    Fix it by adding const to the verification target pointer used in
    __verify_pcpu_ptr().

    Signed-off-by: Tejun Heo
    Reported-by: Stephen Rothwell

    Tejun Heo
     

29 Oct, 2009

4 commits

  • The previous patch made sparse warn about percpu variables being used
    directly without going through percpu accessors. This patch
    implements the other half - checking whether non percpu variable is
    passed into percpu accessors.

    Signed-off-by: Tejun Heo
    Cc: Rusty Russell
    Cc: Al Viro

    Tejun Heo
     
  • We have to make __kernel "__attribute__((address_space(0)))" so we can
    cast to it.

    tj: * put_cpu_var() update.

    * Annotations added to dynamic allocator interface.

    Signed-off-by: Rusty Russell
    Cc: Al Viro
    Signed-off-by: Tejun Heo

    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: Rusty Russell
    Signed-off-by: Tejun Heo
    Reviewed-by: Christoph Lameter

    Rusty Russell
     
  • 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: Tejun Heo
    Reviewed-by: Christoph Lameter
    Cc: Rusty Russell

    Tejun Heo
     

16 Sep, 2009

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: (46 commits)
    powerpc64: convert to dynamic percpu allocator
    sparc64: use embedding percpu first chunk allocator
    percpu: kill lpage first chunk allocator
    x86,percpu: use embedding for 64bit NUMA and page for 32bit NUMA
    percpu: update embedding first chunk allocator to handle sparse units
    percpu: use group information to allocate vmap areas sparsely
    vmalloc: implement pcpu_get_vm_areas()
    vmalloc: separate out insert_vmalloc_vm()
    percpu: add chunk->base_addr
    percpu: add pcpu_unit_offsets[]
    percpu: introduce pcpu_alloc_info and pcpu_group_info
    percpu: move pcpu_lpage_build_unit_map() and pcpul_lpage_dump_cfg() upward
    percpu: add @align to pcpu_fc_alloc_fn_t
    percpu: make @dyn_size mandatory for pcpu_setup_first_chunk()
    percpu: drop @static_size from first chunk allocators
    percpu: generalize first chunk allocator selection
    percpu: build first chunk allocators selectively
    percpu: rename 4k first chunk allocator to page
    percpu: improve boot messages
    percpu: fix pcpu_reclaim() locking
    ...

    Fix trivial conflict as by Tejun Heo in kernel/sched.c

    Linus Torvalds
     

14 Sep, 2009

1 commit


04 Sep, 2009

1 commit


04 Aug, 2009

1 commit

  • 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: Tejun Heo
    Cc: Ingo Molnar
    Signed-off-by: H. Peter Anvin

    Tejun Heo
     

04 Jul, 2009

1 commit

  • Pull linus#master to merge PER_CPU_DEF_ATTRIBUTES and alpha build fix
    changes. As alpha in percpu tree uses 'weak' attribute instead of
    inline assembly, there's no need for __used attribute.

    Conflicts:
    arch/alpha/include/asm/percpu.h
    arch/mn10300/kernel/vmlinux.lds.S
    include/linux/percpu-defs.h

    Tejun Heo
     

01 Jul, 2009

1 commit

  • 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: Tejun Heo
    Tested-by: maximilian attems
    Acked-by: Ivan Kokshaysky
    Cc: Richard Henderson
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tejun Heo
     

29 Jun, 2009

1 commit


24 Jun, 2009

1 commit

  • 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: Tejun Heo
    Cc: Ingo Molnar
    Cc: David Howells
    Cc: Ivan Kokshaysky

    Tejun Heo
     

22 Apr, 2009

1 commit

  • Collect the DECLARE/DEFINE declarations together in linux/percpu-defs.h so
    that they're in one place, and give them descriptive comments, particularly
    the SHARED_ALIGNED variant.

    It would be nice to collect these in linux/percpu.h, but that's not possible
    without sorting out the severe #include recursion between the x86 arch headers
    and the general headers (and possibly other arches too).

    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds

    David Howells