All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Wang <wangyun@linux.vnet.ibm.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@elte.hu>, Paul Turner <pjt@google.com>,
	Mike Galbraith <efault@gmx.de>
Subject: [RFC] could we remove some work to reduce the overhead of cgroup?
Date: Mon, 26 Nov 2012 17:52:47 +0800	[thread overview]
Message-ID: <50B33BEF.4050304@linux.vnet.ibm.com> (raw)

Hi, Folks

I'm trying to find the place where we could reduce the overhead
of cgroup, especially when there is only root_task_group
(thanks for Peter's suggestion).

I found that no place is using the load info of root_task_group
and root cfs_rq currently, could we do some thing like below
to reduce the overhead?



diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 2cebc81..67cf709 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1515,6 +1515,13 @@ static void update_cfs_rq_blocked_load(struct cfs_rq *cfs_rq, int force_update)
        u64 now = cfs_rq_clock_task(cfs_rq) >> 20;
        u64 decays;
 
+       /*
+        * do not work on root cfs_rq and task group, since no one need their
+        * load info.
+        */
+       if (cfs_rq->tg && cfs_rq->tg == &root_task_group)
+               return;
+
        decays = now - cfs_rq->last_decay;
        if (!decays && !force_update)
                return;



There are other places we could save works if we stop calculate
the load info of root_task_group and root cfs_rq, like the update
work of blocked_load_avg, runnable_load_avg and tg_load_contrib.

Those info are used to calculate the load of cfs_rq, so we could
use that load when we calculate the parent cfs_rq's load sum, but
since root task group has no parent, those info should be useless.

Please let me know if you think this is wrong or you have better
idea on where we can reduce the overhead of cgroup.


Regards,
Michael Wang


                 reply	other threads:[~2012-11-26  9:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=50B33BEF.4050304@linux.vnet.ibm.com \
    --to=wangyun@linux.vnet.ibm.com \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=pjt@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.