From: Steven Rostedt <rostedt@goodmis.org>
To: Xunlei Pang <xlpang@redhat.com>
Cc: linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH v2 1/3] sched/core: Clear the root_domain cpumasks in init_rootdomain()
Date: Thu, 3 Dec 2015 10:26:57 -0500 [thread overview]
Message-ID: <20151203102657.44609f0b@gandalf.local.home> (raw)
In-Reply-To: <1449117901-9561-1-git-send-email-xlpang@redhat.com>
On Thu, 3 Dec 2015 12:44:59 +0800
Xunlei Pang <xlpang@redhat.com> wrote:
> root_domain::rto_mask allocated through alloc_cpumask_var()
> contains garbage data with CONFIG_CPUMASK_OFFSTACK set, this
> may cause problems. For instance, When doing pull_rt_task(),
> it may do useless iterations if rto_mask retains some extra
> garbage bits. Worse still, this can violate the isolated domain
> rule for clustered scheduling using cpuset, because the tasks
> (with all the cpus allowed) which belongs to one root domain
> can be pulled away into another root domain.
I really hate the fact that alloc_cpumask_var() behaves differently
depending on weather or not CONFIG_CPUMASK_OFFSTACK is defined or not.
I wonder if the better solution is to pass the __GFP_ZERO into
allocating the cpu mask when CPUMASK_OFFSTACK is defined. This will
prevent other areas from having this same bug. Also, I doubt any
allocations of cpumasks is in performance critical sections.
Or at least see if the address passed in is already null, which tells
us that something already cleared it. Like in this case the
memset(rd, 0, sizeof(*rd)).
Have something like:
bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node)
{
if ((long)*mask == 0)
flags |= __GFP_ZERO;
Maybe I'll post a patch to do this.
>
> The patch cleans the garbage by passing alloc_cpumask_var()
> with an extra __GFP_ZERO for root_domain::rto_mask allocation,
> thereby addressing the issues.
>
> Do the same thing for root_domain's other cpumask memembers:
> dlo_mask, span, and online.
Acked-by: Steven Rostedt <rostedt@goodmis.org>
-- Steve
>
> Signed-off-by: Xunlei Pang <xlpang@redhat.com>
> ---
prev parent reply other threads:[~2015-12-03 15:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-03 4:44 Xunlei Pang
2015-12-03 4:45 ` [PATCH v2 2/3] sched/cpupri: Cleanup of duplicate memory initialization Xunlei Pang
2015-12-03 4:45 ` [PATCH v2 3/3] sched/cpudeadline: " Xunlei Pang
2015-12-03 15:26 ` Steven Rostedt [this message]
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=20151203102657.44609f0b@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=xlpang@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®