04 Mar, 2014

2 commits

  • Running fsx on tmpfs with concurrent memhog-swapoff-swapon, lots of

    BUG: sleeping function called from invalid context at kernel/fork.c:606
    in_atomic(): 0, irqs_disabled(): 0, pid: 1394, name: swapoff
    1 lock held by swapoff/1394:
    #0: (rcu_read_lock){.+.+.+}, at: [] radix_tree_locate_item+0x1f/0x2b6

    followed by

    ================================================
    [ BUG: lock held when returning to user space! ]
    3.14.0-rc1 #3 Not tainted
    ------------------------------------------------
    swapoff/1394 is leaving the kernel with locks still held!
    1 lock held by swapoff/1394:
    #0: (rcu_read_lock){.+.+.+}, at: [] radix_tree_locate_item+0x1f/0x2b6

    after which the system recovered nicely.

    Whoops, I long ago forgot the rcu_read_unlock() on one unlikely branch.

    Fixes e504f3fdd63d ("tmpfs radix_tree: locate_item to speed up swapoff")

    Signed-off-by: Hugh Dickins
    Cc: Johannes Weiner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • While debug_dma_assert_idle() checks if a given *page* is actively
    undergoing dma the valid granularity of a dma mapping is a *cacheline*.
    Sander's testing shows that the warning message "DMA-API: exceeded 7
    overlapping mappings of pfn..." is falsely triggering. The test is
    simply mapping multiple cachelines in a given page.

    Ultimately we want overlap tracking to be valid as it is a real api
    violation, so we need to track active mappings by cachelines. Update
    the active dma tracking to use the page-frame-relative cacheline of the
    mapping as the key, and update debug_dma_assert_idle() to check for all
    possible mapped cachelines for a given page.

    However, the need to track active mappings is only relevant when the
    dma-mapping is writable by the device. In fact it is fairly standard
    for read-only mappings to have hundreds or thousands of overlapping
    mappings at once. Limiting the overlap tracking to writable
    (!DMA_TO_DEVICE) eliminates this class of false-positive overlap
    reports.

    Note, the radix gang lookup is sub-optimal. It would be best if it
    stopped fetching entries once the search passed a page boundary.
    Nevertheless, this implementation does not perturb the original net_dma
    failing case. That is to say the extra overhead does not show up in
    terms of making the failing case pass due to a timing change.

    References:
    http://marc.info/?l=linux-netdev&m=139232263419315&w=2
    http://marc.info/?l=linux-netdev&m=139217088107122&w=2

    Signed-off-by: Dan Williams
    Reported-by: Sander Eikelenboom
    Reported-by: Dave Jones
    Tested-by: Dave Jones
    Tested-by: Sander Eikelenboom
    Cc: Konrad Rzeszutek Wilk
    Cc: Francois Romieu
    Cc: Eric Dumazet
    Cc: Wei Liu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Williams
     

15 Feb, 2014

