03 Apr, 2009

2 commits

  • Fix slab corruption caused by alloc_cpumask_var_node() overwriting the
    tail end of an off-stack cpumask.

    The function zeros out cpumask bits beyond the last possible cpu. The
    starting point for zeroing should be the beginning of the mask offset by a
    byte count derived from the number of possible cpus. The offset was
    calculated in bits instead of bytes. This resulted in overwriting the end
    of the cpumask.

    Signed-off-by: Jack Steiner
    Acked-by: Mike Travis
    Acked-by: Ingo Molnar
    Cc: Rusty Russell
    Cc: Stephen Rothwell
    Cc: [2.6.29.x]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jack Steiner
     
  • Patch for Per-CSS(Cgroup Subsys State) ID and private hierarchy code.

    This patch attaches unique ID to each css and provides following.

    - css_lookup(subsys, id)
    returns pointer to struct cgroup_subysys_state of id.
    - css_get_next(subsys, id, rootid, depth, foundid)
    returns the next css under "root" by scanning

    When cgroup_subsys->use_id is set, an id for css is maintained.

    The cgroup framework only parepares
    - css_id of root css for subsys
    - id is automatically attached at creation of css.
    - id is *not* freed automatically. Because the cgroup framework
    don't know lifetime of cgroup_subsys_state.
    free_css_id() function is provided. This must be called by subsys.

    There are several reasons to develop this.
    - Saving space .... For example, memcg's swap_cgroup is array of
    pointers to cgroup. But it is not necessary to be very fast.
    By replacing pointers(8bytes per ent) to ID (2byes per ent), we can
    reduce much amount of memory usage.

    - Scanning without lock.
    CSS_ID provides "scan id under this ROOT" function. By this, scanning
    css under root can be written without locks.
    ex)
    do {
    rcu_read_lock();
    next = cgroup_get_next(subsys, id, root, &found);
    /* check sanity of next here */
    css_tryget();
    rcu_read_unlock();
    id = found + 1
    } while(...)

    Characteristics:
    - Each css has unique ID under subsys.
    - Lifetime of ID is controlled by subsys.
    - css ID contains "ID" and "Depth in hierarchy" and stack of hierarchy
    - Allowed ID is 1-65535, ID 0 is UNUSED ID.

    Design Choices:
    - scan-by-ID v.s. scan-by-tree-walk.
    As /proc's pid scan does, scan-by-ID is robust when scanning is done
    by following kind of routine.
    scan -> rest a while(release a lock) -> conitunue from interrupted
    memcg's hierarchical reclaim does this.

    - When subsys->use_id is set, # of css in the system is limited to
    65535.

    [bharata@linux.vnet.ibm.com: remove rcu_read_lock() from css_get_next()]
    Signed-off-by: KAMEZAWA Hiroyuki
    Acked-by: Paul Menage
    Cc: Li Zefan
    Cc: Balbir Singh
    Cc: Daisuke Nishimura
    Signed-off-by: Bharata B Rao
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     

01 Apr, 2009

2 commits

  • Tfour 4 redundant if-conditions in function __rb_erase_color() in
    lib/rbtree.c are removed.

    In pseudo-source-code, the structure of the code is as follows:

    if ((!A || B) && (!C || D)) {
    .
    .
    .
    } else {
    if (!C || D) {//if this is true, it implies: (A == true) && (B == false)
    if (A) {//hence this always evaluates to 'true'...
    .
    }
    .
    //at this point, C always becomes true, because of:
    __rb_rotate_right/left();
    //and:
    other = parent->rb_right/left;
    }
    .
    .
    if (C) {//...and this too !
    .
    }
    }

    Signed-off-by: Wolfram Strepp
    Acked-by: Peter Zijlstra
    Cc: Andrea Arcangeli
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wolfram Strepp
     
  • CONFIG_DEBUG_PAGEALLOC is now supported by x86, powerpc, sparc64, and
    s390. This patch implements it for the rest of the architectures by
    filling the pages with poison byte patterns after free_pages() and
    verifying the poison patterns before alloc_pages().

    This generic one cannot detect invalid page accesses immediately but
    invalid read access may cause invalid dereference by poisoned memory and
    invalid write access can be detected after a long delay.

    Signed-off-by: Akinobu Mita
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     

