15 Dec, 2014

1 commit

  • Pull driver core update from Greg KH:
    "Here's the set of driver core patches for 3.19-rc1.

    They are dominated by the removal of the .owner field in platform
    drivers. They touch a lot of files, but they are "simple" changes,
    just removing a line in a structure.

    Other than that, a few minor driver core and debugfs changes. There
    are some ath9k patches coming in through this tree that have been
    acked by the wireless maintainers as they relied on the debugfs
    changes.

    Everything has been in linux-next for a while"

    * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
    Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
    fs: debugfs: add forward declaration for struct device type
    firmware class: Deletion of an unnecessary check before the function call "vunmap"
    firmware loader: fix hung task warning dump
    devcoredump: provide a one-way disable function
    device: Add dev__once variants
    ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
    ath: use seq_file api for ath9k debugfs files
    debugfs: add helper function to create device related seq_file
    drivers/base: cacheinfo: remove noisy error boot message
    Revert "core: platform: add warning if driver has no owner"
    drivers: base: support cpu cache information interface to userspace via sysfs
    drivers: base: add cpu_device_create to support per-cpu devices
    topology: replace custom attribute macros with standard DEVICE_ATTR*
    cpumask: factor out show_cpumap into separate helper function
    driver core: Fix unbalanced device reference in drivers_probe
    driver core: fix race with userland in device_add()
    sysfs/kernfs: make read requests on pre-alloc files use the buffer.
    sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
    fs: sysfs: return EGBIG on write if offset is larger than file size
    ...

    Linus Torvalds
     

14 Dec, 2014

1 commit

  • Add a bitmap_find_next_zero_area_off() function which works like
    bitmap_find_next_zero_area() function except it allows an offset to be
    specified when alignment is checked. This lets caller request a bit such
    that its number plus the offset is aligned according to the mask.

    [gregory.0xf0@gmail.com: Retrieved from https://patchwork.linuxtv.org/patch/6254/ and updated documentation]
    Signed-off-by: Michal Nazarewicz
    Signed-off-by: Kyungmin Park
    Signed-off-by: Marek Szyprowski
    Signed-off-by: Gregory Fong
    Cc: Joonsoo Kim
    Cc: Kukjin Kim
    Cc: Laurent Pinchart
    Cc: Laura Abbott
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michal Nazarewicz
     

08 Nov, 2014

1 commit

  • Many sysfs *_show function use cpu{list,mask}_scnprintf to copy cpumap
    to the buffer aligned to PAGE_SIZE, append '\n' and '\0' to return null
    terminated buffer with newline.

    This patch creates a new helper function cpumap_print_to_pagebuf in
    cpumask.h using newly added bitmap_print_to_pagebuf and consolidates
    most of those sysfs functions using the new helper function.

    Signed-off-by: Sudeep Holla
    Suggested-by: Stephen Boyd
    Tested-by: Stephen Boyd
    Acked-by: "Rafael J. Wysocki"
    Acked-by: Bjorn Helgaas
    Acked-by: Peter Zijlstra (Intel)
    Cc: Greg Kroah-Hartman
    Cc: x86@kernel.org
    Cc: linux-acpi@vger.kernel.org
    Cc: linux-pci@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman

    Sudeep Holla
     

30 Oct, 2014

1 commit

  • If __bitmap_shift_left() or __bitmap_shift_right() are asked to shift by
    a multiple of BITS_PER_LONG, they will try to shift a long value by
    BITS_PER_LONG bits which is undefined. Change the functions to avoid
    the undefined shift.

    Coverity id: 1192175
    Coverity id: 1192174
    Signed-off-by: Jan Kara
    Cc: Rasmus Villemoes
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Kara
     

08 Oct, 2014

1 commit

  • Pull "trivial tree" updates from Jiri Kosina:
    "Usual pile from trivial tree everyone is so eagerly waiting for"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits)
    Remove MN10300_PROC_MN2WS0038
    mei: fix comments
    treewide: Fix typos in Kconfig
    kprobes: update jprobe_example.c for do_fork() change
    Documentation: change "&" to "and" in Documentation/applying-patches.txt
    Documentation: remove obsolete pcmcia-cs from Changes
    Documentation: update links in Changes
    Documentation: Docbook: Fix generated DocBook/kernel-api.xml
    score: Remove GENERIC_HAS_IOMAP
    gpio: fix 'CONFIG_GPIO_IRQCHIP' comments
    tty: doc: Fix grammar in serial/tty
    dma-debug: modify check_for_stack output
    treewide: fix errors in printk
    genirq: fix reference in devm_request_threaded_irq comment
    treewide: fix synchronize_rcu() in comments
    checkstack.pl: port to AArch64
    doc: queue-sysfs: minor fixes
    init/do_mounts: better syntax description
    MIPS: fix comment spelling
    powerpc/simpleboot: fix comment
    ...

    Linus Torvalds
     

