22 Nov, 2011

7 commits

  • Using TIF_FREEZE for freezing worked when there was only single
    freezing condition (the PM one); however, now there is also the
    cgroup_freezer and single bit flag is getting clumsy.
    thaw_processes() is already testing whether cgroup freezing in in
    effect to avoid thawing tasks which were frozen by both PM and cgroup
    freezers.

    This is racy (nothing prevents race against cgroup freezing) and
    fragile. A much simpler way is to test actual freeze conditions from
    freezing() - ie. directly test whether PM or cgroup freezing is in
    effect.

    This patch adds variables to indicate whether and what type of
    freezing conditions are in effect and reimplements freezing() such
    that it directly tests whether any of the two freezing conditions is
    active and the task should freeze. On fast path, freezing() is still
    very cheap - it only tests system_freezing_cnt.

    This makes the clumsy dancing aroung TIF_FREEZE unnecessary and
    freeze/thaw operations more usual - updating state variables for the
    new state and nudging target tasks so that they notice the new state
    and comply. As long as the nudging happens after state update, it's
    race-free.

    * This allows use of freezing() in freeze_task(). Replace the open
    coded tests with freezing().

    * p != current test is added to warning printing conditions in
    try_to_freeze_tasks() failure path. This is necessary as freezing()
    is now true for the task which initiated freezing too.

    -v2: Oleg pointed out that re-freezing FROZEN cgroup could increment
    system_freezing_cnt. Fixed.

    Signed-off-by: Tejun Heo
    Acked-by: Paul Menage (for the cgroup portions)

    Tejun Heo
     
  • TIF_FREEZE will be removed soon and freezing() will directly test
    whether any freezing condition is in effect. Make the following
    changes in preparation.

    * Rename cgroup_freezing_or_frozen() to cgroup_freezing() and make it
    return bool.

    * Make cgroup_freezing() access task_freezer() under rcu read lock
    instead of task_lock(). This makes the state dereferencing racy
    against task moving to another cgroup; however, it was already racy
    without this change as ->state dereference wasn't synchronized.
    This will be later dealt with using attach hooks.

    * freezer->state is now set before trying to push tasks into the
    target state.

    -v2: Oleg pointed out that freeze_change_state() was setting
    freeze->state incorrectly to CGROUP_FROZEN instead of
    CGROUP_FREEZING. Fixed.

    -v3: Matt pointed out that setting CGROUP_FROZEN used to always invoke
    try_to_freeze_cgroup() regardless of the current state. Patch
    updated such that the actual freeze/thaw operations are always
    performed on invocation. This shouldn't make any difference
    unless something is broken.

    Signed-off-by: Tejun Heo
    Acked-by: Paul Menage
    Cc: Li Zefan
    Cc: Oleg Nesterov

    Tejun Heo
     
  • freeze_processes() failure path is rather messy. Freezing is canceled
    for workqueues and tasks which aren't frozen yet but frozen tasks are
    left alone and should be thawed by the caller and of course some
    callers (xen and kexec) didn't do it.

    This patch updates __thaw_task() to handle cancelation correctly and
    makes freeze_processes() and freeze_kernel_threads() call
    thaw_processes() on failure instead so that the system is fully thawed
    on failure. Unnecessary [suspend_]thaw_processes() calls are removed
    from kernel/power/hibernate.c, suspend.c and user.c.

    While at it, restructure error checking if clause in suspend_prepare()
    to be less weird.

    -v2: Srivatsa spotted missing removal of suspend_thaw_processes() in
    suspend_prepare() and error in commit message. Updated.

    Signed-off-by: Tejun Heo
    Acked-by: Srivatsa S. Bhat

    Tejun Heo
     
  • With the previous changes, there's no meaningful difference between
    PF_FREEZING and PF_FROZEN. Remove PF_FREEZING and use PF_FROZEN
    instead in task_contributes_to_load().

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • thaw_process() now has only internal users - system and cgroup
    freezers. Remove the unnecessary return value, rename, unexport and
    collapse __thaw_process() into it. This will help further updates to
    the freezer code.

    -v3: oom_kill grew a use of thaw_process() while this patch was
    pending. Convert it to use __thaw_task() for now. In the longer
    term, this should be handled by allowing tasks to die if killed
    even if it's frozen.

    -v2: minor style update as suggested by Matt.

    Signed-off-by: Tejun Heo
    Cc: Paul Menage
    Cc: Matt Helsley

    Tejun Heo
     
  • Writeback and thinkpad_acpi have been using thaw_process() to prevent
    deadlock between the freezer and kthread_stop(); unfortunately, this
    is inherently racy - nothing prevents freezing from happening between
    thaw_process() and kthread_stop().

    This patch implements kthread_freezable_should_stop() which enters
    refrigerator if necessary but is guaranteed to return if
    kthread_stop() is invoked. Both thaw_process() users are converted to
    use the new function.

    Note that this deadlock condition exists for many of freezable
    kthreads. They need to be converted to use the new should_stop or
    freezable workqueue.

    Tested with synthetic test case.

    Signed-off-by: Tejun Heo
    Acked-by: Henrique de Moraes Holschuh
    Cc: Jens Axboe
    Cc: Oleg Nesterov

    Tejun Heo
     
  • There is no reason to export two functions for entering the
    refrigerator. Calling refrigerator() instead of try_to_freeze()
    doesn't save anything noticeable or removes any race condition.

    * Rename refrigerator() to __refrigerator() and make it return bool
    indicating whether it scheduled out for freezing.

    * Update try_to_freeze() to return bool and relay the return value of
    __refrigerator() if freezing().

    * Convert all refrigerator() users to try_to_freeze().

    * Update documentation accordingly.

    * While at it, add might_sleep() to try_to_freeze().

    Signed-off-by: Tejun Heo
    Cc: Samuel Ortiz
    Cc: Chris Mason
    Cc: "Theodore Ts'o"
    Cc: Steven Whitehouse
    Cc: Andrew Morton
    Cc: Jan Kara
    Cc: KONISHI Ryusuke
    Cc: Christoph Hellwig

    Tejun Heo
     

