mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Paul Menage <menage@google.com>, Li Zefan <lizf@cn.fujitsu.com>,
	containers@lists.linux-foundation.org,
	jacob.jun.pan@linux.intel.com,
	Arjan van de Ven <arjan@linux.intel.com>,
	linux-kernel@vger.kernel.org, Matt Helsley <matthltc@us.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-api@vger.kernel.org
Subject: Re: [PATCH, v6 2/3] Implement timer slack notifier chain
Date: Mon, 14 Feb 2011 16:52:44 +0200	[thread overview]
Message-ID: <20110214145244.GB3666@shutemov.name> (raw)
In-Reply-To: <alpine.LFD.2.00.1102141428080.26192@localhost6.localdomain6>

On Mon, Feb 14, 2011 at 02:32:23PM +0100, Thomas Gleixner wrote:
> On Mon, 14 Feb 2011, Kirill A. Shutsemov wrote:
> 
> > From: Kirill A. Shutemov <kirill@shutemov.name>
> > 
> > Process can change its timer slack using prctl(). Timer slack notifier
> > call chain allows to react on such change or forbid it.
> 
> So we add a notifier call chain and more exports to allow what ?

To allow the cgroup contoller validate the value.

> > --- a/kernel/sys.c
> > +++ b/kernel/sys.c
> > @@ -1691,15 +1691,10 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
> >  			error = perf_event_task_enable();
> >  			break;
> >  		case PR_GET_TIMERSLACK:
> > -			error = current->timer_slack_ns;
> > +			error = prctl_get_timer_slack();
> 
>   What's the point of replacing current->timer_slack_ns with a
>   function which does exactly the same ?

To keep it consistent. BTW, prctl_get_seccomp() does the same.

> 
> > +long prctl_set_timer_slack(long timer_slack_ns)
> > +{
> > +	int err;
> > +
> > +	/* Reset timer slack to default value */
> > +	if (timer_slack_ns <= 0) {
> > +		current->timer_slack_ns = current->default_timer_slack_ns;
> > +		return 0;
> 
>   That does not make any sense at all. Why is setting
>   default_timer_slack_ns not subject to validation ?

Hm.. In case of cgroup_timer_slack it's always valid.
But, yes, in general, we should validate it.

>   Why is it treaded seperately ?

What do you mean?

> > +	}
> > +
> > +	err = blocking_notifier_call_chain(&timer_slack_notify_list,
> > +			timer_slack_ns, NULL);
> > +	if (err == NOTIFY_DONE)
> > +		current->timer_slack_ns = timer_slack_ns;
> > +
> > +	return notifier_to_errno(err);
> 
> Thanks,
> 
> 	tglx

-- 
 Kirill A. Shutemov

  reply	other threads:[~2011-02-14 14:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-14 13:06 [PATCH, v6 0/3] Introduce timer slack controller Kirill A. Shutsemov
2011-02-14 13:06 ` [PATCH, v6 1/3] cgroups: export cgroup_iter_{start,next,end} Kirill A. Shutsemov
2011-02-14 13:27   ` Thomas Gleixner
2011-02-14 14:39     ` Kirill A. Shutemov
2011-02-14 15:09       ` Thomas Gleixner
2011-02-14 13:06 ` [PATCH, v6 2/3] Implement timer slack notifier chain Kirill A. Shutsemov
2011-02-14 13:32   ` Thomas Gleixner
2011-02-14 14:52     ` Kirill A. Shutemov [this message]
2011-02-14 15:16       ` Thomas Gleixner
2011-02-14 13:06 ` [PATCH, v6 3/3] cgroups: introduce timer slack controller Kirill A. Shutsemov
2011-02-14 13:59   ` Matt Helsley
2011-02-14 22:59     ` Kirill A. Shutemov
2011-02-15  0:00       ` Matt Helsley
2011-02-15  0:10         ` Kirill A. Shutemov
2011-02-14 14:00   ` Thomas Gleixner
2011-02-14 15:19     ` Kirill A. Shutemov
2011-02-14 17:01       ` Thomas Gleixner
2011-02-14 22:39         ` Kirill A. Shutemov
2011-02-14 23:39           ` Matt Helsley
2011-02-15  6:04           ` Thomas Gleixner
2011-02-14 13:26 ` [PATCH, v6 0/3] Introduce " 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=20110214145244.GB3666@shutemov.name \
    --to=kirill@shutemov.name \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@linux.intel.com \
    --cc=containers@lists.linux-foundation.org \
    --cc=jacob.jun.pan@linux.intel.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=matthltc@us.ibm.com \
    --cc=menage@google.com \
    --cc=tglx@linutronix.de \
    /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®