31 Mar, 2009

2 commits

  • Fix printk format warnings in dma-debug:

    lib/dma-debug.c:645: warning: format '%016llx' expects type 'long long unsigned int', but argument 6 has type 'dma_addr_t'
    lib/dma-debug.c:662: warning: format '%016llx' expects type 'long long unsigned int', but argument 6 has type 'dma_addr_t'
    lib/dma-debug.c:676: warning: format '%016llx' expects type 'long long unsigned int', but argument 6 has type 'dma_addr_t'
    lib/dma-debug.c:686: warning: format '%016llx' expects type 'long long unsigned int', but argument 6 has type 'dma_addr_t'

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

    Randy Dunlap
     
  • * 'iommu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (60 commits)
    dma-debug: make memory range checks more consistent
    dma-debug: warn of unmapping an invalid dma address
    dma-debug: fix dma_debug_add_bus() definition for !CONFIG_DMA_API_DEBUG
    dma-debug/x86: register pci bus for dma-debug leak detection
    dma-debug: add a check dma memory leaks
    dma-debug: add checks for kernel text and rodata
    dma-debug: print stacktrace of mapping path on unmap error
    dma-debug: Documentation update
    dma-debug: x86 architecture bindings
    dma-debug: add function to dump dma mappings
    dma-debug: add checks for sync_single_sg_*
    dma-debug: add checks for sync_single_range_*
    dma-debug: add checks for sync_single_*
    dma-debug: add checking for [alloc|free]_coherent
    dma-debug: add add checking for map/unmap_sg
    dma-debug: add checking for map/unmap_page/single
    dma-debug: add core checking functions
    dma-debug: add debugfs interface
    dma-debug: add kernel command line parameters
    dma-debug: add initialization code
    ...

    Fix trivial conflicts due to whitespace changes in arch/x86/kernel/pci-nommu.c

    Linus Torvalds
     

30 Mar, 2009

1 commit


29 Mar, 2009

3 commits

  • Conflicts:
    arch/x86/Kconfig

    Ingo Molnar
     
  • * 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (422 commits)
    [ARM] 5435/1: fix compile warning in sanity_check_meminfo()
    [ARM] 5434/1: ARM: OMAP: Fix mailbox compile for 24xx
    [ARM] pxa: fix the bad assumption that PCMCIA sockets always start with 0
    [ARM] pxa: fix Colibri PXA300 and PXA320 LCD backlight pins
    imxfb: Fix TFT mode
    i.MX21/27: remove ifdef CONFIG_FB_IMX
    imxfb: add clock support
    mxc: add arch_reset() function
    clkdev: add possibility to get a clock based on the device name
    i.MX1: remove fb support from mach-imx
    [ARM] pxa: build arch/arm/plat-pxa/mfp.c only when PXA3xx or ARCH_MMP defined
    Gemini: Add support for Teltonika RUT100
    Gemini: gpiolib based GPIO support v2
    MAINTAINERS: add myself as Gemini architecture maintainer
    ARM: Add Gemini architecture v3
    [ARM] OMAP: Fix compile for omap2_init_common_hw()
    MAINTAINERS: Add myself as Faraday ARM core variant maintainer
    ARM: Add support for FA526 v2
    [ARM] acorn,ebsa110,footbridge,integrator,sa1100: Convert asm/io.h to linux/io.h
    [ARM] collie: fix two minor formatting nits
    ...

    Linus Torvalds
     
  • Conflicts:
    sound/soc/pxa/pxa2xx-i2s.c

    Russell King
     

28 Mar, 2009

2 commits


27 Mar, 2009

