mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org,
	mingo@kernel.org, fweisbec@gmail.com, pjt@google.com,
	rostedt@goodmis.org, efault@gmx.de
Subject: Re: [PATCH v6] sched: fix init NOHZ_IDLE flag
Date: Mon, 22 Apr 2013 11:30:52 +0200	[thread overview]
Message-ID: <1366623052.2721.6.camel@laptop> (raw)
In-Reply-To: <1366377044-23989-1-git-send-email-vincent.guittot@linaro.org>

On Fri, 2013-04-19 at 15:10 +0200, Vincent Guittot wrote:
> As suggested by Frederic Weisbecker, another solution is to have the
> same
> rcu lifecycle for both NOHZ_IDLE and sched_domain struct. I have
> introduce
> a new sched_domain_rq struct that is the entry point for both
> sched_domains
> and objects that must follow the same lifecycle like NOHZ_IDLE flags.
> They
> will share the same RCU lifecycle and will be always synchronized.
> 
> The synchronization is done at the cost of :
>  - an additional indirection for accessing the first sched_domain
> level
>  - an additional indirection and a rcu_dereference before accessing to
> the
>    NOHZ_IDLE flag.

> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index d35d2b6..61ad5f1 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -959,6 +959,18 @@ struct sched_domain {
>         unsigned long span[0];
>  };
>  
> +/*
> + * Some flags must stay synchronized with fields of sched_group_power
> and as a
> + * consequence they must follow the same lifecycle for the lockless
> scheme.
> + * sched_domain_rq encapsulates those flags and sched_domains in one
> RCU
> + * object.
> + */
> +struct sched_domain_rq {
> +       struct sched_domain *sd;
> +       unsigned long flags;
> +       struct rcu_head rcu;    /* used during destruction */
> +};

I'm not quite getting things.. what's wrong with adding this flags
thing to sched_domain itself? That's already RCU destroyed so why add a
second RCU layer?

We also have the root_domain for things that don't need to go in a
hierarchy but are once per cpu -- it sounds like this is one of those
things; iirc the root_domain life-time is the same as the entire
sched_domain tree so adding it to the root_domain is also an option.


  reply	other threads:[~2013-04-22  9:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-19 13:10 Vincent Guittot
2013-04-22  9:30 ` Peter Zijlstra [this message]
2013-04-22 11:01   ` Vincent Guittot
2013-04-22 11:39     ` Peter Zijlstra
2013-04-22 12:05       ` Vincent Guittot

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=1366623052.2721.6.camel@laptop \
    --to=peterz@infradead.org \
    --cc=efault@gmx.de \
    --cc=fweisbec@gmail.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=pjt@google.com \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.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 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®