Skip to content
  • John Stultz's avatar
    proc: add /proc/<pid>/timerslack_ns interface · 5de23d43
    John Stultz authored
    
    
    This patch provides a proc/PID/timerslack_ns interface which exposes a
    task's timerslack value in nanoseconds and allows it to be changed.
    
    This allows power/performance management software to set timer slack for
    other threads according to its policy for the thread (such as when the
    thread is designated foreground vs.  background activity)
    
    If the value written is non-zero, slack is set to that value.  Otherwise
    sets it to the default for the thread.
    
    This interface checks that the calling task has permissions to to use
    PTRACE_MODE_ATTACH_FSCREDS on the target task, so that we can ensure
    arbitrary apps do not change the timer slack for other apps.
    
    Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
    Acked-by: default avatarKees Cook <keescook@chromium.org>
    Cc: Arjan van de Ven <arjan@linux.intel.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Oren Laadan <orenl@cellrox.com>
    Cc: Ruchi Kandoi <kandoiruchi@google.com>
    Cc: Rom Lemarchand <romlem@android.com>
    Cc: Android Kernel Team <kernel-team@android.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    5de23d43