From: Peter Zijlstra <peterz@infradead.org>
To: Cheng Xu <chengxu@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>,
Paul Mckenney <paulmck@linux.vnet.ibm.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sched: rt_rq runtime leakage bug fix
Date: Thu, 12 May 2011 12:12:30 +0200 [thread overview]
Message-ID: <1305195150.2914.268.camel@laptop> (raw)
In-Reply-To: <4DCAC79A.7050505@linux.vnet.ibm.com>
On Thu, 2011-05-12 at 01:30 +0800, Cheng Xu wrote:
>
> I tried but hit a boot-time error "Unable to handle kernel paging
> request for data at address 0x100000008", and therefore would like to
> propose an alternative patch like,
>
I probably made a silly mistake somehwere, it was after all something
quickly typed in an email :-)
> #define for_each_rt_rq(rt_rq, iter, rq) \
> for (iter = list_entry_rcu(task_groups.next, typeof(*iter), list); \
> (&iter->list != &task_groups) && (rt_rq = iter->rt_rq[cpu_of(rq)]); \
> iter = list_entry_rcu(iter->list.next, typeof(*iter), list))
>
> This worked, it seems to pass the tests. Is this correct from a scheduler perspective?
Creative ;-), it would be nice to know why the , operator version
doesn't work though, since that looks to be the more conventional way to
write it.
That said, I don't see a problem with using your existing on.
> For the not CONFIG_RT_GROUP_SCHED part, I used
>
> typedef struct rt_rq *rt_rq_iter_t;
>
> #define for_each_rt_rq(rt_rq, iter, rq) \
> (void) iter; \
> for (rt_rq = &rq->rt; rt_rq; rt_rq = NULL)
>
> An alternative is
> #define for_each_rt_rq(rt_rq, iter, rq) \
> for (rt_rq = iter = &rq->rt; iter; rt_rq = iter = NULL)
Tough call that, the first has a multi-statement macro, which is
generally discouraged because then:
for()
for_each_rt_rq() {
}
will not work as expected, so I think we want the second version.
> The patch is attached below. Could you check whether it is workable? Thank you.
Yes, given how things are I can't really see it getting any better,
thanks!
next prev parent reply other threads:[~2011-05-12 10:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-11 7:34 [PATCH] sched: rt_rq runtime leakage bug fix Cheng Xu
2011-05-11 9:21 ` Peter Zijlstra
2011-05-11 17:30 ` Cheng Xu
2011-05-12 10:12 ` Peter Zijlstra [this message]
2011-05-12 10:55 ` Cheng Xu
2011-05-12 11:27 ` Peter Zijlstra
2011-05-14 5:48 ` Cheng Xu
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=1305195150.2914.268.camel@laptop \
--to=peterz@infradead.org \
--cc=chengxu@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulmck@linux.vnet.ibm.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