1. 12 May, 2013 14 commits
    • Colin Cross's avatar
      select: use freezable blocking call · 9745cdb3
      Colin Cross authored
      Avoid waking up every thread sleeping in a select call during
      suspend and resume by calling a freezable blocking call.  Previous
      patches modified the freezer to avoid sending wakeups to threads
      that are blocked in freezable blocking calls.
      
      This call was selected to be converted to a freezable call because
      it doesn't hold any locks or release any resources when interrupted
      that might be needed by another freezing task or a kernel driver
      during suspend, and is a common site where idle userspace tasks are
      blocked.
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarColin Cross <ccross@android.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      9745cdb3
    • Colin Cross's avatar
      epoll: use freezable blocking call · 1c441e92
      Colin Cross authored
      Avoid waking up every thread sleeping in an epoll_wait call during
      suspend and resume by calling a freezable blocking call.  Previous
      patches modified the freezer to avoid sending wakeups to threads
      that are blocked in freezable blocking calls.
      
      This call was selected to be converted to a freezable call because
      it doesn't hold any locks or release any resources when interrupted
      that might be needed by another freezing task or a kernel driver
      during suspend, and is a common site where idle userspace tasks are
      blocked.
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarColin Cross <ccross@android.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      1c441e92
    • Colin Cross's avatar
      binder: use freezable blocking calls · e2610b26
      Colin Cross authored
      Avoid waking up every thread sleeping in a binder call during
      suspend and resume by calling a freezable blocking call.  Previous
      patches modified the freezer to avoid sending wakeups to threads
      that are blocked in freezable blocking calls.
      
      This call was selected to be converted to a freezable call because
      it doesn't hold any locks or release any resources when interrupted
      that might be needed by another freezing task or a kernel driver
      during suspend, and is a common site where idle userspace tasks are
      blocked.
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarColin Cross <ccross@android.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      e2610b26
    • Colin Cross's avatar
      freezer: add new freezable helpers using freezer_do_not_count() · dd5ec0f4
      Colin Cross authored
      Freezing tasks will wake up almost every userspace task from
      where it is blocking and force it to run until it hits a
      call to try_to_sleep(), generally on the exit path from the syscall
      it is blocking in.  On resume each task will run again, usually
      restarting the syscall and running until it hits the same
      blocking call as it was originally blocked in.
      
      To allow tasks to avoid running on every suspend/resume cycle,
      this patch adds additional freezable wrappers around blocking calls
      that call freezer_do_not_count().  Combined with the previous patch,
      these tasks will not run during suspend or resume unless they wake
      up for another reason, in which case they will run until they hit
      the try_to_freeze() in freezer_count(), and then continue processing
      the wakeup after tasks are thawed.
      
      Additional patches will convert the most common locations that
      userspace blocks in to use freezable helpers.
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarColin Cross <ccross@android.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      dd5ec0f4
    • Colin Cross's avatar
      freezer: convert freezable helpers to static inline where possible · 8ee492d6
      Colin Cross authored
      Some of the freezable helpers have to be macros because their
      condition argument needs to get evaluated every time through
      the wait loop.  Convert the others to static inline to make
      future changes easier.
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarColin Cross <ccross@android.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8ee492d6
    • Colin Cross's avatar
      freezer: convert freezable helpers to freezer_do_not_count() · b0123586
      Colin Cross authored
      Freezing tasks will wake up almost every userspace task from
      where it is blocking and force it to run until it hits a
      call to try_to_sleep(), generally on the exit path from the syscall
      it is blocking in.  On resume each task will run again, usually
      restarting the syscall and running until it hits the same
      blocking call as it was originally blocked in.
      
      Convert the existing wait_event_freezable* wrappers to use
      freezer_do_not_count().  Combined with a previous patch,
      these tasks will not run during suspend or resume unless they wake
      up for another reason, in which case they will run until they hit
      the try_to_freeze() in freezer_count(), and then continue processing
      the wakeup after tasks are thawed.
      
      This results in a small change in behavior, previously a race
      between freezing and a normal wakeup would be won by the wakeup,
      now the task will freeze and then handle the wakeup after thawing.
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarColin Cross <ccross@android.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      b0123586
    • Colin Cross's avatar
      freezer: skip waking up tasks with PF_FREEZER_SKIP set · 613f5d13
      Colin Cross authored
      Android goes through suspend/resume very often (every few seconds when
      on a busy wifi network with the screen off), and a significant portion
      of the energy used to go in and out of suspend is spent in the
      freezer.  If a task has called freezer_do_not_count(), don't bother
      waking it up.  If it happens to wake up later it will call
      freezer_count() and immediately enter the refrigerator.
      
      Combined with patches to convert freezable helpers to use
      freezer_do_not_count() and convert common sites where idle userspace
      tasks are blocked to use the freezable helpers, this reduces the
      time and energy required to suspend and resume.
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarColin Cross <ccross@android.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      613f5d13
    • Colin Cross's avatar
      freezer: shorten freezer sleep time using exponential backoff · 18ad0c62
      Colin Cross authored
      All tasks can easily be frozen in under 10 ms, switch to using
      an initial 1 ms sleep followed by exponential backoff until
      8 ms.  Also convert the printed time to ms instead of centiseconds.
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarColin Cross <ccross@android.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      18ad0c62
    • Mandeep Singh Baines's avatar
      lockdep: check that no locks held at freeze time · 0f9548ca
      Mandeep Singh Baines authored
      We shouldn't try_to_freeze if locks are held.  Holding a lock can cause a
      deadlock if the lock is later acquired in the suspend or hibernate path
      (e.g.  by dpm).  Holding a lock can also cause a deadlock in the case of
      cgroup_freezer if a lock is held inside a frozen cgroup that is later
      acquired by a process outside that group.
      
      History:
      This patch was originally applied as 6aa97070 and reverted in
      dbf520a9 because NFS was freezing with locks held.  It was
      deemed better to keep the bad freeze point in NFS to allow laptops
      to suspend consistently.  The previous patch in this series converts
      NFS to call _unsafe versions of the freezable helpers so that
      lockdep doesn't complain about them until a more correct fix
      can be applied.
      
      [akpm@linux-foundation.org: export debug_check_no_locks_held]
      Signed-off-by: default avatarMandeep Singh Baines <msb@chromium.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarColin Cross <ccross@android.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0f9548ca
    • Colin Cross's avatar
      lockdep: remove task argument from debug_check_no_locks_held · 1b1d2fb4
      Colin Cross authored
      The only existing caller to debug_check_no_locks_held calls it
      with 'current' as the task, and the freezer needs to call
      debug_check_no_locks_held but doesn't already have a current
      task pointer, so remove the argument.  It is already assuming
      that the current task is relevant by dumping the current stack
      trace as part of the warning.
      
      This was originally part of 6aa97070 (lockdep: check that
      no locks held at freeze time) which was reverted in
      dbf520a9.
      
      Original-author: Mandeep Singh Baines <msb@chromium.org>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarColin Cross <ccross@android.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      1b1d2fb4
    • Colin Cross's avatar
      freezer: add unsafe versions of freezable helpers for CIFS · 5853cc2a
      Colin Cross authored
      CIFS calls wait_event_freezekillable_unsafe with a VFS lock held,
      which is unsafe and will cause lockdep warnings when 6aa97070
      "lockdep: check that no locks held at freeze time" is reapplied
      (it was reverted in dbf520a9).  CIFS shouldn't be doing this, but
      it has long-running syscalls that must hold a lock but also
      shouldn't block suspend.  Until CIFS freeze handling is rewritten
      to use a signal to exit out of the critical section, add a new
      wait_event_freezekillable_unsafe helper that will not run the
      lockdep test when 6aa97070 is reapplied, and call it from CIFS.
      
      In practice the likley result of holding the lock while freezing
      is that a second task blocked on the lock will never freeze,
      aborting suspend, but it is possible to manufacture a case using
      the cgroup freezer, the lock, and the suspend freezer to create
      a deadlock.  Silencing the lockdep warning here will allow
      problems to be found in other drivers that may have a more
      serious deadlock risk, and prevent new problems from being added.
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Reviewed-by: default avatarJeff Layton <jlayton@redhat.com>
      Signed-off-by: default avatarColin Cross <ccross@android.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      5853cc2a
    • Colin Cross's avatar
      freezer: add unsafe versions of freezable helpers for NFS · 416ad3c9
      Colin Cross authored
      NFS calls the freezable helpers with locks held, which is unsafe
      and will cause lockdep warnings when 6aa97070 "lockdep: check
      that no locks held at freeze time" is reapplied (it was reverted
      in dbf520a9).  NFS shouldn't be doing this, but it has
      long-running syscalls that must hold a lock but also shouldn't
      block suspend.  Until NFS freeze handling is rewritten to use a
      signal to exit out of the critical section, add new *_unsafe
      versions of the helpers that will not run the lockdep test when
      6aa97070 is reapplied, and call them from NFS.
      
      In practice the likley result of holding the lock while freezing
      is that a second task blocked on the lock will never freeze,
      aborting suspend, but it is possible to manufacture a case using
      the cgroup freezer, the lock, and the suspend freezer to create
      a deadlock.  Silencing the lockdep warning here will allow
      problems to be found in other drivers that may have a more
      serious deadlock risk, and prevent new problems from being added.
      Signed-off-by: default avatarColin Cross <ccross@android.com>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      416ad3c9
    • Linus Torvalds's avatar
      Linux 3.10-rc1 · f722406f
      Linus Torvalds authored
      f722406f
    • Linus Torvalds's avatar
      Merge tag 'trace-fixes-v3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 26b840ae
      Linus Torvalds authored
      Pull tracing/kprobes update from Steven Rostedt:
       "The majority of these changes are from Masami Hiramatsu bringing
        kprobes up to par with the latest changes to ftrace (multi buffering
        and the new function probes).
      
        He also discovered and fixed some bugs in doing so.  When pulling in
        his patches, I also found a few minor bugs as well and fixed them.
      
        This also includes a compile fix for some archs that select the ring
        buffer but not tracing.
      
        I based this off of the last patch you took from me that fixed the
        merge conflict error, as that was the commit that had all the changes
        I needed for this set of changes."
      
      * tag 'trace-fixes-v3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing/kprobes: Support soft-mode disabling
        tracing/kprobes: Support ftrace_event_file base multibuffer
        tracing/kprobes: Pass trace_probe directly from dispatcher
        tracing/kprobes: Increment probe hit-count even if it is used by perf
        tracing/kprobes: Use bool for retprobe checker
        ftrace: Fix function probe when more than one probe is added
        ftrace: Fix the output of enabled_functions debug file
        ftrace: Fix locking in register_ftrace_function_probe()
        tracing: Add helper function trace_create_new_event() to remove duplicate code
        tracing: Modify soft-mode only if there's no other referrer
        tracing: Indicate enabled soft-mode in enable file
        tracing/kprobes: Fix to increment return event probe hit-count
        ftrace: Cleanup regex_lock and ftrace_lock around hash updating
        ftrace, kprobes: Fix a deadlock on ftrace_regex_lock
        ftrace: Have ftrace_regex_write() return either read or error
        tracing: Return error if register_ftrace_function_probe() fails for event_enable_func()
        tracing: Don't succeed if event_enable_func did not register anything
        ring-buffer: Select IRQ_WORK
      26b840ae
  2. 11 May, 2013 4 commits
    • Linus Torvalds's avatar
      Merge tag 'stable/for-linus-3.10-rc0-tag-two' of... · 607eeb0b
      Linus Torvalds authored
      Merge tag 'stable/for-linus-3.10-rc0-tag-two' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
      
      Pull Xen bug-fixes from Konrad Rzeszutek Wilk:
       - More fixes in the vCPU PVHVM hotplug path.
       - Add more documentation.
       - Fix various ARM related issues in the Xen generic drivers.
       - Updates in the xen-pciback driver per Bjorn's updates.
       - Mask the x2APIC feature for PV guests.
      
      * tag 'stable/for-linus-3.10-rc0-tag-two' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
        xen/pci: Used cached MSI-X capability offset
        xen/pci: Use PCI_MSIX_TABLE_BIR, not PCI_MSIX_FLAGS_BIRMASK
        xen: clear IRQ_NOAUTOEN and IRQ_NOREQUEST
        xen: mask x2APIC feature in PV
        xen: SWIOTLB is only used on x86
        xen/spinlock: Fix check from greater than to be also be greater or equal to.
        xen/smp/pvhvm: Don't point per_cpu(xen_vpcu, 33 and larger) to shared_info
        xen/vcpu: Document the xen_vcpu_info and xen_vcpu
        xen/vcpu/pvhvm: Fix vcpu hotplugging hanging.
      607eeb0b
    • Linus Torvalds's avatar
      Merge tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 4c444501
      Linus Torvalds authored
      Pull second SCSI update from James "Jaj B" Bottomley:
       "This is the final round of SCSI patches for the merge window.  It
        consists mostly of driver updates (bnx2fc, ibmfc, fnic, lpfc,
        be2iscsi, pm80xx, qla4x and ipr).
      
        There's also the power management updates that complete the patches in
        Jens' tree, an iscsi refcounting problem fix from the last pull, some
        dif handling in scsi_debug fixes, a few nice code cleanups and an
        error handling busy bug fix."
      
      * tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (92 commits)
        [SCSI] qla2xxx: Update firmware link in Kconfig file.
        [SCSI] iscsi class, qla4xxx: fix sess/conn refcounting when find fns are used
        [SCSI] sas: unify the pointlessly separated enums sas_dev_type and sas_device_type
        [SCSI] pm80xx: thermal, sas controller config and error handling update
        [SCSI] pm80xx: NCQ error handling changes
        [SCSI] pm80xx: WWN Modification for PM8081/88/89 controllers
        [SCSI] pm80xx: Changed module name and debug messages update
        [SCSI] pm80xx: Firmware flash memory free fix, with addition of new memory region for it
        [SCSI] pm80xx: SPC new firmware changes for device id 0x8081 alone
        [SCSI] pm80xx: Added SPCv/ve specific hardware functionalities and relevant changes in common files
        [SCSI] pm80xx: MSI-X implementation for using 64 interrupts
        [SCSI] pm80xx: Updated common functions common for SPC and SPCv/ve
        [SCSI] pm80xx: Multiple inbound/outbound queue configuration
        [SCSI] pm80xx: Added SPCv/ve specific ids, variables and modify for SPC
        [SCSI] lpfc: fix up Kconfig dependencies
        [SCSI] Handle MLQUEUE busy response in scsi_send_eh_cmnd
        [SCSI] sd: change to auto suspend mode
        [SCSI] sd: use REQ_PM in sd's runtime suspend operation
        [SCSI] qla4xxx: Fix iocb_cnt calculation in qla4xxx_send_mbox_iocb()
        [SCSI] ufs: Correct the expected data transfersize
        ...
      4c444501
    • Linus Torvalds's avatar
      Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux · ac4e0109
      Linus Torvalds authored
      Pull idle update from Len Brown:
       "Add support for new Haswell-ULT CPU idle power states"
      
      * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux:
        intel_idle: initial C8, C9, C10 support
        tools/power turbostat: display C8, C9, C10 residency
      ac4e0109
    • Linus Torvalds's avatar
      Merge git://git.infradead.org/users/eparis/audit · c4cc75c3
      Linus Torvalds authored
      Pull audit changes from Eric Paris:
       "Al used to send pull requests every couple of years but he told me to
        just start pushing them to you directly.
      
        Our touching outside of core audit code is pretty straight forward.  A
        couple of interface changes which hit net/.  A simple argument bug
        calling audit functions in namei.c and the removal of some assembly
        branch prediction code on ppc"
      
      * git://git.infradead.org/users/eparis/audit: (31 commits)
        audit: fix message spacing printing auid
        Revert "audit: move kaudit thread start from auditd registration to kaudit init"
        audit: vfs: fix audit_inode call in O_CREAT case of do_last
        audit: Make testing for a valid loginuid explicit.
        audit: fix event coverage of AUDIT_ANOM_LINK
        audit: use spin_lock in audit_receive_msg to process tty logging
        audit: do not needlessly take a lock in tty_audit_exit
        audit: do not needlessly take a spinlock in copy_signal
        audit: add an option to control logging of passwords with pam_tty_audit
        audit: use spin_lock_irqsave/restore in audit tty code
        helper for some session id stuff
        audit: use a consistent audit helper to log lsm information
        audit: push loginuid and sessionid processing down
        audit: stop pushing loginid, uid, sessionid as arguments
        audit: remove the old depricated kernel interface
        audit: make validity checking generic
        audit: allow checking the type of audit message in the user filter
        audit: fix build break when AUDIT_DEBUG == 2
        audit: remove duplicate export of audit_enabled
        Audit: do not print error when LSMs disabled
        ...
      c4cc75c3
  3. 10 May, 2013 22 commits