21 Nov, 2011

3 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (86 commits)
    ipv4: fix redirect handling
    ping: dont increment ICMP_MIB_INERRORS
    sky2: fix hang in napi_disable
    sky2: enforce minimum ring size
    bonding: Don't allow mode change via sysfs with slaves present
    f_phonet: fix page offset of first received fragment
    stmmac: fix pm functions avoiding sleep on spinlock
    stmmac: remove spin_lock in stmmac_ioctl.
    stmmac: parameters auto-tuning through HW cap reg
    stmmac: fix advertising 1000Base capabilties for non GMII iface
    stmmac: use mdelay on timeout of sw reset
    sky2: version 1.30
    sky2: used fixed RSS key
    sky2: reduce default Tx ring size
    sky2: rename up/down functions
    sky2: pci posting issues
    sky2: fix hang on shutdown (and other irq issues)
    r6040: fix check against MCRO_HASHEN bit in r6040_multicast_list
    MAINTAINERS: change email address for shemminger
    pch_gbe: Move #include of module.h
    ...

    Linus Torvalds
     
  • * 'kvm-updates/3.2' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
    KVM guest: prevent tracing recursion with kvmclock
    Revert "KVM: PPC: Add support for explicit HIOR setting"
    KVM: VMX: Check for automatic switch msr table overflow
    KVM: VMX: Add support for guest/host-only profiling
    KVM: VMX: add support for switching of PERF_GLOBAL_CTRL
    KVM: s390: announce SYNC_MMU
    KVM: s390: Fix tprot locking
    KVM: s390: handle SIGP sense running intercepts
    KVM: s390: Fix RUNNING flag misinterpretation

    Linus Torvalds
     
  • * 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    PM / Suspend: Fix bug in suspend statistics update
    PM / Hibernate: Fix the early termination of test modes
    PM / shmobile: Fix build of sh7372_pm_init() for CONFIG_PM unset
    PM Sleep: Do not extend wakeup paths to devices with ignore_children set
    PM / driver core: disable device's runtime PM during shutdown
    PM / devfreq: correct Kconfig dependency
    PM / devfreq: fix use after free in devfreq_remove_device
    PM / shmobile: Avoid restoring the INTCS state during initialization
    PM / devfreq: Remove compiler error after irq.h update
    PM / QoS: Properly use the WARN() macro in dev_pm_qos_add_request()
    PM / Clocks: Only disable enabled clocks in pm_clk_suspend()
    ARM: mach-shmobile: sh7372 A3SP no_suspend_console fix
    PM / shmobile: Don't skip debugging output in pd_power_up()

    Linus Torvalds
     

19 Nov, 2011

