Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1397109
| Path | csiph.com!news.freedyn.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Peter Zijlstra <peterz@infradead.org> |
| Newsgroups | linux.kernel |
| Subject | Re: [RFC][PATCH 2/7] sched: Restructure destroy_sched_domain() |
| Date | Mon, 09 May 2016 16:50:01 +0200 |
| Message-ID | <rwUFr-7AA-5@gated-at.bofh.it> (permalink) |
| References | <rwR4S-3QS-9@gated-at.bofh.it> <rwR4S-3QS-15@gated-at.bofh.it> |
| X-Original-To | mingo@kernel.org, linux-kernel@vger.kernel.org |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| User-Agent | Mutt/1.5.21 (2012-12-30) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 62 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | clm@fb.com, matt@codeblueprint.co.uk, mgalbraith@suse.de, tglx@linutronix.de, fweisbec@gmail.com |
| X-Original-Date | Mon, 9 May 2016 16:46:11 +0200 |
| X-Original-Message-ID | <20160509144611.GB3408@twins.programming.kicks-ass.net> |
| X-Original-References | <20160509104807.284575300@infradead.org> <20160509105210.506989560@infradead.org> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1397109 |
Show key headers only | View raw
On Mon, May 09, 2016 at 12:48:09PM +0200, Peter Zijlstra wrote:
> There is no point in doing a call_rcu() for each domain, only do a
> callback for the root sched domain and clean up the entire set in one
> go.
>
> Also make the entire call chain be called destroy_sched_domain*() to
> remove confusion with the free_sched_domains() call, which does an
> entirely different thing.
>
> Both cpu_attach_domain() callers of destroy_sched_domain() can live
> without the call_rcu() because at those points the sched_domain hasn't
> been published yet.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
This one seems to work much better; so much for last minute 'cleanups'.
---
kernel/sched/core.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5824,10 +5824,8 @@ static void free_sched_groups(struct sch
} while (sg != first);
}
-static void free_sched_domain(struct rcu_head *rcu)
+static void destroy_sched_domain(struct sched_domain *sd)
{
- struct sched_domain *sd = container_of(rcu, struct sched_domain, rcu);
-
/*
* If its an overlapping domain it has private groups, iterate and
* nuke them all.
@@ -5841,15 +5839,21 @@ static void free_sched_domain(struct rcu
kfree(sd);
}
-static void destroy_sched_domain(struct sched_domain *sd)
+static void destroy_sched_domains_rcu(struct rcu_head *rcu)
{
- call_rcu(&sd->rcu, free_sched_domain);
+ struct sched_domain *sd = container_of(rcu, struct sched_domain, rcu);
+
+ while (sd) {
+ struct sched_domain *parent = sd->parent;
+ destroy_sched_domain(sd);
+ sd = parent;
+ }
}
static void destroy_sched_domains(struct sched_domain *sd)
{
- for (; sd; sd = sd->parent)
- destroy_sched_domain(sd);
+ if (sd)
+ call_rcu(&sd->rcu, destroy_sched_domains_rcu);
}
/*
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[RFC][PATCH 2/7] sched: Restructure destroy_sched_domain() Peter Zijlstra <peterz@infradead.org> - 2016-05-09 13:00 +0200 Re: [RFC][PATCH 2/7] sched: Restructure destroy_sched_domain() Peter Zijlstra <peterz@infradead.org> - 2016-05-09 16:50 +0200
csiph-web