* scheduling hrtimers while holding rq->lock
@ 2008-07-29 19:23 Daniel Rosenthal
2008-07-29 20:52 ` Peter Zijlstra
0 siblings, 1 reply; 2+ messages in thread
From: Daniel Rosenthal @ 2008-07-29 19:23 UTC (permalink / raw)
To: linux-kernel; +Cc: Ingo Molnar, Peter Zijlstra, Ulrich Drepper
What's the best way for scheduling code to start an hrtimer while
holding the rq->lock? I am trying to implement SCHED_SPORADIC
(sporadic server) in the realtime scheduling class (rt_sched_class),
and it needs to schedule aperiodic, asynchronous replenishment
operations which are independent of timeslice expiration. This is to
implement the functionality that when a SCHED_SPORADIC task blocks or
uses up its timeslice, one of these asynchronous events is scheduled
to happen at some time offset in the future that doesn't necessarily
correspond to any timeslice expiration.
Is there some way to schedule this event without duplicating the code
that the generic scheduler currently uses for its hrtick_timer? As
in, is there a way to do this without adding a thread flag similar in
function to TIF_HRTICK_RESCHED and calling an rt_sched_class function
from do_notify_resume if the flag is set?
The code snippet below is what I am trying to do.
Please CC me explicitly in any replies.
Thanks,
-Daniel
-------------------------------------------------------------------------------------------
static void dequeue_task_rt(struct rq *rq, struct task_struct *p, int sleep)
{
//(runqueue lock already held)
//...
ss_schedule_replenishment(p,rq);
//...
}
static void ss_schedule_replenishment(struct task_struct *task, struct rq *rq) {
//...
hrtimer_start(&my_hrtimer, offset, HRTIMER_MODE_REL);
//...
}
-------------------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: scheduling hrtimers while holding rq->lock
2008-07-29 19:23 scheduling hrtimers while holding rq->lock Daniel Rosenthal
@ 2008-07-29 20:52 ` Peter Zijlstra
0 siblings, 0 replies; 2+ messages in thread
From: Peter Zijlstra @ 2008-07-29 20:52 UTC (permalink / raw)
To: Daniel Rosenthal; +Cc: linux-kernel, Ingo Molnar, Ulrich Drepper
On Tue, 2008-07-29 at 15:23 -0400, Daniel Rosenthal wrote:
> What's the best way for scheduling code to start an hrtimer while
> holding the rq->lock? I am trying to implement SCHED_SPORADIC
> (sporadic server) in the realtime scheduling class (rt_sched_class),
> and it needs to schedule aperiodic, asynchronous replenishment
> operations which are independent of timeslice expiration. This is to
> implement the functionality that when a SCHED_SPORADIC task blocks or
> uses up its timeslice, one of these asynchronous events is scheduled
> to happen at some time offset in the future that doesn't necessarily
> correspond to any timeslice expiration.
>
> Is there some way to schedule this event without duplicating the code
> that the generic scheduler currently uses for its hrtick_timer? As
> in, is there a way to do this without adding a thread flag similar in
> function to TIF_HRTICK_RESCHED and calling an rt_sched_class function
> from do_notify_resume if the flag is set?
>
> The code snippet below is what I am trying to do.
>
> Please CC me explicitly in any replies.
Look at .27-rc1 ;-)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-29 20:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-29 19:23 scheduling hrtimers while holding rq->lock Daniel Rosenthal
2008-07-29 20:52 ` Peter Zijlstra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox