* [PATCH] Avoid race in schedule() when switching schedulers
@ 2011-09-13 10:36 Juergen Gross
2011-09-14 8:51 ` George Dunlap
0 siblings, 1 reply; 2+ messages in thread
From: Juergen Gross @ 2011-09-13 10:36 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 254 bytes --]
Selecting the scheduler to call must be done under lock. Otherwise a race
might occur when switching schedulers in a cpupool
Signed-off-by: juergen.gross@ts.fujitsu.com
1 file changed, 2 insertions(+), 1 deletion(-)
xen/common/schedule.c | 3 ++-
[-- Attachment #2: xen-staging.hg.patch --]
[-- Type: text/x-patch, Size: 1279 bytes --]
# HG changeset patch
# User Juergen Gross <juergen.gross@ts.fujitsu.com>
# Date 1315910154 -7200
# Node ID 86f2a3a45ecbcc49aba88d06bf13bbcaf5a9b89b
# Parent 64aab9a077ea937b31fd678b02f755139b924184
Avoid race in schedule() when switching schedulers
Selecting the scheduler to call must be done under lock. Otherwise a race
might occur when switching schedulers in a cpupool
Signed-off-by: juergen.gross@ts.fujitsu.com
diff -r 64aab9a077ea -r 86f2a3a45ecb xen/common/schedule.c
--- a/xen/common/schedule.c Tue Sep 13 11:20:57 2011 +0100
+++ b/xen/common/schedule.c Tue Sep 13 12:35:54 2011 +0200
@@ -1107,7 +1107,7 @@ static void schedule(void)
{
struct vcpu *prev = current, *next = NULL;
s_time_t now = NOW();
- struct scheduler *sched = this_cpu(scheduler);
+ struct scheduler *sched;
unsigned long *tasklet_work = &this_cpu(tasklet_work_to_do);
bool_t tasklet_work_scheduled = 0;
struct schedule_data *sd;
@@ -1141,6 +1141,7 @@ static void schedule(void)
stop_timer(&sd->s_timer);
/* get policy-specific decision on scheduling... */
+ sched = this_cpu(scheduler);
next_slice = sched->do_schedule(sched, now, tasklet_work_scheduled);
next = next_slice.task;
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Avoid race in schedule() when switching schedulers
2011-09-13 10:36 [PATCH] Avoid race in schedule() when switching schedulers Juergen Gross
@ 2011-09-14 8:51 ` George Dunlap
0 siblings, 0 replies; 2+ messages in thread
From: George Dunlap @ 2011-09-14 8:51 UTC (permalink / raw)
To: Juergen Gross; +Cc: xen-devel
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
On Tue, Sep 13, 2011 at 11:36 AM, Juergen Gross
<juergen.gross@ts.fujitsu.com> wrote:
> Selecting the scheduler to call must be done under lock. Otherwise a race
> might occur when switching schedulers in a cpupool
>
> Signed-off-by: juergen.gross@ts.fujitsu.com
>
>
> 1 file changed, 2 insertions(+), 1 deletion(-)
> xen/common/schedule.c | 3 ++-
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-09-14 8:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-13 10:36 [PATCH] Avoid race in schedule() when switching schedulers Juergen Gross
2011-09-14 8:51 ` George Dunlap
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.