09 Sep, 2014

1 commit


07 Aug, 2014

17 commits

  • Apparently, bitmap_andnot is supposed to return whether the new bitmap
    is empty. But it didn't take potential garbage bits in the last word
    into account.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • Apparently, bitmap_and is supposed to return whether the new bitmap is
    empty. But it didn't take potential garbage bits in the last word into
    account.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • __reg_op(..., REG_OP_ALLOC) always returns 0, so we might as well use that
    and save an instruction.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • Changing the pos parameter of __reg_op to unsigned allows the compiler
    to generate slightly smaller and simpler code. Also update its callers
    bitmap_*_region to receive and pass unsigned int. The return types of
    bitmap_find_free_region and bitmap_allocate_region are still int to
    allow a negative error code to be returned. An int is certainly capable
    of representing any realistic return value.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • A few lines above, it was stated that positions for non-set bits are
    mapped to -1, which is obviously also what the code does.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • We want len to be the index of the first '\n', or the length of the
    string if there is no newline. This is a good example of the usefulness
    of strchrnul(). Use that instead, thus eliminating a branch and a call
    to strlen().

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • The compiler can generate slightly smaller and simpler code when it
    knows that "start" is non-negative.

    Also, use the names "start" and "len" for the two parameters for
    consistency with bitmap_set.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • The compiler can generate slightly smaller and simpler code when it
    knows that "start" is non-negative.

    Also, use the names "start" and "len" for the two parameters in both
    header file and implementation, instead of the previous mix.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • The compiler can generate slightly smaller and simpler code when it
    knows that "nbits" is non-negative. Since no-one passes a negative
    bit-count, this shouldn't affect the semantics.

    I didn't change the return type, since that might change the semantics
    of some expression containing a call to bitmap_weight(). Certainly an
    int is capable of holding the result.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • The compiler can generate slightly smaller and simpler code when it
    knows that "nbits" is non-negative. Since no-one passes a negative
    bit-count, this shouldn't affect the semantics.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • The compiler can generate slightly smaller and simpler code when it
    knows that "nbits" is non-negative. Since no-one passes a negative
    bit-count, this shouldn't affect the semantics.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • This change is only for consistency with the changes to the other
    bitmap_* functions; it doesn't change the size of the generated code:
    inside BITS_TO_LONGS there is a sizeof(long), which causes bits to be
    interpreted as unsigned anyway.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • Since the extra bits are "don't care", there is no reason to mask the
    last word to the used bits when complementing. This shaves off yet a
    few bytes.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • The compiler can generate slightly smaller and simpler code when it
    knows that "nbits" is non-negative. Since no-one passes a negative
    bit-count, this shouldn't affect the semantics.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • The compiler can generate slightly smaller and simpler code when it
    knows that "nbits" is non-negative. Since no-one passes a negative
    bit-count, this shouldn't affect the semantics.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • The compiler can generate slightly smaller and simpler code when it
    knows that "nbits" is non-negative. Since no-one passes a negative
    bit-count, this shouldn't affect the semantics.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • Many functions in lib/bitmap.c start with an expression such as lim =
    bits/BITS_PER_LONG. Since bits has type (signed) int, and since gcc
    cannot know that it is in fact non-negative, it generates worse code
    than it could. These patches, mostly consisting of changing various
    parameters to unsigned, gives a slight overall code reduction:

    add/remove: 1/1 grow/shrink: 8/16 up/down: 251/-414 (-163)
    function old new delta
    tick_device_uses_broadcast 335 425 +90
    __irq_alloc_descs 498 554 +56
    __bitmap_andnot 73 115 +42
    __bitmap_and 70 101 +31
    bitmap_weight - 11 +11
    copy_hugetlb_page_range 752 762 +10
    follow_hugetlb_page 846 854 +8
    hugetlb_init 1415 1417 +2
    hugetlb_nrpages_setup 130 131 +1
    hugetlb_add_hstate 377 376 -1
    bitmap_allocate_region 82 80 -2
    select_task_rq_fair 2202 2191 -11
    hweight_long 66 55 -11
    __reg_op 230 219 -11
    dm_stats_message 2849 2833 -16
    bitmap_parselist 92 74 -18
    __bitmap_weight 115 97 -18
    __bitmap_subset 153 129 -24
    __bitmap_full 128 104 -24
    __bitmap_empty 120 96 -24
    bitmap_set 179 149 -30
    bitmap_clear 185 155 -30
    __bitmap_equal 136 105 -31
    __bitmap_intersects 148 108 -40
    __bitmap_complement 109 67 -42
    tick_device_setup_broadcast_func.isra 81 - -81

    [The increases in __bitmap_and{,not} are due to bug fixes 17/18,18/18.
    No idea why bitmap_weight suddenly appears.] While 163 bytes treewide is
    insignificant, I believe the bitmap functions are often called with
    locks held, so saving even a few cycles might be worth it.

    While making these changes, I found a few other things that might be
    worth including. 16,17,18 are actual bug fixes. The rest shouldn't
    change the behaviour of any of the functions, provided no-one passed
    negative nbits values. If something should come up, it should be fairly
    bisectable.

    A few issues I thought about, but didn't know what to do with:

    * Many of the functions misbehave if nbits is compile-time 0; the
    out-of-line functions generally handle 0 correctly. bitmap_fill() is
    particularly bad, whether the 0 is known at compile time or not. It
    would probably be nice to add detection of at least compile-time 0 and
    handle that appropriately.

    * I didn't change __bitmap_shift_{left,right} to use unsigned because I
    want to fully understand why the algorithm works before making that
    change. However, AFAICT, they behave correctly for all (positive) shift
    amounts. This is not the case for the small_const_nbits versions. If
    for example nbits = n = BITS_PER_LONG, the shift operators turn into
    no-ops (at least on x86), so one get *dst = *src, whereas one would
    expect to get *dst=0. That difference in behaviour is somewhat
    annoying.

    This patch (of 18):

    The compiler can generate slightly smaller and simpler code when it
    knows that "nbits" is non-negative. Since no-one passes a negative
    bit-count, this shouldn't affect the semantics.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     