1 commit

  • Pull block IO fixes from Jens Axboe:
    "Second round of updates and fixes for 3.14-rc2. Most of this stuff
    has been queued up for a while. The notable exception is the blk-mq
    changes, which are naturally a bit more in flux still.

    The pull request contains:

    - Two bug fixes for the new immutable vecs, causing crashes with raid
    or swap. From Kent.

    - Various blk-mq tweaks and fixes from Christoph. A fix for
    integrity bio's from Nic.

    - A few bcache fixes from Kent and Darrick Wong.

    - xen-blk{front,back} fixes from David Vrabel, Matt Rushton, Nicolas
    Swenson, and Roger Pau Monne.

    - Fix for a vec miscount with integrity vectors from Martin.

    - Minor annotations or fixes from Masanari Iida and Rashika Kheria.

    - Tweak to null_blk to do more normal FIFO processing of requests
    from Shlomo Pongratz.

    - Elevator switching bypass fix from Tejun.

    - Softlockup in blkdev_issue_discard() fix when !CONFIG_PREEMPT from
    me"

    * 'for-linus' of git://git.kernel.dk/linux-block: (31 commits)
    block: add cond_resched() to potentially long running ioctl discard loop
    xen-blkback: init persistent_purge_work work_struct
    blk-mq: pair blk_mq_start_request / blk_mq_requeue_request
    blk-mq: dont assume rq->errors is set when returning an error from ->queue_rq
    block: Fix cloning of discard/write same bios
    block: Fix type mismatch in ssize_t_blk_mq_tag_sysfs_show
    blk-mq: rework flush sequencing logic
    null_blk: use blk_complete_request and blk_mq_complete_request
    virtio_blk: use blk_mq_complete_request
    blk-mq: rework I/O completions
    fs: Add prototype declaration to appropriate header file include/linux/bio.h
    fs: Mark function as static in fs/bio-integrity.c
    block/null_blk: Fix completion processing from LIFO to FIFO
    block: Explicitly handle discard/write same segments
    block: Fix nr_vecs for inline integrity vectors
    blk-mq: Add bio_integrity setup to blk_mq_make_request
    blk-mq: initialize sg_reserved_size
    blk-mq: handle dma_drain_size
    blk-mq: divert __blk_put_request for MQ ops
    blk-mq: support at_head inserations for blk_execute_rq
    ...

    Linus Torvalds
     

09 Feb, 2014

1 commit

  • Pull x86 fixes from Peter Anvin:
    "Quite a varied little collection of fixes. Most of them are
    relatively small or isolated; the biggest one is Mel Gorman's fixes
    for TLB range flushing.

    A couple of AMD-related fixes (including not crashing when given an
    invalid microcode image) and fix a crash when compiled with gcov"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86, microcode, AMD: Unify valid container checks
    x86, hweight: Fix BUG when booting with CONFIG_GCOV_PROFILE_ALL=y
    x86/efi: Allow mapping BGRT on x86-32
    x86: Fix the initialization of physnode_map
    x86, cpu hotplug: Fix stack frame warning in check_irq_vectors_for_cpu_disable()
    x86/intel/mid: Fix X86_INTEL_MID dependencies
    arch/x86/mm/srat: Skip NUMA_NO_NODE while parsing SLIT
    mm, x86: Revisit tlb_flushall_shift tuning for page flushes except on IvyBridge
    x86: mm: change tlb_flushall_shift for IvyBridge
    x86/mm: Eliminate redundant page table walk during TLB range flushing
    x86/mm: Clean up inconsistencies when flushing TLB ranges
    mm, x86: Account for TLB flushes only when debugging
    x86/AMD/NB: Fix amd_set_subcaches() parameter type
    x86/quirks: Add workaround for AMD F16h Erratum792
    x86, doc, kconfig: Fix dud URL for Microcode data

    Linus Torvalds
     

08 Feb, 2014

1 commit


06 Feb, 2014

1 commit

  • Commit d61931d89b, "x86: Add optimized popcnt variants" introduced
    compile flag -fcall-saved-rdi for lib/hweight.c. When combined with
    options -fprofile-arcs and -O2, this flag causes gcc to generate
    broken constructor code. As a result, a 64 bit x86 kernel compiled
    with CONFIG_GCOV_PROFILE_ALL=y prints message "gcov: could not create
    file" and runs into sproadic BUGs during boot.

    The gcc people indicate that these kinds of problems are endemic when
    using ad hoc calling conventions. It is therefore best to treat any
    file compiled with ad hoc calling conventions as an isolated
    environment and avoid things like profiling or coverage analysis,
    since those subsystems assume a "normal" calling conventions.

    This patch avoids the bug by excluding lib/hweight.o from coverage
    profiling.

    Reported-by: Meelis Roos
    Cc: Andrew Morton
    Signed-off-by: Peter Oberparleiter
    Link: http://lkml.kernel.org/r/52F3A30C.7050205@linux.vnet.ibm.com
    Signed-off-by: H. Peter Anvin
    Cc:

    Peter Oberparleiter
     

