mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Arjan van de Ven <arjan@linux.intel.com>
Cc: John Stultz <john.stultz@linaro.org>,
	lkml <linux-kernel@vger.kernel.org>,
	Ruchi Kandoi <kandoiruchi@google.com>,
	Oren Laadan <orenl@cellrox.com>, Micha Kalfon <micha@cellrox.com>,
	Rom Lemarchand <romlem@android.com>,
	Android Kernel Team <kernel-team@android.com>
Subject: Re: [RFC][PATCH v2] prctl: Add PR_SET_TIMERSLACK_PID for setting timer slack of an arbitrary thread.
Date: Wed, 27 Jan 2016 12:15:47 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.11.1601271214170.3886@nanos> (raw)
In-Reply-To: <56A774D8.5020401@linux.intel.com>

On Tue, 26 Jan 2016, Arjan van de Ven wrote:
> On 1/25/2016 8:28 PM, John Stultz wrote:
> > From: Ruchi Kandoi <kandoiruchi@google.com>
> > 
> > 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.
> 
> Acked-by: Arjan van de Ven <arjan@linux.intel.com>
> 
> only slight concern is the locking around the value of the field in the task
> struct,
> but nobody does read-modify-write on it, so they'll get either the new or the
> old version,
> which should be ok.
> 
> (until now only the local thread would touch the field, and if you're setting
> it, by definition
> you're not going to sleep yet, so you're not using the field)

Even if you access it remote, it's a non issue. The task will see either the
old or the new value. Which is equally true when you add locking around the
write.

Thanks,

	tglx

  reply	other threads:[~2016-01-27 11:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-26  4:28 John Stultz
2016-01-26 13:30 ` Arjan van de Ven
2016-01-27 11:15   ` Thomas Gleixner [this message]
2016-01-27 11:14 ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.11.1601271214170.3886@nanos \
    --to=tglx@linutronix.de \
    --cc=arjan@linux.intel.com \
    --cc=john.stultz@linaro.org \
    --cc=kandoiruchi@google.com \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=micha@cellrox.com \
    --cc=orenl@cellrox.com \
    --cc=romlem@android.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®