11 Aug, 2010

19 commits

  • Fix kernel-doc warnings in linux/usb.h:

    Warning(include/linux/usb.h:185): No description found for parameter 'resetting_device'
    Warning(include/linux/usb.h:1212): No description found for parameter 'stream_id'

    Signed-off-by: Randy Dunlap
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     
  • The Logitech Harmony 700 series needs an extra delay during
    initialization. This patch adds a USB quirk which enables such a delay
    and adds the device to the quirks list.

    Signed-off-by: Phil Dibowitz
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Phil Dibowitz
     
  • 1) Introduce ulpi specific flags for control of the ulpi phy
    2) Extend the generic ulpi driver with support for Function and
    Interface control of upli phy
    3) Update the platforms using the generic ulpi driver with new ulpi
    flags
    4) Remove the otg control flags not in use

    Signed-off-by: Igor Grinberg
    Signed-off-by: Mike Rapoport
    Signed-off-by: Greg Kroah-Hartman

    Igor Grinberg
     
  • Fixes below compilation warning from ulpi.h

    include/linux/usb/ulpi.h:145:
    warning: 'struct otg_io_access_ops' declared inside parameter list
    include/linux/usb/ulpi.h:145:
    warning: its scope is only this definition or declaration,
    which is probably not what you want

    Signed-off-by: Ajay Kumar Gupta
    Signed-off-by: Greg Kroah-Hartman

    Ajay Kumar Gupta
     
  • This patch (as1395) adds code to hcd_pci_suspend() for handling wakeup
    races. This is another general race pattern, similar to the "open
    vs. unregister" race we're all familiar with. Here, the race is
    between suspending a device and receiving a wakeup request from one of
    the device's suspended children.

    In particular, if a root-hub wakeup is requested at about the same
    time as the corresponding USB controller is suspended, and if the
    controller is enabled for wakeup, then the controller should either
    fail to suspend or else wake right back up again.

    During system sleep this won't happen very much, especially since host
    controllers generally aren't enabled for wakeup during sleep. However
    it is definitely an issue for runtime PM. Something like this will be
    needed to prevent the controller from autosuspending while waiting for
    a root-hub resume to take place. (That is, in fact, the common case,
    for which there is an extra test.)

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as1385) adds a "do_wakeup" parameter to the pci_suspend
    method used by PCI-based host controller drivers. ehci-hcd in
    particular needs to know whether or not to enable wakeup when
    suspending a controller. Although that information is currently
    available through device_may_wakeup(), when support is added for
    runtime suspend this will no longer be true.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as1393) converts several of the single-bit fields in
    struct usb_hcd to atomic flags. This is for safety's sake; not all
    CPUs can update bitfield values atomically, and these flags are used
    in multiple contexts.

    The flag fields that are set only during registration or removal can
    remain as they are, since non-atomic accesses at those times will not
    cause any problems.

    (Strictly speaking, the authorized_default flag should become atomic
    as well. I didn't bother with it because it gets changed only via
    sysfs. It can be done later, if anyone wants.)

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • Added a disconnect() callback to composite devices which
    is called by composite glue when its disconnect callback
    is called by gadget.

    Signed-off-by: Michal Nazarewicz
    Signed-off-by: Kyungmin Park
    Acked-by: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    Michal Nazarewicz
     
  • usb_string_ids_tab() and usb_string_ids_n() functions added to
    the composite framework. The first accepts an array of
    usb_string object and for each registeres a string id and the
    second registeres a given number of ids and returns the first.

    This may simplify string ids registration since gadgets and
    composite functions won't have to call usb_string_id() several
    times and each time check for errer status -- all this will be
    done with a single call.

    Signed-off-by: Michal Nazarewicz
    Signed-off-by: Kyungmin Park
    Signed-off-by: Greg Kroah-Hartman

    Michal Nazarewicz
     
  • FunctionFS had a bit unique name for function used to add it
    to USB configuration. Renamed as to match naming convention
    of other functions.

    Signed-off-by: Michal Nazarewicz
    Signed-off-by: Kyungmin Park
    Signed-off-by: Greg Kroah-Hartman

    Michal Nazarewicz
     
  • And audit all the users. None needed the BKL. That was easy
    because there was only very few around.

    Tested with allmodconfig build on x86-64

    Signed-off-by: Andi Kleen
    Cc: Arnd Bergmann
    From: Andi Kleen

    Andi Kleen
     
  • With this patch, the LPM capable EHCI host controller can put device
    into L1 sleep state which is a mode that can enter/exit quickly, and
    reduce power consumption.

    Signed-off-by: Jacob Pan
    Signed-off-by: Alek Du
    Signed-off-by: Greg Kroah-Hartman

    Alek Du
     
  • EHCI 1.1 addendum introduced several energy efficiency extensions for
    EHCI USB host controllers:
    1. LPM (link power management)
    2. Per-port change
    3. Shorter periodic frame list
    4. Hardware prefetching

    This patch is intended to define the HW bits and debug interface for
    EHCI 1.1 addendum. The LPM and Per-port change patches will be sent out
    after this patch.

    Signed-off-by: Jacob Pan
    Signed-off-by: Alek Du
    Signed-off-by: Greg Kroah-Hartman

    Alek Du
     
  • otg_io_write() function does not follow the declaration of
    struct otg_io_access_ops.

    Signed-off-by: Igor Grinberg
    Signed-off-by: Greg Kroah-Hartman

    Igor Grinberg
     
  • This patch (as1390) fixes a problem that crops up when a UHCI host
    controller is unbound from uhci-hcd while there are still some active
    URBs. The URBs have to be unlinked when the root hub is unregistered,
    and uhci-hcd relies upon root-hub status polls as part of its
    unlinking procedure. But usb_hcd_poll_rh_status() won't make those
    status calls if hcd->rh_registered is clear, and the flag is cleared
    _before_ the unregistration takes place.

    Since hcd->rh_registered is used for other things and needs to be
    cleared early, the solution is to add a new flag (rh_pollable) and use
    it instead. It gets cleared _after_ the root hub is unregistered.

    Now that the status polls don't end too soon, we have to make sure
    they also don't occur too late -- after the root hub's usb_device
    structure or the HCD's private structures are deallocated. Therefore
    the patch adds usb_get_device() and usb_put_device() calls to protect
    the root hub structure, and it adds an extra del_timer_sync() to
    prevent the root-hub timer from causing an unexpected status poll.

    This additional complexity would not be needed if the HCD framework
    had provided separate stop() and release() callbacks instead of just
    stop(). This lack could be fixed at some future time (although it
    would require changes to every host controller driver); when that
    happens this patch won't be needed any more.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • * 'writable_limits' of git://decibel.fi.muni.cz/~xslaby/linux:
    unistd: add __NR_prlimit64 syscall numbers
    rlimits: implement prlimit64 syscall
    rlimits: switch more rlimit syscalls to do_prlimit
    rlimits: redo do_setrlimit to more generic do_prlimit
    rlimits: add rlimit64 structure
    rlimits: do security check under task_lock
    rlimits: allow setrlimit to non-current tasks
    rlimits: split sys_setrlimit
    rlimits: selinux, do rlimits changes under task_lock
    rlimits: make sure ->rlim_max never grows in sys_setrlimit
    rlimits: add task_struct to update_rlimit_cpu
    rlimits: security, add task_struct to setrlimit

    Fix up various system call number conflicts. We not only added fanotify
    system calls in the meantime, but asm-generic/unistd.h added a wait4
    along with a range of reserved per-architecture system calls.

    Linus Torvalds
     
  • * git://git.infradead.org/mtd-2.6: (79 commits)
    mtd: Remove obsolete include
    mtd: Update copyright notices
    jffs2: Update copyright notices
    mtd-physmap: add support users can assign the probe type in board files
    mtd: remove redwood map driver
    mxc_nand: Add v3 (i.MX51) Support
    mxc_nand: support 8bit ecc
    mxc_nand: fix correct_data function
    mxc_nand: add V1_V2 namespace to registers
    mxc_nand: factor out a check_int function
    mxc_nand: make some internally used functions overwriteable
    mxc_nand: rework get_dev_status
    mxc_nand: remove 0xe00 offset from registers
    mtd: denali: Add multi connected NAND support
    mtd: denali: Remove set_ecc_config function
    mtd: denali: Remove unuseful code in get_xx_nand_para functions
    mtd: denali: Remove device_info_tag structure
    mtd: m25p80: add support for the Winbond W25Q32 SPI flash chip
    mtd: m25p80: add support for the Intel/Numonyx {16,32,64}0S33B SPI flash chips
    mtd: m25p80: add support for the EON EN25P{32, 64} SPI flash chips
    ...

    Fix up trivial conflicts in drivers/mtd/maps/{Kconfig,redwood.c} due to
    redwood driver removal.

    Linus Torvalds
     
  • * 'for-linus' of git://git.infradead.org/users/eparis/notify: (132 commits)
    fanotify: use both marks when possible
    fsnotify: pass both the vfsmount mark and inode mark
    fsnotify: walk the inode and vfsmount lists simultaneously
    fsnotify: rework ignored mark flushing
    fsnotify: remove global fsnotify groups lists
    fsnotify: remove group->mask
    fsnotify: remove the global masks
    fsnotify: cleanup should_send_event
    fanotify: use the mark in handler functions
    audit: use the mark in handler functions
    dnotify: use the mark in handler functions
    inotify: use the mark in handler functions
    fsnotify: send fsnotify_mark to groups in event handling functions
    fsnotify: Exchange list heads instead of moving elements
    fsnotify: srcu to protect read side of inode and vfsmount locks
    fsnotify: use an explicit flag to indicate fsnotify_destroy_mark has been called
    fsnotify: use _rcu functions for mark list traversal
    fsnotify: place marks on object in order of group memory address
    vfs/fsnotify: fsnotify_close can delay the final work in fput
    fsnotify: store struct file not struct path
    ...

    Fix up trivial delete/modify conflict in fs/notify/inotify/inotify.c.

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (96 commits)
    no need for list_for_each_entry_safe()/resetting with superblock list
    Fix sget() race with failing mount
    vfs: don't hold s_umount over close_bdev_exclusive() call
    sysv: do not mark superblock dirty on remount
    sysv: do not mark superblock dirty on mount
    btrfs: remove junk sb_dirt change
    BFS: clean up the superblock usage
    AFFS: wait for sb synchronization when needed
    AFFS: clean up dirty flag usage
    cifs: truncate fallout
    mbcache: fix shrinker function return value
    mbcache: Remove unused features
    add f_flags to struct statfs(64)
    pass a struct path to vfs_statfs
    update VFS documentation for method changes.
    All filesystems that need invalidate_inode_buffers() are doing that explicitly
    convert remaining ->clear_inode() to ->evict_inode()
    Make ->drop_inode() just return whether inode needs to be dropped
    fs/inode.c:clear_inode() is gone
    fs/inode.c:evict() doesn't care about delete vs. non-delete paths now
    ...

    Fix up trivial conflicts in fs/nilfs2/super.c

    Linus Torvalds
     

