From: "Jan Beulich" <JBeulich@suse.com>
To: "Peter Zijlstra" <peterz@infradead.org>
Cc: <mingo@redhat.com>, "Rik van Riel" <riel@redhat.com>,
<linux-kernel@vger.kernel.org>
Subject: Re: sched/fair: avoid using uninitialized variable in preferred_group_nid()
Date: Fri, 23 Jan 2015 10:01:13 +0000 [thread overview]
Message-ID: <54C229F902000078000589FD@mail.emea.novell.com> (raw)
In-Reply-To: <20150123095449.GL2896@worktop.programming.kicks-ass.net>
>>> On 23.01.15 at 10:54, <peterz@infradead.org> wrote:
> On Fri, Jan 23, 2015 at 08:25:38AM +0000, Jan Beulich wrote:
>> At least some gcc versions - validly afaict - warn about potentially
>> using max_group uninitialized: There's no way the compiler can prove
>> that the body of the conditional where it and max_faults get set/
>> updated gets executed; in fact, without knowing all the details of
>> other scheduler code, I can't prove this either.
>>
>> Generally the necessary change would appear to be to clear max_group
>> prior to entering the inner loop, and break out of the outer loop when
>> it ends up being all clear after the inner one. This, however, seems
>> inefficient, and afaict the same effect can be achieved by exiting the
>> outer loop when max_faults is still zero after the inner loop. For the
>> compiler's sake, mark max_group uninitialized, as we're now able to
>> prove it's not actually being used uninitalized anymore.
>
>
> Yes this is somewhat challenging. What compiler version in specific did
> you get this warning wiht? I cannot remember seeing it with whatever it
> is I use (4.7-4.9 it seems).
SLE11 SP3's gcc (4.3.4 based).
Jan
next prev parent reply other threads:[~2015-01-23 10:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-23 8:25 Jan Beulich
2015-01-23 9:54 ` Peter Zijlstra
2015-01-23 10:01 ` Jan Beulich [this message]
2015-01-28 14:29 ` [tip:sched/urgent] sched/fair: Avoid " tip-bot for Jan Beulich
2015-01-28 14:46 ` Jan Beulich
2015-01-28 15:37 ` Peter Zijlstra
2015-02-09 8:21 ` Ingo Molnar
2015-02-09 11:37 ` Peter Zijlstra
2015-02-09 11:41 ` Jan Beulich
2015-02-18 17:10 ` [tip:sched/core] sched/numa: Avoid some pointless iterations tip-bot for Jan Beulich
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=54C229F902000078000589FD@mail.emea.novell.com \
--to=jbeulich@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=riel@redhat.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 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®