06 Dec, 2012

1 commit


30 May, 2012

1 commit


25 Mar, 2012

1 commit

  • Pull cleanup of fs/ and lib/ users of module.h from Paul Gortmaker:
    "Fix up files in fs/ and lib/ dirs to only use module.h if they really
    need it.

    These are trivial in scope vs the work done previously. We now have
    things where any few remaining cleanups can be farmed out to arch or
    subsystem maintainers, and I have done so when possible. What is
    remaining here represents the bits that don't clearly lie within a
    single arch/subsystem boundary, like the fs dir and the lib dir.

    Some duplicate includes arising from overlapping fixes from
    independent subsystem maintainer submissions are also quashed."

    Fix up trivial conflicts due to clashes with other include file cleanups
    (including some due to the previous bug.h cleanup pull).

    * tag 'module-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux:
    lib: reduce the use of module.h wherever possible
    fs: reduce the use of module.h wherever possible
    includecheck: delete any duplicate instances of module.h

    Linus Torvalds
     

08 Mar, 2012

1 commit


01 Mar, 2012

1 commit


01 Nov, 2011

1 commit

  • __bitmap_parse() and __bitmap_parselist() both take a pointer to a kernel
    buffer as a parameter and then cast it to a pointer to user buffer for use
    in cases when the parameter is_user indicates that the buffer is actually
    located in user space. This casting, and the casts in the callers,
    results in sparse noise like the following:

    warning: incorrect type in initializer (different address spaces)
    expected char const [noderef] *ubuf
    got char const *buf
    warning: cast removes address space of expression

    Since these casts are intentional, use __force to quiet the noise.

    Signed-off-by: H Hartley Sweeten
    Cc: Len Brown
    Cc: Huang Ying
    Cc: Andy Shevchenko
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    H Hartley Sweeten
     

03 Aug, 2011

2 commits

  • Some trivial conflicts due to other various merges
    adding to the end of common lists sooner than this one.

    arch/ia64/Kconfig
    arch/powerpc/Kconfig
    arch/x86/Kconfig
    lib/Kconfig
    lib/Makefile

    Signed-off-by: Len Brown

    Len Brown
     
  • This version of the gen_pool memory allocator supports lockless
    operation.

    This makes it safe to use in NMI handlers and other special
    unblockable contexts that could otherwise deadlock on locks. This is
    implemented by using atomic operations and retries on any conflicts.
    The disadvantage is that there may be livelocks in extreme cases. For
    better scalability, one gen_pool allocator can be used for each CPU.

    The lockless operation only works if there is enough memory available.
    If new memory is added to the pool a lock has to be still taken. So
    any user relying on locklessness has to ensure that sufficient memory
    is preallocated.

    The basic atomic operation of this allocator is cmpxchg on long. On
    architectures that don't have NMI-safe cmpxchg implementation, the
    allocator can NOT be used in NMI handler. So code uses the allocator
    in NMI handler should depend on CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG.

    Signed-off-by: Huang Ying
    Reviewed-by: Andi Kleen
    Reviewed-by: Mathieu Desnoyers
    Cc: Andrew Morton
    Signed-off-by: Len Brown

    Huang Ying
     