5 commits

  • David S. Miller
     
  • * 'sched-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (46 commits)
    sched: Add comments to find_busiest_group() function
    sched: Refactor the power savings balance code
    sched: Optimize the !power_savings_balance during fbg()
    sched: Create a helper function to calculate imbalance
    sched: Create helper to calculate small_imbalance in fbg()
    sched: Create a helper function to calculate sched_domain stats for fbg()
    sched: Define structure to store the sched_domain statistics for fbg()
    sched: Create a helper function to calculate sched_group stats for fbg()
    sched: Define structure to store the sched_group statistics for fbg()
    sched: Fix indentations in find_busiest_group() using gotos
    sched: Simple helper functions for find_busiest_group()
    sched: remove unused fields from struct rq
    sched: jiffies not printed per CPU
    sched: small optimisation of can_migrate_task()
    sched: fix typos in documentation
    sched: add avg_overlap decay
    x86, sched_clock(): mark variables read-mostly
    sched: optimize ttwu vs group scheduling
    sched: TIF_NEED_RESCHED -> need_reshed() cleanup
    sched: don't rebalance if attached on NULL domain
    ...

    Linus Torvalds
     
  • Conflicts:
    drivers/net/wimax/i2400m/usb-notif.c

    David S. Miller
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (61 commits)
    Dynamic debug: fix pr_fmt() build error
    Dynamic debug: allow simple quoting of words
    dynamic debug: update docs
    dynamic debug: combine dprintk and dynamic printk
    sysfs: fix some bin_vm_ops errors
    kobject: don't block for each kobject_uevent
    sysfs: only allow one scheduled removal callback per kobj
    Driver core: Fix device_move() vs. dpm list ordering, v2
    Driver core: some cleanup on drivers/base/sys.c
    Driver core: implement uevent suppress in kobject
    vcs: hook sysfs devices into object lifetime instead of "binding"
    driver core: fix passing platform_data
    driver core: move platform_data into platform_device
    sysfs: don't block indefinitely for unmapped files.
    driver core: move knode_bus into private structure
    driver core: move knode_driver into private structure
    driver core: move klist_children into private structure
    driver core: create a private portion of struct device
    driver core: remove polling for driver_probe_done(v5)
    sysfs: reference sysfs_dirent from sysfs inodes
    ...

    Fixed conflicts in drivers/sh/maple/maple.c manually

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (29 commits)
    crypto: sha512-s390 - Add missing block size
    hwrng: timeriomem - Breaks an allyesconfig build on s390:
    nlattr: Fix build error with NET off
    crypto: testmgr - add zlib test
    crypto: zlib - New zlib crypto module, using pcomp
    crypto: testmgr - Add support for the pcomp interface
    crypto: compress - Add pcomp interface
    netlink: Move netlink attribute parsing support to lib
    crypto: Fix dead links
    hwrng: timeriomem - New driver
    crypto: chainiv - Use kcrypto_wq instead of keventd_wq
    crypto: cryptd - Per-CPU thread implementation based on kcrypto_wq
    crypto: api - Use dedicated workqueue for crypto subsystem
    crypto: testmgr - Test skciphers with no IVs
    crypto: aead - Avoid infinite loop when nivaead fails selftest
    crypto: skcipher - Avoid infinite loop when cipher fails selftest
    crypto: api - Fix crypto_alloc_tfm/create_create_tfm return convention
    crypto: api - crypto_alg_mod_lookup either tested or untested
    crypto: amcc - Add crypt4xx driver
    crypto: ansi_cprng - Add maintainer
    ...

    Linus Torvalds
     

26 Mar, 2009

1 commit


25 Mar, 2009

