mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ken Chen <kenchen@google.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [patch] sched: add locking when update the task_group's cfs_rq[]  array.
Date: Wed, 19 Nov 2008 09:21:46 -0800	[thread overview]
Message-ID: <b040c32a0811190921g557edc4dy4725fb86107c2c54@mail.gmail.com> (raw)
In-Reply-To: <1227113662.29743.46.camel@lappy.programming.kicks-ass.net>

On Wed, Nov 19, 2008 at 8:54 AM, Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> On Tue, 2008-11-18 at 22:48 -0800, Ken Chen wrote:
>> add locking when update the task_group's cfs_rq[] array.  tg_shares_up()
>> can be potentially executed concurrently on multiple CPUs with overlaping
>> cpu mask depending on where task_cpu() was when a task got woken up.  Lack
>> of any locking while redistribute tg->shares over cfs_rq[] array opens up
>> a large window for conflict updates and utimately cause corruptions to the
>> integrity of per cpu cfs_rq shares. Add a tg_lock to protect the operations.
>
> I see why you want to do this, but introducing a global lock makes me
> sad :/

I wholly agree on the scalability.  The bigger the system, the more it
needs to protect the integrity of cfs_rq[]->shares that the sum still
adds up to tg->shares.  Otherwise, the share distributed on each CPU's
cfs_rq might go wildly and indirectly leads to fluctuation of
effective total tg->shares.  However, I have the same doubt that this
will scale on large CPU system.  Does CFS really have to iterate the
whole task_group tree?

- Ken

  reply	other threads:[~2008-11-19 17:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-19  6:48 Ken Chen
2008-11-19  7:53 ` Ingo Molnar
2008-11-19  8:22   ` Ken Chen
2008-11-19 16:54 ` Peter Zijlstra
2008-11-19 17:21   ` Ken Chen [this message]
2008-11-19 20:58     ` Peter Zijlstra
2008-11-19 21:50       ` Chris Friesen
2008-11-22 10:09         ` Peter Zijlstra

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=b040c32a0811190921g557edc4dy4725fb86107c2c54@mail.gmail.com \
    --to=kenchen@google.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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®