login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
March
»
5
Re: [PATCH -v2] balance RT task resched only on runqueue
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Peter Zijlstra
Subject:
Re: [PATCH -v2] balance RT task resched only on runqueue
Date: Wednesday, March 5, 2008 - 8:02 am
On Wed, 2008-03-05 at 10:00 -0500, Steven Rostedt wrote:
quoted text
> [ > Update: I didn't like the task_rq(p), so I changed the test to be > rq->curr == p. No need to resched if the p isn't running. And > I think this is a bit cleaner. > ] > > In the RT kernel we discovered a place that can reschedule a task > without holding the tasks runqueue lock. This was caused by the RT > balancing code that pulls RT tasks to the current run queue and will > reschedule the current task. > > There's a slight chance that the pulling of the RT tasks will release > the current runqueue's lock and retake it (in the double_lock_balance). > During this time that the runqueue is released, the current task can > migrate to another runqueue. > > In the prio_changed_rt code, after the pull, if the current task is of > lesser priority than one of the RT tasks pulled, resched_task is called > on the current task. If the current task had migrated in that small > window, resched_task will be called without holding the runqueue lock > for the runqueue that the task is on. > > This race condition also exists in the mainline kernel and this patch > adds a check to make sure the task hasn't migrated before calling > resched_task. > > Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
quoted text
> --- > kernel/sched_rt.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > Index: linux-compile.git/kernel/sched_rt.c > =================================================================== > --- linux-compile.git.orig/kernel/sched_rt.c 2008-03-05 09:31:22.000000000 -0500 > +++ linux-compile.git/kernel/sched_rt.c 2008-03-05 09:53:00.000000000 -0500 > @@ -1107,9 +1107,11 @@ static void prio_changed_rt(struct rq *r > pull_rt_task(rq); > /* > * If there's a higher priority task waiting to run > - * then reschedule. > + * then reschedule. Note, the above pull_rt_task > + * can release the rq lock and p could migrate. > + * Only reschedule if p is still on the same runqueue. > */ > - if (p->prio > rq->rt.highest_prio) > + if (p->prio > rq->rt.highest_prio && rq->curr == p) > resched_task(p); > #else > /* For UP simply resched on drop of prio */ > >
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] balance RT task resched only on runqueue
, Steven Rostedt
, (Wed Mar 5, 7:41 am)
[PATCH -v2] balance RT task resched only on runqueue
, Steven Rostedt
, (Wed Mar 5, 8:00 am)
Re: [PATCH -v2] balance RT task resched only on runqueue
, Peter Zijlstra
, (Wed Mar 5, 8:02 am)
Re: [PATCH] balance RT task resched only on runqueue
, Ingo Molnar
, (Wed Mar 5, 8:24 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
David Howells
Re: [PATCH 5/5]bluetooth:hci_bcsp Fix operation on 'bcsp->msgq_txseq' may be un...
Francis Moreau
Re: Disk geometry from /sys
Eberhard Moenkeberg
Re: OT: character encodings (was: Linux 2.6.20-rc4)
Rafael J. Wysocki
[Bug #11551] Semi-repeatable hard lockup on 2.6.27-rc6
Mike Galbraith
Re: [ANNOUNCE/RFC] Really Fair Scheduler
git
:
Mark Junker
git on MacOSX and files with decomposed utf-8 file names
Pat Thoyts
[PATCH] git-gui: use themed tk widgets with Tk 8.5
Michael Witten
Re: 'git gc --aggressive' effectively unusable
Petko Manolov
git and binary files
Lynn Lin
Re: clearcase migration to git
git-commits-head
:
Linux Kernel Mailing List
[ARM] unconditionally define __virt_to_phys and __phys_to_virt
Linux Kernel Mailing List
ACPICA: Fix to allow zero-length ASL field declarations
Linux Kernel Mailing List
tracing: Simplify trace_option_write()
Linux Kernel Mailing List
ARM: Add Versatile Express SMP support
Linux Kernel Mailing List
ixgbe: fix automatic LRO/RSC settings for low latency
linux-netdev
:
David Miller
Re: [PATCH 32/53] netns xfrm: finding policy in netns
William Allen Simpson
[net-next-2.6 PATCH v8 0/7] TCPCT part 1: cookie option exchange
David Miller
Re: [PATCH] IPv6: preferred lifetime of address not getting updated
Eric Dumazet
Re: [PATCH net-next-2.6] net: Introduce skb_orphan_try()
Mark McLoughlin
Re: [PATCH 2/3] virtio: fix delayed xmit of packet and freeing of old packets.
openbsd-misc
:
Samuel Baldwin
Re: Forum engine
Robert
disklabel - cylinder rounding
nixlists
Re: Which laptops do the developers use?
Marcin
Re: 4.6 reboots x336 ibm server(s)
L. V. Lammert
OT, .. but has anyone seen a crontab editor
Colocation donated by:
Syndicate