27 Jul, 2011

1 commit

  • [ This patch has already been accepted as commit 0ac0c0d0f837 but later
    reverted (commit 35926ff5fba8) because it itroduced arch specific
    __node_random which was defined only for x86 code so it broke other
    archs. This is a followup without any arch specific code. Other than
    that there are no functional changes.]

    Some workloads that create a large number of small files tend to assign
    too many pages to node 0 (multi-node systems). Part of the reason is
    that the rotor (in cpuset_mem_spread_node()) used to assign nodes starts
    at node 0 for newly created tasks.

    This patch changes the rotor to be initialized to a random node number
    of the cpuset.

    [akpm@linux-foundation.org: fix layout]
    [Lee.Schermerhorn@hp.com: Define stub numa_random() for !NUMA configuration]
    [mhocko@suse.cz: Make it arch independent]
    [akpm@linux-foundation.org: fix CONFIG_NUMA=y, MAX_NUMNODES>1 build]
    Signed-off-by: Jack Steiner
    Signed-off-by: Lee Schermerhorn
    Signed-off-by: Michal Hocko
    Reviewed-by: KOSAKI Motohiro
    Cc: Christoph Lameter
    Cc: Pekka Enberg
    Cc: Paul Menage
    Cc: Jack Steiner
    Cc: Robin Holt
    Cc: David Rientjes
    Cc: Christoph Lameter
    Cc: David Rientjes
    Cc: Jack Steiner
    Cc: KOSAKI Motohiro
    Cc: Lee Schermerhorn
    Cc: Michal Hocko
    Cc: Paul Menage
    Cc: Pekka Enberg
    Cc: Robin Holt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michal Hocko
     

16 Jun, 2011

1 commit

  • Fix new kernel-doc warnings in lib/bitmap.c:

    Warning(lib/bitmap.c:596): No description found for parameter 'buf'
    Warning(lib/bitmap.c:596): Excess function parameter 'bp' description in '__bitmap_parselist'

    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     

25 May, 2011

1 commit

  • Manually adjusting the smp_affinity for IRQ's becomes unwieldy when the
    cpu count is large.

    Setting smp affinity to cpus 256 to 263 would be:

    echo 000000ff,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > smp_affinity

    instead of:

    echo 256-263 > smp_affinity_list

    Think about what it looks like for cpus around say, 4088 to 4095.

    We already have many alternate "list" interfaces:

    /sys/devices/system/cpu/cpuX/indexY/shared_cpu_list
    /sys/devices/system/cpu/cpuX/topology/thread_siblings_list
    /sys/devices/system/cpu/cpuX/topology/core_siblings_list
    /sys/devices/system/node/nodeX/cpulist
    /sys/devices/pci***/***/local_cpulist

    Add a companion interface, smp_affinity_list to use cpu lists instead of
    cpu maps. This conforms to other companion interfaces where both a map
    and a list interface exists.

    This required adding a bitmap_parselist_user() function in a manner
    similar to the bitmap_parse_user() function.

    [akpm@linux-foundation.org: make __bitmap_parselist() static]
    Signed-off-by: Mike Travis
    Cc: Thomas Gleixner
    Cc: Jack Steiner
    Cc: Lee Schermerhorn
    Cc: Andy Shevchenko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Travis
     

31 Mar, 2011

1 commit


27 Oct, 2010

1 commit


31 May, 2010

1 commit

  • This reverts commit 0ac0c0d0f837c499afd02a802f9cf52d3027fa3b, which
    caused cross-architecture build problems for all the wrong reasons.
    IA64 already added its own version of __node_random(), but the fact is,
    there is nothing architectural about the function, and the original
    commit was just badly done. Revert it, since no fix is forthcoming.

    Requested-by: Stephen Rothwell
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

28 May, 2010

1 commit

  • Some workloads that create a large number of small files tend to assign
    too many pages to node 0 (multi-node systems). Part of the reason is that
    the rotor (in cpuset_mem_spread_node()) used to assign nodes starts at
    node 0 for newly created tasks.

    This patch changes the rotor to be initialized to a random node number of
    the cpuset.

    [akpm@linux-foundation.org: fix layout]
    [Lee.Schermerhorn@hp.com: Define stub numa_random() for !NUMA configuration]
    Signed-off-by: Jack Steiner
    Signed-off-by: Lee Schermerhorn
    Cc: Christoph Lameter
    Cc: Pekka Enberg
    Cc: Paul Menage
    Cc: Jack Steiner
    Cc: Robin Holt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jack Steiner
     

07 Mar, 2010

2 commits