09 Jun, 2014

1 commit

  • Now that 3.15 is released, this merges the 'next' branch into 'master',
    bringing us to the normal situation where my 'master' branch is the
    merge window.

    * accumulated work in next: (6809 commits)
    ufs: sb mutex merge + mutex_destroy
    powerpc: update comments for generic idle conversion
    cris: update comments for generic idle conversion
    idle: remove cpu_idle() forward declarations
    nbd: zero from and len fields in NBD_CMD_DISCONNECT.
    mm: convert some level-less printks to pr_*
    MAINTAINERS: adi-buildroot-devel is moderated
    MAINTAINERS: add linux-api for review of API/ABI changes
    mm/kmemleak-test.c: use pr_fmt for logging
    fs/dlm/debug_fs.c: replace seq_printf by seq_puts
    fs/dlm/lockspace.c: convert simple_str to kstr
    fs/dlm/config.c: convert simple_str to kstr
    mm: mark remap_file_pages() syscall as deprecated
    mm: memcontrol: remove unnecessary memcg argument from soft limit functions
    mm: memcontrol: clean up memcg zoneinfo lookup
    mm/memblock.c: call kmemleak directly from memblock_(alloc|free)
    mm/mempool.c: update the kmemleak stack trace for mempool allocations
    lib/radix-tree.c: update the kmemleak stack trace for radix tree allocations
    mm: introduce kmemleak_update_trace()
    mm/kmemleak.c: use %u to print ->checksum
    ...

    Linus Torvalds
     

07 Jun, 2014