05 Feb, 2014

1 commit

  • It really isn't very interesting to have DEBUG_INFO when doing compile
    coverage stuff (you wouldn't want to run the result anyway, that's kind
    of the whole point of COMPILE_TEST), and it currently makes the build
    take longer and use much more disk space for "all{yes,mod}config".

    There's somewhat active discussion about this still, and we might end up
    with some new config option for things like this (Andi points out that
    the silly X86_DECODER_SELFTEST option also slows down the normal
    coverage tests hugely), but I'm starting the ball rolling with this
    simple one-liner.

    DEBUG_INFO isn't that noticeable if you have tons of memory and a good
    IO subsystem, but it hurts you a lot if you don't - for very little
    upside for the common use.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

03 Feb, 2014

1 commit

  • The built-in ROM fonts lack many necessary ASCII characters, which is
    why it makes sens to prefer the Linux fonts instead if they are
    available. This makes consoles on STI graphics cards which are not
    supported by the stifb driver (e.g. Visualize FXe) looks much nicer.

    Signed-off-by: Helge Deller
    Cc: stable@vger.kernel.org # v3.13

    Helge Deller
     

01 Feb, 2014

1 commit

  • Pull SCSI target updates from Nicholas Bellinger:
    "The highlights this round include:

    - add support for SCSI Referrals (Hannes)
    - add support for T10 DIF into target core (nab + mkp)
    - add support for T10 DIF emulation in FILEIO + RAMDISK backends (Sagi + nab)
    - add support for T10 DIF -> bio_integrity passthrough in IBLOCK backend (nab)
    - prep changes to iser-target for >= v3.15 T10 DIF support (Sagi)
    - add support for qla2xxx N_Port ID Virtualization - NPIV (Saurav + Quinn)
    - allow percpu_ida_alloc() to receive task state bitmask (Kent)
    - fix >= v3.12 iscsi-target session reset hung task regression (nab)
    - fix >= v3.13 percpu_ref se_lun->lun_ref_active race (nab)
    - fix a long-standing network portal creation race (Andy)"

    * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (51 commits)
    target: Fix percpu_ref_put race in transport_lun_remove_cmd
    target/iscsi: Fix network portal creation race
    target: Report bad sector in sense data for DIF errors
    iscsi-target: Convert gfp_t parameter to task state bitmask
    iscsi-target: Fix connection reset hang with percpu_ida_alloc
    percpu_ida: Make percpu_ida_alloc + callers accept task state bitmask
    iscsi-target: Pre-allocate more tags to avoid ack starvation
    qla2xxx: Configure NPIV fc_vport via tcm_qla2xxx_npiv_make_lport
    qla2xxx: Enhancements to enable NPIV support for QLOGIC ISPs with TCM/LIO.
    qla2xxx: Fix scsi_host leak on qlt_lport_register callback failure
    IB/isert: pass scatterlist instead of cmd to fast_reg_mr routine
    IB/isert: Move fastreg descriptor creation to a function
    IB/isert: Avoid frwr notation, user fastreg
    IB/isert: seperate connection protection domains and dma MRs
    tcm_loop: Enable DIF/DIX modes in SCSI host LLD
    target/rd: Add DIF protection into rd_execute_rw
    target/rd: Add support for protection SGL setup + release
    target/rd: Refactor rd_build_device_space + rd_release_device_space
    target/file: Add DIF protection support to fd_execute_rw
    target/file: Add DIF protection init/format support
    ...

    Linus Torvalds
     

31 Jan, 2014