6 commits

  • Allow simple quoting of words in the dynamic debug control language.

    This allows more natural specification when using the control language
    to match against printk formats, e.g

    #echo -n 'format "Setting node for non-present cpu" +p' >
    /mnt/debugfs/dynamic_debug/control

    instead of

    #echo -n 'format Setting\040node\040for\040non-present\040cpu +p' >
    /mnt/debugfs/dynamic_debug/control

    Adjust the dynamic debug documention to describe that and provide a
    new example. Adjust the existing examples in the documentation to
    reflect the current whitespace escaping behaviour when reading the
    control file. Fix some minor documentation trailing whitespace.

    Signed-off-by: Greg Banks
    Acked-by: Jason Baron
    Signed-off-by: Greg Kroah-Hartman

    Greg Banks
     
  • updates the documentation for 'dynamic debug' feature.

    Signed-off-by: Greg Banks
    Signed-off-by: Jason Baron
    Signed-off-by: Greg Kroah-Hartman

    Jason Baron
     
  • This patch combines Greg Bank's dprintk() work with the existing dynamic
    printk patchset, we are now calling it 'dynamic debug'.

    The new feature of this patchset is a richer /debugfs control file interface,
    (an example output from my system is at the bottom), which allows fined grained
    control over the the debug output. The output can be controlled by function,
    file, module, format string, and line number.

    for example, enabled all debug messages in module 'nf_conntrack':

    echo -n 'module nf_conntrack +p' > /mnt/debugfs/dynamic_debug/control

    to disable them:

    echo -n 'module nf_conntrack -p' > /mnt/debugfs/dynamic_debug/control

    A further explanation can be found in the documentation patch.

    Signed-off-by: Greg Banks
    Signed-off-by: Jason Baron
    Signed-off-by: Greg Kroah-Hartman

    Jason Baron
     
  • Right now, the kobject_uevent code blocks for each uevent that's being
    generated, due to using (for hystoric reasons) UHM_WAIT_EXEC as flag to
    call_usermode_helper(). Specifically, the effect is that each uevent
    that is being sent causes the code to wake up keventd, then block until
    keventd has processed the work. Needless to say, this happens many times
    during the system boot.

    This patches changes that to UHN_NO_WAIT (brilliant name for a constant
    btw) so that we only schedule the work to fire the uevent message, but
    do not wait for keventd to process the work.

    This removes one of the bottlenecks during boot; each one of them is
    only a small effect, but the sum of them does add up.

    [Note, distros that need this are broken, they should be setting
    CONFIG_UEVENT_HELPER_PATH to "", that way this code path will never be
    excuted at all -- gregkh]

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Greg Kroah-Hartman

    Arjan van de Ven
     
  • This patch implements uevent suppress in kobject and removes it
    from struct device, based on the following ideas:

    1,Uevent sending should be one attribute of kobject, so suppressing it
    in kobject layer is more natural than in device layer. By this way,
    we can do it for other objects embedded with kobject.

    2,It may save several bytes for each instance of struct device.(On my
    omap3(32bit ARM) based box, can save 8bytes per device object)

    This patch also introduces dev_set|get_uevent_suppress() helpers to
    set and query uevent_suppress attribute in case to help kobject
    as private part of struct device in future.

    [This version is against the latest driver-core patch set of Greg,please
    ignore the last version.]

    Signed-off-by: Ming Lei
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     
  • Now that all users of bus_id is gone, we can remove it from struct
    device.

    Signed-off-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     

24 Mar, 2009

2 commits


19 Mar, 2009

1 commit


18 Mar, 2009

3 commits


17 Mar, 2009

4 commits


14 Mar, 2009

1 commit


13 Mar, 2009

2 commits


11 Mar, 2009

3 commits

  • We moved the netlink attribute support from net to lib in order
    for it to be available for general consumption. However, parts
    of the code (the bits that we don't need :) really depends on
    NET because the target object is sk_buff.

    This patch fixes this by wrapping them in CONFIG_NET.

    Some EXPORTs have been moved to make this work.

    Tested-by: Geert Uytterhoeven
    Signed-off-by: Herbert Xu

    Herbert Xu
     
  • Benjamin Herrenschmidt
     
  • Fix a problem in the IDR system, where an idr_remove_all() hands a data
    element to call_rcu() (via free_layer()) before making that data element
    inaccessible to new readers. This is very bad, and results in readers
    still having a reference to this data element at the end of the grace
    period.

    Tests on large machines that concurrently map and unmap user-space memory
    within the same multithreaded process result in crashes within about five
    minutes. Applying this patch increases the kernel's longevity to the
    three-to-eight-hour range.

    There appear to be other similar problems in idr_get_empty_slot() and
    sub_remove(), but I fixed the easy one in idr_remove_all() first. It is
    therefore no surprise that failures still occur.

    Located-by: Milton Miller II
    Tested-by: Milton Miller II
    Signed-off-by: Paul E. McKenney
    Cc: Manfred Spraul
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul E. McKenney