2 commits

  • Dummy, non-zero definitions for HPAGE_MASK and HPAGE_SIZE were added in
    51c6f666fceb ("mm: ZAP_BLOCK causes redundant work") to avoid a divide
    by zero in generic kernel code.

    That code has since been removed, but probably should never have been
    added in the first place: we don't want HPAGE_SIZE to act like PAGE_SIZE
    for code that is working with hugepages, for example, when the
    dependency on CONFIG_HUGETLB_PAGE has not been fulfilled.

    Because hugepage size can differ from architecture to architecture, each
    is required to have their own definitions for both HPAGE_MASK and
    HPAGE_SIZE. This is always done in arch/*/include/asm/page.h.

    So, just remove the dummy and dangerous definitions since they are no
    longer needed and reveals the correct dependencies. Tested on
    architectures using the definitions with allyesconfig: x86 (even with
    thp), hppa, mips, powerpc, s390, sh3, sh4, sparc, and sparc64, and with
    defconfig on ia64.

    Signed-off-by: David Rientjes
    Signed-off-by: Linus Torvalds

    David Rientjes
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    new helper: mount_subtree()
    switch create_mnt_ns() to saner calling conventions, fix double mntput() in nfs
    btrfs: fix double mntput() in mount_subvol()

    Linus Torvalds
     

18 Nov, 2011

3 commits

  • …kernel/git/konrad/xen

    * 'stable/for-linus-fixes-3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
    xen-gntalloc: signedness bug in add_grefs()
    xen-gntalloc: integer overflow in gntalloc_ioctl_alloc()
    xen-gntdev: integer overflow in gntdev_alloc_map()
    xen:pvhvm: enable PVHVM VCPU placement when using more than 32 CPUs.
    xen/balloon: Avoid OOM when requesting highmem
    xen: Remove hanging references to CONFIG_XEN_PLATFORM_PCI
    xen: map foreign pages for shared rings by updating the PTEs directly

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.dk/linux-block:
    block: add missed trace_block_plug
    paride: fix potential information leak in pg_read()
    bio: change some signed vars to unsigned
    block: avoid unnecessary plug list flush
    cciss: auto engage SCSI mid layer at driver load time
    loop: cleanup set_status interface
    include/linux/bio.h: use a static inline function for bio_integrity_clone()
    loop: prevent information leak after failed read
    block: Always check length of all iov entries in blk_rq_map_user_iov()
    The Windows driver .inf disables ASPM on all cciss devices. Do the same.
    backing-dev: ensure wakeup_timer is deleted
    block: Revert "[SCSI] genhd: add a new attribute "alias" in gendisk"

    Linus Torvalds
     
  • Commit 4ca46ff3e0d8c234cb40ebb6457653b59584426c (PM / Sleep: Mark
    devices involved in wakeup signaling during suspend) introduced
    the power.wakeup_path field in struct dev_pm_info to mark devices
    whose children are enabled to wake up the system from sleep states,
    so that power domains containing the parents that provide their
    children with wakeup power and/or relay their wakeup signals are not
    turned off. Unfortunately, that introduced a PM regression on SH7372
    whose power consumption in the system "memory sleep" state increased
    as a result of it, because it prevented the power domain containing
    the I2C controller from being turned off when some children of that
    controller were enabled to wake up the system, although the
    controller was not necessary for them to signal wakeup.

    To fix this issue use the observation that devices whose
    power.ignore_children flag is set for runtime PM should be treated
    analogously during system suspend. Namely, they shouldn't be
    included in wakeup paths going through their children. Since the
    SH7372 I2C controller's power.ignore_children flag is set, doing so
    will restore the previous behavior of that SOC.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Greg Kroah-Hartman

    Rafael J. Wysocki
     

17 Nov, 2011

4 commits

  • This reverts commit a15bd354f083f20f257db450488db52ac27df439.

    It exceeded the padding on the SREGS struct, rendering the ABI
    backwards-incompatible.

    Conflicts:

    arch/powerpc/kvm/powerpc.c
    include/linux/kvm.h

    Signed-off-by: Avi Kivity

    Alexander Graf
     
  • takes vfsmount and relative path, does lookup within that vfsmount
    (possibly triggering automounts) and returns the result as root
    of subtree suitable for return by ->mount() (i.e. a reference to
    dentry and an active reference to its superblock grabbed, superblock
    locked exclusive).

    btrfs and nfs switched to it instead of open-coding the sucker.

    Signed-off-by: Al Viro

    Al Viro
     
  • In 5fbdc10395cd500d6ff844825a918c4e6f38de37 the XEN_PLATFORM_PCI config
    option was removed, but references in header files remained. Clean up
    those references.

    Signed-off-by: Daniel De Graaf
    Signed-off-by: Konrad Rzeszutek Wilk

    Daniel De Graaf
     
  • When mapping a foreign page with xenbus_map_ring_valloc() with the
    GNTTABOP_map_grant_ref hypercall, set the GNTMAP_contains_pte flag and
    pass a pointer to the PTE (in init_mm).

    After the page is mapped, the usual fault mechanism can be used to
    update additional MMs. This allows the vmalloc_sync_all() to be
    removed from alloc_vm_area().

    Signed-off-by: David Vrabel
    Acked-by: Andrew Morton
    [v1: Squashed fix by Michal for no-mmu case]
    Signed-off-by: Konrad Rzeszutek Wilk
    Signed-off-by: Michal Simek

    David Vrabel
     

16 Nov, 2011

5 commits


14 Nov, 2011

3 commits

  • * 'rmobile-fixes-for-linus' of git://github.com/pmundt/linux-sh:
    ARM: mach-shmobile: cpuidle single/global and last_state fixes
    ARM: mach-shmobile: move helper macro PORTCR to sh_pfc.h
    ARM: mach-shmobile: move helper macro PORT_xx to sh_pfc.h
    ARM: mach-shmobile: move helper macro PORT_DATA_xx to sh_pfc.h
    ARM: mach-shmobile: ap4evb: remove white space from end of line
    ARM: mach-shmobile: clock-sh7372: remove un-necessary index
    ARM: mach-shmobile: kota2: add comment out separator
    ARM: mach-shmobile: sh73a0: add MMC data pin pull-up

    Linus Torvalds
     
  • * 'sh-fixes-for-linus' of git://github.com/pmundt/linux-sh:
    mailmap: Fix up some renesas attributions
    sh: clkfwk: Kill off remaining debugfs cruft.
    drivers: sh: Kill off dead pathname for runtime PM stub.
    drivers: sh: Generalize runtime PM platform stub.
    sh: Wire up process_vm syscalls.
    sh: clkfwk: add clk_rate_mult_range_round()
    serial: sh-sci: Fix up SH-2A SCIF support.
    sh: Fix cached/uncaced address calculation in 29bit mode

    Linus Torvalds
     
  • commit 3ceca749668a52bd795585e0f71c6f0b04814f7b added a TOS attribute.

    Unfortunately TOS and TCLASS are both present in a dual-stack v6 socket,
    furthermore they can have different values. As such one cannot in a
    sane way expose both through a single attribute.

    Signed-off-by: Maciej Żenczyowski
    CC: Murali Raja
    CC: Stephen Hemminger
    CC: Eric Dumazet
    CC: David S. Miller
    Signed-off-by: David S. Miller

    Maciej Żenczykowski
     

12 Nov, 2011

3 commits

  • * 'upstream-linus' of git://github.com/jgarzik/libata-dev:
    pata_of_platform: Don't use NO_IRQ
    [libata] ahci: Add ASMedia ASM1061 support
    [libata] Issue SRST to Sil3726 PMP
    sata_sis.c: trivial spelling fix
    ahci_platform: use dev_get_platdata()
    [libata] libata-scsi.c: Add function parameter documentation

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
    ALSA: usb-audio: Use kmemdup rather than duplicating its implementation
    ALSA: hda - Re-enable the check NO_PRESENCE misc bit
    ALSA: vmaster - Free slave-links when freeing the master element
    ALSA: hda - Don't add elements of other codecs to vmaster slave
    ALSA: intel8x0: improve virtual environment detection
    ALSA: intel8x0: move virtual environment detection code into one place
    ALSA: snd_usb_audio: add Logitech HD Webcam c510 to quirk-384
    ALSA: hda - fix internal mic on Dell Vostro 3500 laptop
    ALSA: HDA: Remove quirk for Toshiba T110
    ALSA: usb-audio - Fix the missing volume quirks at delayed init
    ALSA: hda - Mute unused capture sources for Realtek codecs
    ALSA: intel8x0: Improve comments for VM optimization
    ASoC: Ensure we get an impedence reported for WM8958 jack detect
    ASoC: Don't use wm8994->control_data when requesting IRQs
    ASoC: Don't use wm8994->control_data in wm8994_readable_register()
    ASoC: Update git repository URL

    Linus Torvalds
     
  • * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (42 commits)
    drm/radeon/kms/pm: switch to dynamically allocating clock mode array
    drm/radeon/kms: optimize r600_pm_profile_init
    drm/radeon/kms/pm: add a proper pm profile init function for fusion
    drm/radeon/kms: remove extraneous calls to radeon_pm_compute_clocks()
    drm/exynos: added padding to be 64-bit align.
    drm: fix kconfig unmet dependency warning
    drm: add some comments to drm_wait_vblank and drm_queue_vblank_event
    drm/radeon/benchmark: signedness bug in radeon_benchmark_move()
    drm: do not sleep on vblank while holding a mutex
    MAINTAINERS: exynos: Add EXYNOS DRM maintainer entry
    drm: try to restore previous CRTC config if mode set fails
    drm/radeon/kms: make an aux failure debug only
    drm: drop select of SLOW_WORK
    drm: serialize access to list of debugfs files
    drm/radeon/kms: fix use of vram scratch page on evergreen/ni
    drm/radeon: Make sure CS mutex is held across GPU reset.
    drm: Ensure string is null terminated.
    vmwgfx: Only allow 64x64 cursors
    vmwgfx: Initialize clip rect loop correctly in surface dirty
    vmwgfx: Close screen object system
    ...

    Linus Torvalds
     

11 Nov, 2011

7 commits


10 Nov, 2011

3 commits