2 commits

  • Pull btrfs updates from Chris Mason:
    "This is a pretty big pull, and most of these changes have been
    floating in btrfs-next for a long time. Filipe's properties work is a
    cool building block for inheriting attributes like compression down on
    a per inode basis.

    Jeff Mahoney kicked in code to export filesystem info into sysfs.

    Otherwise, lots of performance improvements, cleanups and bug fixes.

    Looks like there are still a few other small pending incrementals, but
    I wanted to get the bulk of this in first"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (149 commits)
    Btrfs: fix spin_unlock in check_ref_cleanup
    Btrfs: setup inode location during btrfs_init_inode_locked
    Btrfs: don't use ram_bytes for uncompressed inline items
    Btrfs: fix btrfs_search_slot_for_read backwards iteration
    Btrfs: do not export ulist functions
    Btrfs: rework ulist with list+rb_tree
    Btrfs: fix memory leaks on walking backrefs failure
    Btrfs: fix send file hole detection leading to data corruption
    Btrfs: add a reschedule point in btrfs_find_all_roots()
    Btrfs: make send's file extent item search more efficient
    Btrfs: fix to catch all errors when resolving indirect ref
    Btrfs: fix protection between walking backrefs and root deletion
    btrfs: fix warning while merging two adjacent extents
    Btrfs: fix infinite path build loops in incremental send
    btrfs: undo sysfs when open_ctree() fails
    Btrfs: fix snprintf usage by send's gen_unique_name
    btrfs: fix defrag 32-bit integer overflow
    btrfs: sysfs: list the NO_HOLES feature
    btrfs: sysfs: don't show reserved incompat feature
    btrfs: call permission checks earlier in ioctls and return EPERM
    ...

    Linus Torvalds
     
  • steal_tags only happens when free tags is more than half of the total
    tags. This is too strict and can cause live lock. I found that if one
    cpu has free tags, but other cpu can't steal (thread is bound to
    specific cpus), threads which want to allocate tags are always
    sleeping. I found this when I run next patch, but this could happen
    without it I think.

    I did performance test too with null_blk. Two cases (each cpu has enough
    percpu tags, or total tags are limited), no performance changes were
    observed.

    Signed-off-by: Shaohua Li
    Signed-off-by: Jens Axboe

    Shaohua Li
     

30 Jan, 2014

