All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Helsley <matthltc@us.ibm.com>
To: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Matt Helsley <matthltc@us.ibm.com>,
	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
Subject: Re: [PATCH, v3 2/2] cgroups: introduce timer slack subsystem
Date: Sat, 5 Feb 2011 18:49:51 -0800	[thread overview]
Message-ID: <20110206024951.GB16432@count0.beaverton.ibm.com> (raw)
In-Reply-To: <20110203094138.GD1083@shutemov.name>

On Thu, Feb 03, 2011 at 11:41:38AM +0200, Kirill A. Shutemov wrote:
> On Wed, Feb 02, 2011 at 09:46:16PM -0800, Matt Helsley wrote:
> > On Wed, Feb 02, 2011 at 10:47:36PM +0200, Kirill A. Shutsemov wrote:
> > > From: Kirill A. Shutemov <kirill@shutemov.name>

<snip>

> > > diff --git a/kernel/cgroup_timer_slack.c b/kernel/cgroup_timer_slack.c
> > > new file mode 100644
> > > index 0000000..a343a50
> > > --- /dev/null
> > > +++ b/kernel/cgroup_timer_slack.c

<snip>

> > > +static int tslack_write_set_slack_ns(struct cgroup *cgroup, struct cftype *cft,
> > > +		u64 val)
> > > +{
> > > +	struct timer_slack_cgroup *tslack_cgroup;
> > > +	struct cgroup_iter it;
> > > +	struct task_struct *task;
> > > +
> > > +	tslack_cgroup = cgroup_to_tslack_cgroup(cgroup);
> > > +	if (!val || val < tslack_cgroup->min_slack_ns ||
> > 
> > Why is a val of 0 disallowed? I know having slack is good, but for
> > an administrator or tool that doesn't care about number of wakeups
> > and cares more about wringing out performance a slack of
> > 0 seems acceptable. Is this just here to be consistent with the
> > values passed in via prctl?
> 
> Yes, it's to consistent with the prctl(). I don't think that it's good
> idea to allow to set timer_slack outside of range prctl() allows. It may
> lead to interface abuse.

Hmm, I was just thinking that 0 timer slack might be useful. But I
suppose you could just as easily set it to 1 and nobody would notice.

> > > +			val > tslack_cgroup->max_slack_ns )
> > > +		return -EINVAL;
> > 
> > Shouldn't it be EPERM and not EINVAL?
> > 
> > The write(2) man page says: "Other errors may occur, depending on the
> > object connected to fd." So I think EPERM is fine and more descriptive.
> 
> What do you think about -EINVAL for (val == 0) and -EPERM for rest?

OK, that makes sense to me given both of our points above.

Cheers,
	-Matt Helsley

  reply	other threads:[~2011-02-06  2:49 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-02 20:47 [PATCH, v3 0/2] Timer slack cgroup subsystem Kirill A. Shutsemov
2011-02-02 20:47 ` [PATCH, v3 1/2] cgroups: export cgroup_iter_{start,next,end} Kirill A. Shutsemov
2011-02-02 21:21   ` Paul Menage
     [not found]   ` <1296679656-31163-2-git-send-email-kirill-oKw7cIdHH8eLwutG50LtGA@public.gmane.org>
2011-02-02 21:21     ` Paul Menage
     [not found] ` <1296679656-31163-1-git-send-email-kirill-oKw7cIdHH8eLwutG50LtGA@public.gmane.org>
2011-02-02 20:47   ` Kirill A. Shutsemov
2011-02-02 20:47   ` [PATCH, v3 2/2] cgroups: introduce timer slack subsystem Kirill A. Shutsemov
2011-02-02 20:47 ` Kirill A. Shutsemov
2011-02-02 22:56   ` jacob pan
2011-02-03  9:22     ` Kirill A. Shutemov
2011-02-03  9:22     ` Kirill A. Shutemov
2011-02-03 17:51       ` Jacob Pan
2011-02-03 18:12         ` Paul Menage
     [not found]           ` <AANLkTikvkUT8+U=bX6X2n7kMbnAt6evxTy1BqiX+TWpH-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-02-03 19:57             ` Jacob Pan
2011-02-03 19:57           ` Jacob Pan
2011-02-04 13:34             ` Kirill A. Shutemov
2011-02-04 13:34             ` Kirill A. Shutemov
     [not found]               ` <20110204133439.GA7181-oKw7cIdHH8eLwutG50LtGA@public.gmane.org>
2011-02-04 17:27                 ` Jacob Pan
2011-02-04 17:27               ` Jacob Pan
2011-02-07  0:33                 ` Matt Helsley
2011-02-07  0:33                 ` Matt Helsley
2011-02-07 11:06                 ` Kirill A. Shutemov
2011-02-07 17:20                   ` Jacob Pan
2011-02-07 18:32                     ` Kirill A. Shutemov
2011-02-07 18:32                     ` Kirill A. Shutemov
     [not found]                   ` <20110207110603.GB11712-oKw7cIdHH8eLwutG50LtGA@public.gmane.org>
2011-02-07 17:20                     ` Jacob Pan
2011-02-07 11:06                 ` Kirill A. Shutemov
2011-02-03 18:12         ` Paul Menage
     [not found]       ` <20110203092229.GB1083-oKw7cIdHH8eLwutG50LtGA@public.gmane.org>
2011-02-03 17:51         ` Jacob Pan
2011-02-02 23:23   ` Paul Menage
2011-02-03  5:48     ` Matt Helsley
     [not found]     ` <AANLkTikAbmFmQNGgYMYhTOS8L5nU39edcTjQXNpdxGy2-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-02-03  5:48       ` Matt Helsley
2011-02-03  9:28       ` Kirill A. Shutemov
2011-02-03  9:28     ` Kirill A. Shutemov
     [not found]   ` <1296679656-31163-3-git-send-email-kirill-oKw7cIdHH8eLwutG50LtGA@public.gmane.org>
2011-02-02 22:56     ` jacob pan
2011-02-02 23:23     ` Paul Menage
2011-02-03  5:46     ` Matt Helsley
2011-02-03  5:46   ` Matt Helsley
     [not found]     ` <20110203054616.GT16432-52DBMbEzqgQ/wnmkkaCWp/UQ3DHhIser@public.gmane.org>
2011-02-03  9:41       ` Kirill A. Shutemov
2011-02-03  9:41     ` Kirill A. Shutemov
2011-02-06  2:49       ` Matt Helsley [this message]
2011-02-07  9:48         ` Kirill A. Shutemov
     [not found]         ` <20110206024951.GB16432-52DBMbEzqgQ/wnmkkaCWp/UQ3DHhIser@public.gmane.org>
2011-02-07  9:48           ` Kirill A. Shutemov
     [not found]       ` <20110203094138.GD1083-oKw7cIdHH8eLwutG50LtGA@public.gmane.org>
2011-02-06  2:49         ` Matt Helsley

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=20110206024951.GB16432@count0.beaverton.ibm.com \
    --to=matthltc@us.ibm.com \
    --cc=arjan@linux.intel.com \
    --cc=containers@lists.linux-foundation.org \
    --cc=jacob.jun.pan@linux.intel.com \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=menage@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.