From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754174AbcA0LPX (ORCPT ); Wed, 27 Jan 2016 06:15:23 -0500 Received: from www.linutronix.de ([62.245.132.108]:42566 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752101AbcA0LPS (ORCPT ); Wed, 27 Jan 2016 06:15:18 -0500 Date: Wed, 27 Jan 2016 12:14:14 +0100 (CET) From: Thomas Gleixner To: John Stultz cc: lkml , Ruchi Kandoi , Arjan van de Ven , Oren Laadan , Micha Kalfon , Rom Lemarchand , Android Kernel Team Subject: Re: [RFC][PATCH v2] prctl: Add PR_SET_TIMERSLACK_PID for setting timer slack of an arbitrary thread. In-Reply-To: <1453782484-3887-1-git-send-email-john.stultz@linaro.org> Message-ID: References: <1453782484-3887-1-git-send-email-john.stultz@linaro.org> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001,URIBL_BLOCKED=0.001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 25 Jan 2016, John Stultz wrote: > From: Ruchi Kandoi > > 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) > > Second argument is similar to PR_SET_TIMERSLACK, if non-zero > then the slack is set to that value otherwise sets it to the > default for the thread. > > Takes PID of the thread as the third argument. > > This interface checks that the calling task has permissions to > to use PTRACE_MODE_ATTACH on the target task, so that we can > ensure arbitrary apps do not change the timer slack for other > apps. > > Additional fixes from Ruchi and Micha Kalfon > have been folded into this patch to make it easier to reivew. > > Cc: Arjan van de Ven > Cc: Thomas Gleixner > Cc: Oren Laadan > Cc: Micha Kalfon > Cc: Ruchi Kandoi > Cc: Rom Lemarchand > Cc: Android Kernel Team > Signed-off-by: Ruchi Kandoi > [jstultz: > * Folded in CAP_SYS_NICE check from Ruchi. > * Folded in fix misplaced PR_SET_TIMERSLACK_PID case fix from > Micha. > * Folded in make PR_SET_TIMERSLACK_PID pid namespace aware fix > from Micha. > * Changed PR_SET_TIMERSLACK_PID so it didn't collide with > already upstream prctrl values. > * Reworked commit message. > * Moved from CAP_SYS_NICE to PTRACE_MODE_ATTACH for permissions > checks] > Signed-off-by: John Stultz Reviewed-by: Thomas Gleixner