From: Ingo Molnar <mingo@elte.hu>
To: "Milton D. Miller II" <miltonm@realtime.net>
Cc: Paul Jackson <pj@sgi.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fix sched_domain sysctl registration again
Date: Sun, 21 Oct 2007 09:43:01 +0200 [thread overview]
Message-ID: <20071021074301.GA14368@elte.hu> (raw)
In-Reply-To: <200710201941.l9KJfIGL008482@sullivan.realtime.net>
* Milton D. Miller II <miltonm@realtime.net> wrote:
> commit 029190c515f15f512ac85de8fc686d4dbd0ae731 (cpuset
> sched_load_balance flag) was not tested SCHED_DEBUG enabled as
> committed as it dereferences NULL when used and it reordered the
> sysctl registration to cause it to never show any domains or their
> tunables.
>
> Fixes:
>
> 1) restore arch_init_sched_domains ordering
> we can't walk the domains before we build them
>
> presently we register cpus with empty directories (no domain
> directories or files).
>
> 2) make unregister_sched_domain_sysctl do nothing when already unregistered
> detach_destroy_domains is now called one set of cpus at a time
> unregister_syctl dereferences NULL if called with a null.
>
> While the the function would always dereference null if called
> twice, in the previous code it was always called once and then
> was followed a register. So only the hidden bug of the
> sysctl_root_table not being allocated followed by an attempt to
> free it would have shown the error.
>
> 3) always call unregister and register in partition_sched_domains
> The code is "smart" about unregistering only needed domains.
> Since we aren't guaranteed any calls to unregister, always
> unregister. Without calling register on the way out we
> will not have a table or any sysctl tree.
>
> 4) warn if register is called without unregistering
> The previous table memory is lost, leaving pointers to the
> later freed memory in sysctl and leaking the memory of the
> tables.
thanks, applied.
Ingo
next prev parent reply other threads:[~2007-10-21 7:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-20 19:41 [PATCH] Fix sched_domain sysctl registration again Milton D. Miller II
2007-10-21 7:43 ` Ingo Molnar [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-10-20 19:48 Milton Miller
2007-10-21 2:46 ` Paul Jackson
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=20071021074301.GA14368@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miltonm@realtime.net \
--cc=pj@sgi.com \
--cc=torvalds@linux-foundation.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