2 commits

  • Commit 0abdd7a81b7e ("dma-debug: introduce debug_dma_assert_idle()") was
    reworked to expand the overlap counter to the full range expressable by
    3 tag bits, but it has a thinko in treating the overlap counter as a
    pure reference count for the entry.

    Instead of deleting when the reference-count drops to zero, we need to
    delete when the overlap-count drops below zero. Also, when detecting
    overflow we can just test the overlap-count > MAX rather than applying
    special meaning to 0.

    Regression report available here:
    http://marc.info/?l=linux-netdev&m=139073373932386&w=2

    This patch, now tested on the original net_dma case, sees the expected
    handful of reports before the eventual data corruption occurs.

    Signed-off-by: Dan Williams
    Reported-by: Sander Eikelenboom
    Cc: Francois Romieu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Williams
     
  • In the gen_pool_dma_alloc() the dma pointer can be NULL and while
    assigning gen_pool_virt_to_phys(pool, vaddr) to dma caused the following
    crash on da850 evm:

    Unable to handle kernel NULL pointer dereference at virtual address 00000000
    Internal error: Oops: 805 [#1] PREEMPT ARM
    Modules linked in:
    CPU: 0 PID: 1 Comm: swapper Tainted: G W 3.13.0-rc1-00001-g0609e45-dirty #5
    task: c4830000 ti: c4832000 task.ti: c4832000
    PC is at gen_pool_dma_alloc+0x30/0x3c
    LR is at gen_pool_virt_to_phys+0x74/0x80
    Process swapper, call trace:
    gen_pool_dma_alloc+0x30/0x3c
    davinci_pm_probe+0x40/0xa8
    platform_drv_probe+0x1c/0x4c
    driver_probe_device+0x98/0x22c
    __driver_attach+0x8c/0x90
    bus_for_each_dev+0x6c/0x8c
    bus_add_driver+0x124/0x1d4
    driver_register+0x78/0xf8
    platform_driver_probe+0x20/0xa4
    davinci_init_late+0xc/0x14
    init_machine_late+0x1c/0x28
    do_one_initcall+0x34/0x15c
    kernel_init_freeable+0xe4/0x1ac
    kernel_init+0x8/0xec

    This patch fixes the above.

    [akpm@linux-foundation.org: update kerneldoc]
    Signed-off-by: Lad, Prabhakar
    Cc: Philipp Zabel
    Cc: Nicolin Chen
    Cc: Joe Perches
    Cc: Sachin Kamat
    Cc: [3.13.x]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lad, Prabhakar
     

29 Jan, 2014

1 commit

  • struct kobj_attribute implements the baseline attribute functionality
    that can be used all over the place. We should export the ops associated
    with it.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Josef Bacik
    Signed-off-by: Chris Mason

    Jeff Mahoney
     

28 Jan, 2014

6 commits


26 Jan, 2014

1 commit

  • Pull networking updates from David Miller:

    1) BPF debugger and asm tool by Daniel Borkmann.

    2) Speed up create/bind in AF_PACKET, also from Daniel Borkmann.

    3) Correct reciprocal_divide and update users, from Hannes Frederic
    Sowa and Daniel Borkmann.

    4) Currently we only have a "set" operation for the hw timestamp socket
    ioctl, add a "get" operation to match. From Ben Hutchings.

    5) Add better trace events for debugging driver datapath problems, also
    from Ben Hutchings.

    6) Implement auto corking in TCP, from Eric Dumazet. Basically, if we
    have a small send and a previous packet is already in the qdisc or
    device queue, defer until TX completion or we get more data.

    7) Allow userspace to manage ipv6 temporary addresses, from Jiri Pirko.

    8) Add a qdisc bypass option for AF_PACKET sockets, from Daniel
    Borkmann.

    9) Share IP header compression code between Bluetooth and IEEE802154
    layers, from Jukka Rissanen.

    10) Fix ipv6 router reachability probing, from Jiri Benc.

    11) Allow packets to be captured on macvtap devices, from Vlad Yasevich.

    12) Support tunneling in GRO layer, from Jerry Chu.

    13) Allow bonding to be configured fully using netlink, from Scott
    Feldman.

    14) Allow AF_PACKET users to obtain the VLAN TPID, just like they can
    already get the TCI. From Atzm Watanabe.

    15) New "Heavy Hitter" qdisc, from Terry Lam.

    16) Significantly improve the IPSEC support in pktgen, from Fan Du.

    17) Allow ipv4 tunnels to cache routes, just like sockets. From Tom
    Herbert.

    18) Add Proportional Integral Enhanced packet scheduler, from Vijay
    Subramanian.

    19) Allow openvswitch to mmap'd netlink, from Thomas Graf.

    20) Key TCP metrics blobs also by source address, not just destination
    address. From Christoph Paasch.

    21) Support 10G in generic phylib. From Andy Fleming.

    22) Try to short-circuit GRO flow compares using device provided RX
    hash, if provided. From Tom Herbert.

    The wireless and netfilter folks have been busy little bees too.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (2064 commits)
    net/cxgb4: Fix referencing freed adapter
    ipv6: reallocate addrconf router for ipv6 address when lo device up
    fib_frontend: fix possible NULL pointer dereference
    rtnetlink: remove IFLA_BOND_SLAVE definition
    rtnetlink: remove check for fill_slave_info in rtnl_have_link_slave_info
    qlcnic: update version to 5.3.55
    qlcnic: Enhance logic to calculate msix vectors.
    qlcnic: Refactor interrupt coalescing code for all adapters.
    qlcnic: Update poll controller code path
    qlcnic: Interrupt code cleanup
    qlcnic: Enhance Tx timeout debugging.
    qlcnic: Use bool for rx_mac_learn.
    bonding: fix u64 division
    rtnetlink: add missing IFLA_BOND_AD_INFO_UNSPEC
    sfc: Use the correct maximum TX DMA ring size for SFC9100
    Add Shradha Shah as the sfc driver maintainer.
    net/vxlan: Share RX skb de-marking and checksum checks with ovs
    tulip: cleanup by using ARRAY_SIZE()
    ip_tunnel: clear IPCB in ip_tunnel_xmit() in case dst_link_failure() is called
    net/cxgb4: Don't retrieve stats during recovery
    ...

    Linus Torvalds
     

