All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacob Pan <jacob.jun.pan-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: "Kirill A. Shutemov" <kirill-oKw7cIdHH8eLwutG50LtGA@public.gmane.org>
Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Paul Menage <menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	"Paul E. McKenney"
	<paulmck-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>,
	Arjan van de Ven <arjan-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Subject: Re: [PATCH, v3 2/2] cgroups: introduce timer slack subsystem
Date: Thu, 3 Feb 2011 09:51:17 -0800	[thread overview]
Message-ID: <20110203095117.76a568fc__10556.8012375899$1296755793$gmane$org@putvin> (raw)
In-Reply-To: <20110203092229.GB1083-oKw7cIdHH8eLwutG50LtGA@public.gmane.org>

On Thu, 3 Feb 2011 11:22:29 +0200
"Kirill A. Shutemov" <kirill-oKw7cIdHH8eLwutG50LtGA@public.gmane.org> wrote:

> On Wed, Feb 02, 2011 at 02:56:05PM -0800, jacob pan wrote:
> > On Wed,  2 Feb 2011 22:47:36 +0200
> > "Kirill A. Shutsemov" <kirill-oKw7cIdHH8eLwutG50LtGA@public.gmane.org> wrote:
> > 
> > > From: Kirill A. Shutemov <kirill-oKw7cIdHH8eLwutG50LtGA@public.gmane.org>
> > > 
> > > Provides a way of tasks grouping by timer slack value. Introduces
> > > per cgroup max and min timer slack value. When a task attaches to
> > > a cgroup, its timer slack value adjusts (if needed) to fit min-max
> > > range.
> > > 
> > > It also provides a way to set timer slack value for all tasks in
> > > the cgroup at once.
> > > 
> > > This functionality is useful in mobile devices where certain
> > > background apps are attached to a cgroup and minimum wakeups are
> > > desired.
> > > 
> > > Signed-off-by: Kirill A. Shutemov <kirill-oKw7cIdHH8eLwutG50LtGA@public.gmane.org>
> > > Idea-by: Jacob Pan <jacob.jun.pan-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
> > > ---
> > >  include/linux/cgroup_subsys.h |    6 +
> > >  include/linux/init_task.h     |    4 +-
> > >  init/Kconfig                  |   10 ++
> > >  kernel/Makefile               |    1 +
> > >  kernel/cgroup_timer_slack.c   |  242
> > > +++++++++++++++++++++++++++++++++++++++++
> > 


> > 
> > > +
> > > +static struct cftype files[] = {
> > > +	{
> > > +		.name = "set_slack_ns",
> > > +		.write_u64 = tslack_write_set_slack_ns,
> > > +	},
> > should we also allow reading of the current slack_ns?
> 
> There is no 'current slack_ns' for a cgroup since any process free to
> change it with prctl().
> 

I think there is still a need for current slack_ns. e.g. if i created a
cgroup_1 then attach task_A and task_B to it such that their
individual timer_slack got adjusted based on the limit in the
cgroup. Now I set cgroup_1 timer_slack to be ts_1, then timer_slack
for both task_A and task_B are set to ts_1.

If i attach another task_C to cgroup_1, timer_slack for task_C will be
adjusted based on min/max setting of cgroup_1, which can be different
than ts_1. User has to manually set cgroup time_slack again to make them
identical.

I think this logic defeats the purpose of having timer_slack
subsystem in the first place. IMHO, the original intention was to have
grouping effect of tasks in the cgroup.

So my suggestion is to keep a per cgroup current timer_slack value,
which can be default to the system default at 50us. Like Arjan
suggested, we can enforce the timer_slack value in the timer code when
it is used. This way we can solve another problem where when a task is
detached from the cgroup, it would be desirable to restore its original
slack value.

  parent reply	other threads:[~2011-02-03 17:51 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 [this message]
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
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='20110203095117.76a568fc__10556.8012375899$1296755793$gmane$org@putvin' \
    --to=jacob.jun.pan-vuqaysv1563yd54fqh9/ca@public.gmane.org \
    --cc=arjan-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=kirill-oKw7cIdHH8eLwutG50LtGA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=paulmck-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
    /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.