7 commits

  • Since radix_tree_preload() stack trace is not always useful for
    debugging an actual radix tree memory leak, this patch updates the
    kmemleak allocation stack trace in the radix_tree_node_alloc() function.

    Signed-off-by: Catalin Marinas
    Acked-by: Johannes Weiner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Catalin Marinas
     
  • If "idr->hint == p" is true, it also implies "idr->hint" is true(not NULL).

    Signed-off-by: Lai Jiangshan
    Acked-by: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lai Jiangshan
     
  • After idr subsystem is changed to RCU-awared, the free layer will not go
    to the free list. The free list will not be filled up when
    idr_remove(). So we don't need to shink it too.

    Signed-off-by: Lai Jiangshan
    Acked-by: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lai Jiangshan
     
  • When the smaller id is not found, idr_replace() returns -ENOENT. But
    when the id is bigger enough, idr_replace() returns -EINVAL, actually
    there is no difference between these two kinds of ids.

    These are all unallocated id, the return values of the idr_replace() for
    these ids should be the same: -ENOENT.

    Signed-off-by: Lai Jiangshan
    Acked-by: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lai Jiangshan
     
  • If the ida has at least one existing id, and when an unallocated ID
    which meets a certain condition is passed to the ida_remove(), the
    system will crash because it hits NULL pointer dereference.

    The condition is that the unallocated ID shares the same lowest idr
    layer with the existing ID, but the idr slot would be different if the
    unallocated ID were to be allocated.

    In this case the matching idr slot for the unallocated_id is NULL,
    causing @bitmap to be NULL which the function dereferences without
    checking crashing the kernel.

    See the test code:

    static void test3(void)
    {
    int id;
    DEFINE_IDA(test_ida);

    printk(KERN_INFO "Start test3\n");
    if (ida_pre_get(&test_ida, GFP_KERNEL) < 0) return;
    if (ida_get_new(&test_ida, &id) < 0) return;
    ida_remove(&test_ida, 4000); /* bug: null deference here */
    printk(KERN_INFO "End of test3\n");
    }

    It happens only when the caller tries to free an unallocated ID which is
    the caller's fault. It is not a bug. But it is better to add the
    proper check and complain rather than crashing the kernel.

    [tj@kernel.org: updated patch description]
    Signed-off-by: Lai Jiangshan
    Acked-by: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lai Jiangshan
     
  • If unallocated_id = (ANY * idr_max(idp->layers) + existing_id) is passed
    to idr_remove(). The existing_id will be removed unexpectedly.

    The following test shows this unexpected id-removal:

    static void test4(void)
    {
    int id;
    DEFINE_IDR(test_idr);

    printk(KERN_INFO "Start test4\n");
    id = idr_alloc(&test_idr, (void *)1, 42, 43, GFP_KERNEL);
    BUG_ON(id != 42);
    idr_remove(&test_idr, 42 + IDR_SIZE);
    TEST_BUG_ON(idr_find(&test_idr, 42) != (void *)1);
    idr_destroy(&test_idr);
    printk(KERN_INFO "End of test4\n");
    }

    ida_remove() shares the similar problem.

    It happens only when the caller tries to free an unallocated ID which is
    the caller's fault. It is not a bug. But it is better to add the
    proper check and complain rather than removing an existing_id silently.

    Signed-off-by: Lai Jiangshan
    Acked-by: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lai Jiangshan
     
  • idr_replace() open-codes the logic to calculate the maximum valid ID
    given the height of the idr tree; unfortunately, the open-coded logic
    doesn't account for the fact that the top layer may have unused slots
    and over-shifts the limit to zero when the tree is at its maximum
    height.

    The following test code shows it fails to replace the value for
    id=((1<<
    Acked-by: Tejun Heo
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lai Jiangshan
     

06 Jun, 2014

1 commit

  • …git/tip/tip into next

    Pull ARM64 EFI update from Peter Anvin:
    "By agreement with the ARM64 EFI maintainers, we have agreed to make
    -tip the upstream for all EFI patches. That is why this patchset
    comes from me :)

    This patchset enables EFI stub support for ARM64, like we already have
    on x86"

    * 'arm64-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    arm64: efi: only attempt efi map setup if booting via EFI
    efi/arm64: ignore dtb= when UEFI SecureBoot is enabled
    doc: arm64: add description of EFI stub support
    arm64: efi: add EFI stub
    doc: arm: add UEFI support documentation
    arm64: add EFI runtime services
    efi: Add shared FDT related functions for ARM/ARM64
    arm64: Add function to create identity mappings
    efi: add helper function to get UEFI params from FDT
    doc: efi-stub.txt updates for ARM
    lib: add fdt_empty_tree.c

    Linus Torvalds
     

05 Jun, 2014

24 commits

  • Signed-off-by: Fabian Frederick
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • Convert printk to current pr_foo() logging functions.

    Also add pr_fmt based on KBUILD_MODNAME to avoid repeating prefix. Prefix
    is now "atomic64_test: "

    Signed-off-by: Fabian Frederick
    Cc: Luca Barbieri
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • - Coalesce formats

    - "WARNING:" prefix unchanged to keep bug format.

    - printk(KERN_DEFAULT not converted.

    - define pr_fmt without prefix to avoid any default prefix update
    (suggested by Joe Perches).

    Signed-off-by: Fabian Frederick
    Cc: Jeremy Fitzhardinge
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • Fix checkpatch warning:
    "WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable"

    Signed-off-by: Fabian Frederick
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • Fix some checkpatch warnings:
    WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable

    Signed-off-by: Fabian Frederick
    Cc: Pablo Neira
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • Small typo and @return: -> Returns ...

    Signed-off-by: Fabian Frederick
    Cc: Duan Jiong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • Use cpu_to_le32 instead of __constant_cpu_to_le32.

    Signed-off-by: Fabian Frederick
    Cc: "David S. Miller"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • index has been removed from __radix_tree_delete_node in 449dd6984d0e47
    ("mm: keep page cache radix tree nodes in check")

    Signed-off-by: Fabian Frederick
    Cc: Johannes Weiner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • Change CONFIG_DEBUG_PI_LIST to be user-selectable, and add a title and
    description. Remove the dependency on DEBUG_RT_MUTEXES since they were
    changed to use rbtrees, and there are other users of plists now.

    Signed-off-by: Dan Streetman
    Acked-by: Steven Rostedt
    Cc: Peter Zijlstra
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Streetman
     
  • I use btree from 3.14-rc2 in my own module. When the btree module is
    removed, a warning arises:

    kmem_cache_destroy btree_node: Slab cache still has objects
    CPU: 13 PID: 9150 Comm: rmmod Tainted: GF O 3.14.0-rc2 #1
    Hardware name: Inspur NF5270M3/NF5270M3, BIOS CHEETAH_2.1.3 09/10/2013
    Call Trace:
    dump_stack+0x49/0x5d
    kmem_cache_destroy+0xcf/0xe0
    btree_module_exit+0x10/0x12 [btree]
    SyS_delete_module+0x198/0x1f0
    system_call_fastpath+0x16/0x1b

    The cause is that it doesn't release the last btree node, when height = 1
    and fill = 1.

    [akpm@linux-foundation.org: remove unneeded test of NULL]
    Signed-off-by: Minfei Huang
    Cc: Joern Engel
    Cc: Johannes Berg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Minfei Huang
     
  • Fixing 2 coccinelle warnings:
    lib/vsprintf.c:2350:2-9: WARNING: Assignment of bool to 0/1
    lib/vsprintf.c:2389:3-10: WARNING: Assignment of bool to 0/1

    Signed-off-by: Fabian Frederick
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • replace IS_ERR/PTR_ERR

    Signed-off-by: Fabian Frederick
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • This restores the old behavior that existed before 2013-02-22, when
    changes were made by 64dbfb444c150 ("decompressors: drop dependency on
    CONFIG_EXPERT") and 5dc49c75a2 ("decompressors: make the default
    XZ_DEC_* config match the selected architecture").

    Disabling the filters only makes sense on embedded systems.

    Signed-off-by: Lasse Collin
    Acked-by: Kyle McMartin
    Cc: Florian Fainelli
    Cc: Phillip Lougher
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lasse Collin
     
  • Replace pr_debug() in lib/plist.c test function plist_test() with
    printk(KERN_DEBUG ...).

    Without DEBUG defined, pr_debug() is complied out, but the entire
    plist_test() function is already inside CONFIG_DEBUG_PI_LIST, so printk
    should just be used directly.

    Signed-off-by: Dan Streetman
    Reviewed-by: Steven Rostedt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Streetman
     
  • Signed-off-by: Lasse Collin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lasse Collin
     
  • For strncpy() and friends the source string may or may not have an actual
    NUL character at the end. The documentation is confusing in this because
    it specifically mentions that you are passing a "NUL-terminated" string.
    Wikipedia says that "C-string" is an alternative name we can use instead.

    http://en.wikipedia.org/wiki/Null-terminated_string

    Signed-off-by: Dan Carpenter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Carpenter
     
  • Add plist_requeue(), which moves the specified plist_node after all other
    same-priority plist_nodes in the list. This is essentially an optimized
    plist_del() followed by plist_add().

    This is needed by swap, which (with the next patch in this set) uses a
    plist of available swap devices. When a swap device (either a swap
    partition or swap file) are added to the system with swapon(), the device
    is added to a plist, ordered by the swap device's priority. When swap
    needs to allocate a page from one of the swap devices, it takes the page
    from the first swap device on the plist, which is the highest priority
    swap device. The swap device is left in the plist until all its pages are
    used, and then removed from the plist when it becomes full.

    However, as described in man 2 swapon, swap must allocate pages from swap
    devices with the same priority in round-robin order; to do this, on each
    swap page allocation, swap uses a page from the first swap device in the
    plist, and then calls plist_requeue() to move that swap device entry to
    after any other same-priority swap devices. The next swap page allocation
    will again use a page from the first swap device in the plist and requeue
    it, and so on, resulting in round-robin usage of equal-priority swap
    devices.

    Also add plist_test_requeue() test function, for use by plist_test() to
    test plist_requeue() function.

    Signed-off-by: Dan Streetman
    Cc: Steven Rostedt
    Cc: Peter Zijlstra
    Acked-by: Mel Gorman
    Cc: Paul Gortmaker
    Cc: Thomas Gleixner
    Cc: Shaohua Li
    Cc: Hugh Dickins
    Cc: Dan Streetman
    Cc: Michal Hocko
    Cc: Christian Ehrhardt
    Cc: Weijie Yang
    Cc: Rik van Riel
    Cc: Johannes Weiner
    Cc: Bob Liu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Streetman
     
  • Replace places where __get_cpu_var() is used for an address calculation
    with this_cpu_ptr().

    Signed-off-by: Christoph Lameter
    Cc: Tejun Heo
    Cc: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     
  • The DMA Contiguous Memory Allocator support on x86 is disabled when
    swiotlb config option is enabled. So DMA CMA is always disabled on
    x86_64 because swiotlb is always enabled. This attempts to support for
    DMA CMA with enabling swiotlb config option.

    The contiguous memory allocator on x86 is integrated in the function
    dma_generic_alloc_coherent() which is .alloc callback in nommu_dma_ops
    for dma_alloc_coherent().

    x86_swiotlb_alloc_coherent() which is .alloc callback in swiotlb_dma_ops
    tries to allocate with dma_generic_alloc_coherent() firstly and then
    swiotlb_alloc_coherent() is called as a fallback.

    The main part of supporting DMA CMA with swiotlb is that changing
    x86_swiotlb_free_coherent() which is .free callback in swiotlb_dma_ops
    for dma_free_coherent() so that it can distinguish memory allocated by
    dma_generic_alloc_coherent() from one allocated by
    swiotlb_alloc_coherent() and release it with dma_generic_free_coherent()
    which can handle contiguous memory. This change requires making
    is_swiotlb_buffer() global function.

    This also needs to change .free callback in the dma_map_ops for amd_gart
    and sta2x11, because these dma_ops are also using
    dma_generic_alloc_coherent().

    Signed-off-by: Akinobu Mita
    Acked-by: Marek Szyprowski
    Acked-by: Konrad Rzeszutek Wilk
    Cc: David Woodhouse
    Cc: Don Dutile
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: Andi Kleen
    Cc: Yinghai Lu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • Introduce a CONFIG_DEBUG_VM_VMACACHE option to enable counting the cache
    hit rate -- exported in /proc/vmstat.

    Any updates to the caching scheme needs this kind of data, thus it can
    save some work re-implementing the counting all the time.

    Signed-off-by: Davidlohr Bueso
    Cc: Aswin Chandramouleeswaran
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Davidlohr Bueso
     
  • Direct conversion of one KERN_DEBUG message without DEBUG definition
    (suggested by Josh Triplett)

    That message will now be disabled by default. (see
    Documentation/CodingStyle Chapter 13)

    Signed-off-by: Fabian Frederick
    Reviewed-by: Josh Triplett
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • Add ODEBUG: prefix to pr_fmt

    Signed-off-by: Fabian Frederick
    Reviewed-by: Josh Triplett
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • Convert all printk to pr_foo() except KERN_DEBUG (see
    Documentation/CodingStyle Chapter 13)

    Signed-off-by: Fabian Frederick
    Reviewed-by: Josh Triplett
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • …/robh/linux into next

    Pull DeviceTree updates from Rob Herring:
    - Another round of clean-up of FDT related code in architecture code.
    This removes knowledge of internal FDT details from most
    architectures except powerpc.
    - Conversion of kernel's custom FDT parsing code to use libfdt.
    - DT based initialization for generic serial earlycon. The
    introduction of generic serial earlycon support went in through the
    tty tree.
    - Improve the platform device naming for DT probed devices to ensure
    unique naming and use parent names instead of a global index.
    - Fix a race condition in of_update_property.
    - Unify the various linker section OF match tables and fix several
    function prototype errors.
    - Update platform_get_irq_byname to work in deferred probe cases.
    - 2 binding doc updates

    * tag 'devicetree-for-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (58 commits)
    of: handle NULL node in next_child iterators
    of/irq: provide more wrappers for !CONFIG_OF
    devicetree: bindings: Document micrel vendor prefix
    dt: bindings: dwc2: fix required value for the phy-names property
    of_pci_irq: kill useless variable in of_irq_parse_pci()
    of/irq: do irq resolution in platform_get_irq_byname()
    of: Add a testcase for of_find_node_by_path()
    of: Make of_find_node_by_path() handle /aliases
    of: Create unlocked version of for_each_child_of_node()
    lib: add glibc style strchrnul() variant
    of: Handle memory@0 node on PPC32 only
    pci/of: Remove dead code
    of: fix race between search and remove in of_update_property()
    of: Use NULL for pointers
    of: Stop naming platform_device using dcr address
    of: Ensure unique names without sacrificing determinism
    tty/serial: pl011: add DT based earlycon support
    of/fdt: add FDT serial scanning for earlycon
    of/fdt: add FDT address translation support
    serial: earlycon: add DT support
    ...

    Linus Torvalds
     

04 Jun, 2014

1 commit

  • Pull trivial tree changes from Jiri Kosina:
    "Usual pile of patches from trivial tree that make the world go round"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (23 commits)
    staging: go7007: remove reference to CONFIG_KMOD
    aic7xxx: Remove obsolete preprocessor define
    of: dma: doc fixes
    doc: fix incorrect formula to calculate CommitLimit value
    doc: Note need of bc in the kernel build from 3.10 onwards
    mm: Fix printk typo in dmapool.c
    modpost: Fix comment typo "Modules.symvers"
    Kconfig.debug: Grammar s/addition/additional/
    wimax: Spelling s/than/that/, wording s/destinatary/recipient/
    aic7xxx: Spelling s/termnation/termination/
    arm64: mm: Remove superfluous "the" in comment
    of: Spelling s/anonymouns/anonymous/
    dma: imx-sdma: Spelling s/determnine/determine/
    ath10k: Improve grammar in comments
    ath6kl: Spelling s/determnine/determine/
    of: Improve grammar for of_alias_get_id() documentation
    drm/exynos: Spelling s/contro/control/
    radio-bcm2048.c: fix wrong overflow check
    doc: printk-formats: do not mention casts for u64/s64
    doc: spelling error changes
    ...

    Linus Torvalds
     

03 Jun, 2014

1 commit

  • Any process is able to send netlink messages with leftover bytes.
    Make the warning rate-limited to prevent too much log spam.

    The warning is supposed to help find userspace bugs, so print the
    triggering command name to implicate the buggy program.

    [v2: Use pr_warn_ratelimited instead of printk_ratelimited.]

    Signed-off-by: Michal Schmidt
    Signed-off-by: David S. Miller

    Michal Schmidt
     

24 May, 2014

2 commits


23 May, 2014

2 commits


06 May, 2014

1 commit