25 Jan, 2014

1 commit

  • This patch addresses a bug where connection reset would hang
    indefinately once percpu_ida_alloc() was starved for tags, due
    to the fact that it always assumed uninterruptible sleep mode.

    So now make percpu_ida_alloc() check for signal_pending_state() for
    making interruptible sleep optional, and convert iscsit_allocate_cmd()
    to set TASK_INTERRUPTIBLE for GFP_KERNEL, or TASK_RUNNING for
    GFP_ATOMIC.

    Reported-by: Linus Torvalds
    Cc: Kent Overstreet
    Cc: #3.12+
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     

24 Jan, 2014

14 commits

  • "ret", being set to -1 early on, gets cleared by the first invocation of
    lz4_decompress()/lz4_decompress_unknownoutputsize(), and hence subsequent
    failures wouldn't be noticed by the caller without setting it back to -1
    right after those calls.

    Reported-by: Matthew Daley
    Signed-off-by: Jan Beulich
    Cc: Kyungsik Lee
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Beulich
     
  • Signed-off-by: Cody P Schafer
    Cc: Michel Lespinasse
    Cc: Jan Kara
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Cody P Schafer
     
  • Avoid making the rb_node the first entry to catch some bugs around NULL
    checking the rb_node.

    Signed-off-by: Cody P Schafer
    Cc: Michel Lespinasse
    Cc: Jan Kara
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Cody P Schafer
     
  • To help avoid an architecture failing to correctly check kernel/user
    boundaries when handling copy_to_user, copy_from_user, put_user, or
    get_user, perform some simple tests and fail to load if any of them
    behave unexpectedly.

    Specifically, this is to make sure there is a way to notice if things
    like what was fixed in commit 8404663f81d2 ("ARM: 7527/1: uaccess:
    explicitly check __user pointer when !CPU_USE_DOMAINS") ever regresses
    again, for any architecture.

    Additionally, adds new "user" selftest target, which loads this module.

    Signed-off-by: Kees Cook
    Cc: Rusty Russell
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kees Cook
     
  • This is a pair of test modules I'd like to see in the tree. Instead of
    putting these in lkdtm, where I've been adding various tests that trigger
    crashes, these don't make sense there since they need to be either
    distinctly separate, or their pass/fail state don't need to crash the
    machine.

    These live in lib/ for now, along with a few other in-kernel test modules,
    and use the slightly more common "test_" naming convention, instead of
    "test-". We should likely standardize on the former:

    $ find . -name 'test_*.c' | grep -v /tools/ | wc -l
    4
    $ find . -name 'test-*.c' | grep -v /tools/ | wc -l
    2

    The first is entirely a no-op module, designed to allow simple testing of
    the module loading and verification interface. It's useful to have a
    module that has no other uses or dependencies so it can be reliably used
    for just testing module loading and verification.

    The second is a module that exercises the user memory access functions, in
    an effort to make sure that we can quickly catch any regressions in
    boundary checking (e.g. like what was recently fixed on ARM).

    This patch (of 2):

    When doing module loading verification tests (for example, with module
    signing, or LSM hooks), it is very handy to have a module that can be
    built on all systems under test, isn't auto-loaded at boot, and has no
    device or similar dependencies. This creates the "test_module.ko" module
    for that purpose, which only reports its load and unload to printk.

    Signed-off-by: Kees Cook
    Acked-by: Rusty Russell
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kees Cook
     
  • WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
    +EXPORT_SYMBOL(memparse);

    WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
    +EXPORT_SYMBOL(get_option);

    WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
    +EXPORT_SYMBOL(get_options);

    Signed-off-by: Felipe Contreras
    Cc: Levente Kurusa
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Felipe Contreras
     
  • WARNING: space prohibited between function name and open parenthesis '('
    +int get_option (char **str, int *pint)

    WARNING: space prohibited between function name and open parenthesis '('
    + *pint = simple_strtol (cur, str, 0);

    ERROR: trailing whitespace
    + $

    WARNING: please, no spaces at the start of a line
    + $

    WARNING: space prohibited between function name and open parenthesis '('
    + res = get_option ((char **)&str, ints + i);

    Signed-off-by: Felipe Contreras
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Felipe Contreras
     
  • We can't reach the cleanup code unless the flag KSTRTOX_OVERFLOW is not
    set, so there's not no point in clearing a bit that we know is not set.

    Signed-off-by: Felipe Contreras
    Acked-by: Levente Kurusa
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Felipe Contreras
     
  • dma_addr_t's can be either u32 or u64 depending on a CONFIG option.

    There are a few hundred dma_addr_t's printed via either cast to unsigned
    long long, unsigned long or no cast at all.

    Add %pad to be able to emit them without the cast.

    Update Documentation/printk-formats.txt too.

    Signed-off-by: Joe Perches
    Cc: "Shevchenko, Andriy"
    Cc: Rob Landley
    Cc: Laurent Pinchart
    Cc: Julia Lawall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Add wildcard '*'(matches zero or more characters) and '?' (matches one
    character) support when qurying debug flags.

    Now we can open debug messages using keywords. eg:
    1. open debug logs in all usb drivers
    echo "file drivers/usb/* +p" > /dynamic_debug/control
    2. open debug logs for usb xhci code
    echo "file *xhci* +p" > /dynamic_debug/control

    Signed-off-by: Du, Changbin
    Cc: Jason Baron
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Du, Changbin
     
  • Cc: Du, Changbin
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • match_wildcard function is a simple implementation of wildcard
    matching algorithm. It only supports two usual wildcardes:
    '*' - matches zero or more characters
    '?' - matches one character
    This algorithm is safe since it is non-recursive.

    Signed-off-by: Du, Changbin
    Cc: Jason Baron
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Du, Changbin
     
  • This patch changes percpu_ida_alloc() + callers to accept task state
    bitmask for prepare_to_wait() for code like target/iscsi that needs
    it for interruptible sleep, that is provided in a subsequent patch.

    It now expects TASK_UNINTERRUPTIBLE when the caller is able to sleep
    waiting for a new tag, or TASK_RUNNING when the caller cannot sleep,
    and is forced to return a negative value when no tags are available.

    v2 changes:
    - Include blk-mq + tcm_fc + vhost/scsi + target/iscsi changes
    - Drop signal_pending_state() call
    v3 changes:
    - Only call prepare_to_wait() + finish_wait() when != TASK_RUNNING
    (PeterZ)

    Reported-by: Linus Torvalds
    Cc: Linus Torvalds
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Jens Axboe
    Signed-off-by: Kent Overstreet
    Cc: #3.12+
    Signed-off-by: Nicholas Bellinger

    Kent Overstreet
     
  • The associative array code creates unnecessary and potentially
    problematic global variable 'status'. Remove it since never used.

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

    Stephen Hemminger
     

22 Jan, 2014

4 commits

  • Jakub Zawadzki noticed that some divisions by reciprocal_divide()
    were not correct [1][2], which he could also show with BPF code
    after divisions are transformed into reciprocal_value() for runtime
    invariance which can be passed to reciprocal_divide() later on;
    reverse in BPF dump ended up with a different, off-by-one K in
    some situations.

    This has been fixed by Eric Dumazet in commit aee636c4809fa5
    ("bpf: do not use reciprocal divide"). This follow-up patch
    improves reciprocal_value() and reciprocal_divide() to work in
    all cases by using Granlund and Montgomery method, so that also
    future use is safe and without any non-obvious side-effects.
    Known problems with the old implementation were that division by 1
    always returned 0 and some off-by-ones when the dividend and divisor
    where very large. This seemed to not be problematic with its
    current users, as far as we can tell. Eric Dumazet checked for
    the slab usage, we cannot surely say so in the case of flex_array.
    Still, in order to fix that, we propose an extension from the
    original implementation from commit 6a2d7a955d8d resp. [3][4],
    by using the algorithm proposed in "Division by Invariant Integers
    Using Multiplication" [5], Torbjörn Granlund and Peter L.
    Montgomery, that is, pseudocode for q = n/d where q, n, d is in
    u32 universe:

    1) Initialization:

    int l = ceil(log_2 d)
    uword m' = floor((1<<
    Cc: Eric Dumazet
    Cc: Austin S Hemmelgarn
    Cc: linux-kernel@vger.kernel.org
    Cc: Jesse Gross
    Cc: Jamal Hadi Salim
    Cc: Stephen Hemminger
    Cc: Matt Mackall
    Cc: Pekka Enberg
    Cc: Christoph Lameter
    Cc: Andy Gospodarek
    Cc: Veaceslav Falico
    Cc: Jay Vosburgh
    Cc: Jakub Zawadzki
    Signed-off-by: Daniel Borkmann
    Signed-off-by: Hannes Frederic Sowa
    Signed-off-by: David S. Miller

    Hannes Frederic Sowa
     
  • Merge first patch-bomb from Andrew Morton:

    - a couple of misc things

    - inotify/fsnotify work from Jan

    - ocfs2 updates (partial)

    - about half of MM

    * emailed patches from Andrew Morton : (117 commits)
    mm/migrate: remove unused function, fail_migrate_page()
    mm/migrate: remove putback_lru_pages, fix comment on putback_movable_pages
    mm/migrate: correct failure handling if !hugepage_migration_support()
    mm/migrate: add comment about permanent failure path
    mm, page_alloc: warn for non-blockable __GFP_NOFAIL allocation failure
    mm: compaction: reset scanner positions immediately when they meet
    mm: compaction: do not mark unmovable pageblocks as skipped in async compaction
    mm: compaction: detect when scanners meet in isolate_freepages
    mm: compaction: reset cached scanner pfn's before reading them
    mm: compaction: encapsulate defer reset logic
    mm: compaction: trace compaction begin and end
    memcg, oom: lock mem_cgroup_print_oom_info
    sched: add tracepoints related to NUMA task migration
    mm: numa: do not automatically migrate KSM pages
    mm: numa: trace tasks that fail migration due to rate limiting
    mm: numa: limit scope of lock for NUMA migrate rate limiting
    mm: numa: make NUMA-migrate related functions static
    lib/show_mem.c: show num_poisoned_pages when oom
    mm/hwpoison: add '#' to hwpoison_inject
    mm/memblock: use WARN_ONCE when MAX_NUMNODES passed as input parameter
    ...

    Linus Torvalds
     
  • Pull percpu changes from Tejun Heo:
    "Two trivial changes - addition of WARN_ONCE() in lib/percpu-refcount.c
    and use of VMALLOC_TOTAL instead of END - START in percpu.c"

    * 'for-3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu:
    percpu: use VMALLOC_TOTAL instead of VMALLOC_END - VMALLOC_START
    percpu-refcount: Add a WARN() for ref going negative

    Linus Torvalds
     
  • Show num_poisoned_pages when oom, it is a little helpful to find the
    reason. Also it will be emitted anytime show_mem() is called.

    Signed-off-by: Xishi Qiu
    Suggested-by: Naoya Horiguchi
    Acked-by: Michal Hocko
    Acked-by: David Rientjes
    Reviewed-by: Wanpeng Li
    Acked-by: KOSAKI Motohiro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Xishi Qiu