10 Aug, 2010

21 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (59 commits)
    igbvf.txt: Add igbvf Documentation
    igb.txt: Add igb documentation
    e100/e1000*/igb*/ixgb*: Add missing read memory barrier
    ixgbe: fix build error with FCOE_CONFIG without DCB_CONFIG
    netxen: protect tx timeout recovery by rtnl lock
    isdn: gigaset: use after free
    isdn: gigaset: add missing unlock
    solos-pci: Fix race condition in tasklet RX handling
    pkt_sched: Fix sch_sfq vs tcf_bind_filter oops
    net: disable preemption before call smp_processor_id()
    tcp: no md5sig option size check bug
    iwlwifi: fix locking assertions
    iwlwifi: fix TX tracer
    isdn: fix information leak
    net: Fix napi_gro_frags vs netpoll path
    usbnet: remove noisy and hardly useful printk
    rtl8180: avoid potential NULL deref in rtl8180_beacon_work
    ath9k: Remove myself from the MAINTAINERS list
    libertas: scan before assocation if no BSSID was given
    libertas: fix association with some APs by using extended rates
    ...

    Linus Torvalds
     
  • * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx: (30 commits)
    DMAENGINE: at_hdmac: locking fixlet
    DMAENGINE: pch_dma: kill another usage of __raw_{read|write}l
    dma: dmatest: fix potential sign bug
    ioat2: catch and recover from broken vtd configurations v6
    DMAENGINE: add runtime slave control to COH 901 318 v3
    DMAENGINE: add runtime slave config to DMA40 v3
    DMAENGINE: generic slave channel control v3
    dmaengine: Driver for Topcliff PCH DMA controller
    intel_mid: Add Mrst & Mfld DMA Drivers
    drivers/dma: Eliminate a NULL pointer dereference
    dma/timb_dma: compile warning on 32 bit
    DMAENGINE: ste_dma40: support older silicon
    DMAENGINE: ste_dma40: support disabling physical channels
    DMAENGINE: ste_dma40: no disabled phy channels on ux500
    DMAENGINE: ste_dma40: fix suspend bug
    DMAENGINE: ste_dma40: add DB8500 memcpy channels
    DMAENGINE: ste_dma40: no flow control on memcpy
    DMAENGINE: ste_dma40: arch updates for LCLA and LCPA
    DMAENGINE: ste_dma40: allocate LCLA dynamically
    DMAENGINE: ste_dma40: no premature stop
    ...

    Fix up trivial conflicts in arch/arm/mach-ux500/devices-db8500.c

    Linus Torvalds
     
  • Getting and putting arrays of pointers with flex arrays is a PITA. You
    have to remember to pass &ptr to the _put and you have to do weird and
    wacky casting to get the ptr back from the _get. Add two functions
    flex_array_get_ptr() and flex_array_put_ptr() to handle all of the magic.

    [akpm@linux-foundation.org: simplification suggested by Joe]
    Signed-off-by: Eric Paris
    Cc: David Rientjes
    Cc: Dave Hansen
    Cc: Joe Perches
    Cc: James Morris
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Paris
     
  • A profile of a network benchmark showed iommu_num_pages rather high up:

    0.52% iommu_num_pages

    Looking at the profile, an integer divide is taking almost all of the time:

    %
    : c000000000376ea4 :
    1.93 : c000000000376ea4: fb e1 ff f8 std r31,-8(r1)
    0.00 : c000000000376ea8: f8 21 ff c1 stdu r1,-64(r1)
    0.00 : c000000000376eac: 7c 3f 0b 78 mr r31,r1
    3.86 : c000000000376eb0: 38 84 ff ff addi r4,r4,-1
    0.00 : c000000000376eb4: 38 05 ff ff addi r0,r5,-1
    0.00 : c000000000376eb8: 7c 84 2a 14 add r4,r4,r5
    46.95 : c000000000376ebc: 7c 00 18 38 and r0,r0,r3
    45.66 : c000000000376ec0: 7c 84 02 14 add r4,r4,r0
    0.00 : c000000000376ec4: 7c 64 2b 92 divdu r3,r4,r5
    0.00 : c000000000376ec8: 38 3f 00 40 addi r1,r31,64
    0.00 : c000000000376ecc: eb e1 ff f8 ld r31,-8(r1)
    1.61 : c000000000376ed0: 4e 80 00 20 blr

    Since every caller of iommu_num_pages passes in a constant power of two
    we can inline this such that the divide is replaced by a shift. The
    entire function is only a few instructions once optimised, so it is
    a good candidate for inlining overall.

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

    Anton Blanchard
     
  • There are no more uses of NIPQUAD or NIPQUAD_FMT. Remove the definitions.

    Signed-off-by: Joe Perches
    Cc: "David S. Miller"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • We should use the __same_type() helper in __must_be_array().

    Signed-off-by: Rusty Russell
    Reported-by: Andrew Morton
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rusty Russell
     
  • The asm-generic/iomap.h provides these functions already, but the
    non-generic fallback defines do not.

    Signed-off-by: Mike Frysinger
    Cc: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • On some SoC chips, HW resources may be in use during any particular idle
    period. As a consequence, the cpuidle states that the SoC is safe to
    enter can change from idle period to idle period. In addition, the
    latency and threshold of each cpuidle state can vary, depending on the
    operating condition when the CPU becomes idle, e.g. the current cpu
    frequency, the current state of the HW blocks, etc.

    cpuidle core and the menu governor, in the current form, are geared
    towards cpuidle states that are static, i.e. the availabiltiy of the
    states, their latencies, their thresholds are non-changing during run
    time. cpuidle does not provide any hook that cpuidle drivers can use to
    adjust those values on the fly for the current idle period before the menu
    governor selects the target cpuidle state.

    This patch extends cpuidle core and the menu governor to handle states
    that are dynamic. There are three additions in the patch and the patch
    maintains backwards-compatibility with existing cpuidle drivers.

    1) add prepare() to struct cpuidle_device. A cpuidle driver can hook
    into the callback and cpuidle will call prepare() before calling the
    governor's select function. The callback gives the cpuidle driver a
    chance to update the dynamic information of the cpuidle states for the
    current idle period, e.g. state availability, latencies, thresholds,
    power values, etc.

    2) add CPUIDLE_FLAG_IGNORE as one of the state flags. In the prepare()
    function, a cpuidle driver can set/clear the flag to indicate to the
    menu governor whether a cpuidle state should be ignored, i.e. not
    available, during the current idle period.

    3) add power_specified bit to struct cpuidle_device. The menu governor
    currently assumes that the cpuidle states are arranged in the order of
    increasing latency, threshold, and power savings. This is true or can
    be made true for static states. Once the state parameters are dynamic,
    the latencies, thresholds, and power savings for the cpuidle states can
    increase or decrease by different amounts from idle period to idle
    period. So the assumption of increasing latency, threshold, and power
    savings from Cn to C(n+1) can no longer be guaranteed.

    It can be straightforward to calculate the power consumption of each
    available state and to specify it in power_usage for the idle period.
    Using the power_usage fields, the menu governor then selects the state
    that has the lowest power consumption and that still satisfies all other
    critieria. The power_specified bit defaults to 0. For existing cpuidle
    drivers, cpuidle detects that power_specified is 0 and fills in a dummy
    set of power_usage values.

    Signed-off-by: Ai Li
    Cc: Len Brown
    Acked-by: Arjan van de Ven
    Cc: Ingo Molnar
    Cc: Venkatesh Pallipadi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ai Li
     
  • When taking a memory snapshot in hibernate_snapshot(), all (directly
    called) memory allocations use GFP_ATOMIC. Hence swap misusage during
    hibernation never occurs.

    But from a pessimistic point of view, there is no guarantee that no page
    allcation has __GFP_WAIT. It is better to have a global indication "we
    enter hibernation, don't use swap!".

    This patch tries to freeze new-swap-allocation during hibernation. (All
    user processes are frozenm so swapin is not a concern).

    This way, no updates will happen to swap_map[] between
    hibernate_snapshot() and save_image(). Swap is thawed when swsusp_free()
    is called. We can be assured that swap corruption will not occur.

    Signed-off-by: KAMEZAWA Hiroyuki
    Cc: "Rafael J. Wysocki"
    Cc: Hugh Dickins
    Cc: KOSAKI Motohiro
    Cc: Ondrej Zary
    Cc: Balbir Singh
    Cc: Andrea Arcangeli
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     
  • Memcg also need to trace page isolation information as global reclaim.
    This patch does it.

    Signed-off-by: KOSAKI Motohiro
    Reviewed-by: KAMEZAWA Hiroyuki
    Acked-by: Mel Gorman
    Acked-by: Balbir Singh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KOSAKI Motohiro
     
  • Mel Gorman recently added some vmscan tracepoints. Unfortunately they are
    covered only global reclaim. But we want to trace memcg reclaim too.

    Thus, this patch convert them to DEFINE_TRACE macro. it help to reuse
    tracepoint definition for other similar usage (i.e. memcg). This patch
    have no functionally change.

    Signed-off-by: KOSAKI Motohiro
    Reviewed-by: KAMEZAWA Hiroyuki
    Acked-by: Balbir Singh
    Acked-by: Mel Gorman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KOSAKI Motohiro
     
  • Memcg also need to trace reclaim progress as direct reclaim. This patch
    add it.

    Signed-off-by: KOSAKI Motohiro
    Reviewed-by: KAMEZAWA Hiroyuki
    Acked-by: Mel Gorman
    Acked-by: Balbir Singh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KOSAKI Motohiro
     
  • Mel Gorman recently added some vmscan tracepoints. Unfortunately they are
    covered only global reclaim. But we want to trace memcg reclaim too.

    Thus, this patch convert them to DEFINE_TRACE macro. it help to reuse
    tracepoint definition for other similar usage (i.e. memcg). This patch
    have no functionally change.

    Signed-off-by: KOSAKI Motohiro
    Reviewed-by: KAMEZAWA Hiroyuki
    Acked-by: Mel Gorman
    Acked-by: Balbir Singh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KOSAKI Motohiro
     
  • On swapin it is fairly common for a page to be owned exclusively by one
    process. In that case we want to add the page to the anon_vma of that
    process's VMA, instead of to the root anon_vma.

    This will reduce the amount of rmap searching that the swapout code needs
    to do.

    Signed-off-by: Rik van Riel
    Cc: Andrea Arcangeli
    Cc: KOSAKI Motohiro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rik van Riel
     
  • /proc/pid/oom_adj is now deprecated so that that it may eventually be
    removed. The target date for removal is August 2012.

    A warning will be printed to the kernel log if a task attempts to use this
    interface. Future warning will be suppressed until the kernel is rebooted
    to prevent spamming the kernel log.

    Signed-off-by: David Rientjes
    Cc: Nick Piggin
    Cc: KAMEZAWA Hiroyuki
    Cc: KOSAKI Motohiro
    Cc: Oleg Nesterov
    Cc: Balbir Singh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     
  • This a complete rewrite of the oom killer's badness() heuristic which is
    used to determine which task to kill in oom conditions. The goal is to
    make it as simple and predictable as possible so the results are better
    understood and we end up killing the task which will lead to the most
    memory freeing while still respecting the fine-tuning from userspace.

    Instead of basing the heuristic on mm->total_vm for each task, the task's
    rss and swap space is used instead. This is a better indication of the
    amount of memory that will be freeable if the oom killed task is chosen
    and subsequently exits. This helps specifically in cases where KDE or
    GNOME is chosen for oom kill on desktop systems instead of a memory
    hogging task.

    The baseline for the heuristic is a proportion of memory that each task is
    currently using in memory plus swap compared to the amount of "allowable"
    memory. "Allowable," in this sense, means the system-wide resources for
    unconstrained oom conditions, the set of mempolicy nodes, the mems
    attached to current's cpuset, or a memory controller's limit. The
    proportion is given on a scale of 0 (never kill) to 1000 (always kill),
    roughly meaning that if a task has a badness() score of 500 that the task
    consumes approximately 50% of allowable memory resident in RAM or in swap
    space.

    The proportion is always relative to the amount of "allowable" memory and
    not the total amount of RAM systemwide so that mempolicies and cpusets may
    operate in isolation; they shall not need to know the true size of the
    machine on which they are running if they are bound to a specific set of
    nodes or mems, respectively.

    Root tasks are given 3% extra memory just like __vm_enough_memory()
    provides in LSMs. In the event of two tasks consuming similar amounts of
    memory, it is generally better to save root's task.

    Because of the change in the badness() heuristic's baseline, it is also
    necessary to introduce a new user interface to tune it. It's not possible
    to redefine the meaning of /proc/pid/oom_adj with a new scale since the
    ABI cannot be changed for backward compatability. Instead, a new tunable,
    /proc/pid/oom_score_adj, is added that ranges from -1000 to +1000. It may
    be used to polarize the heuristic such that certain tasks are never
    considered for oom kill while others may always be considered. The value
    is added directly into the badness() score so a value of -500, for
    example, means to discount 50% of its memory consumption in comparison to
    other tasks either on the system, bound to the mempolicy, in the cpuset,
    or sharing the same memory controller.

    /proc/pid/oom_adj is changed so that its meaning is rescaled into the
    units used by /proc/pid/oom_score_adj, and vice versa. Changing one of
    these per-task tunables will rescale the value of the other to an
    equivalent meaning. Although /proc/pid/oom_adj was originally defined as
    a bitshift on the badness score, it now shares the same linear growth as
    /proc/pid/oom_score_adj but with different granularity. This is required
    so the ABI is not broken with userspace applications and allows oom_adj to
    be deprecated for future removal.

    Signed-off-by: David Rientjes
    Cc: Nick Piggin
    Cc: KAMEZAWA Hiroyuki
    Cc: KOSAKI Motohiro
    Cc: Oleg Nesterov
    Cc: Balbir Singh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     
  • Cc: Minchan Kim
    Cc: David Rientjes
    Cc: KAMEZAWA Hiroyuki
    Cc: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Since 2.6.28 zone->prev_priority is unused. Then it can be removed
    safely. It reduce stack usage slightly.

    Now I have to say that I'm sorry. 2 years ago, I thought prev_priority
    can be integrate again, it's useful. but four (or more) times trying
    haven't got good performance number. Thus I give up such approach.

    The rest of this changelog is notes on prev_priority and why it existed in
    the first place and why it might be not necessary any more. This information
    is based heavily on discussions between Andrew Morton, Rik van Riel and
    Kosaki Motohiro who is heavily quotes from.

    Historically prev_priority was important because it determined when the VM
    would start unmapping PTE pages. i.e. there are no balances of note within
    the VM, Anon vs File and Mapped vs Unmapped. Without prev_priority, there
    is a potential risk of unnecessarily increasing minor faults as a large
    amount of read activity of use-once pages could push mapped pages to the
    end of the LRU and get unmapped.

    There is no proof this is still a problem but currently it is not considered
    to be. Active files are not deactivated if the active file list is smaller
    than the inactive list reducing the liklihood that file-mapped pages are
    being pushed off the LRU and referenced executable pages are kept on the
    active list to avoid them getting pushed out by read activity.

    Even if it is a problem, prev_priority prev_priority wouldn't works
    nowadays. First of all, current vmscan still a lot of UP centric code. it
    expose some weakness on some dozens CPUs machine. I think we need more and
    more improvement.

    The problem is, current vmscan mix up per-system-pressure, per-zone-pressure
    and per-task-pressure a bit. example, prev_priority try to boost priority to
    other concurrent priority. but if the another task have mempolicy restriction,
    it is unnecessary, but also makes wrong big latency and exceeding reclaim.
    per-task based priority + prev_priority adjustment make the emulation of
    per-system pressure. but it have two issue 1) too rough and brutal emulation
    2) we need per-zone pressure, not per-system.

    Another example, currently DEF_PRIORITY is 12. it mean the lru rotate about
    2 cycle (1/4096 + 1/2048 + 1/1024 + .. + 1) before invoking OOM-Killer.
    but if 10,0000 thrreads enter DEF_PRIORITY reclaim at the same time, the
    system have higher memory pressure than priority==0 (1/4096*10,000 > 2).
    prev_priority can't solve such multithreads workload issue. In other word,
    prev_priority concept assume the sysmtem don't have lots threads."

    Signed-off-by: KOSAKI Motohiro
    Signed-off-by: Mel Gorman
    Reviewed-by: Johannes Weiner
    Reviewed-by: Rik van Riel
    Cc: Dave Chinner
    Cc: Chris Mason
    Cc: Nick Piggin
    Cc: Rik van Riel
    Cc: Johannes Weiner
    Cc: Christoph Hellwig
    Cc: KAMEZAWA Hiroyuki
    Cc: KOSAKI Motohiro
    Cc: Andrea Arcangeli
    Cc: Michael Rubin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KOSAKI Motohiro
     
  • Add a trace event for when page reclaim queues a page for IO and records
    whether it is synchronous or asynchronous. Excessive synchronous IO for a
    process can result in noticeable stalls during direct reclaim. Excessive
    IO from page reclaim may indicate that the system is seriously under
    provisioned for the amount of dirty pages that exist.

    Signed-off-by: Mel Gorman
    Acked-by: Rik van Riel
    Acked-by: Larry Woodman
    Cc: Dave Chinner
    Cc: Chris Mason
    Cc: Nick Piggin
    Cc: Rik van Riel
    Cc: Johannes Weiner
    Cc: Christoph Hellwig
    Cc: KAMEZAWA Hiroyuki
    Cc: KOSAKI Motohiro
    Cc: Andrea Arcangeli
    Cc: Michael Rubin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mel Gorman
     
  • Add an event for when pages are isolated en-masse from the LRU lists.
    This event augments the information available on LRU traffic and can be
    used to evaluate lumpy reclaim.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Mel Gorman
    Acked-by: Rik van Riel
    Acked-by: Larry Woodman
    Cc: Dave Chinner
    Cc: Chris Mason
    Cc: Nick Piggin
    Cc: Rik van Riel
    Cc: Johannes Weiner
    Cc: Christoph Hellwig
    Cc: KAMEZAWA Hiroyuki
    Cc: KOSAKI Motohiro
    Cc: Andrea Arcangeli
    Cc: Michael Rubin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mel Gorman
     
  • Add two trace events for kswapd waking up and going asleep for the
    purposes of tracking kswapd activity and two trace events for direct
    reclaim beginning and ending. The information can be used to work out how
    much time a process or the system is spending on the reclamation of pages
    and in the case of direct reclaim, how many pages were reclaimed for that
    process. High frequency triggering of these events could point to memory
    pressure problems.

    Signed-off-by: Mel Gorman
    Acked-by: Rik van Riel
    Acked-by: Larry Woodman
    Cc: Dave Chinner
    Cc: Chris Mason
    Cc: Nick Piggin
    Cc: Rik van Riel
    Cc: Johannes Weiner
    Cc: Christoph Hellwig
    Cc: KAMEZAWA Hiroyuki
    Cc: KOSAKI Motohiro
    Cc: Andrea Arcangeli
    Cc: Michael Rubin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mel Gorman