lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 29 Jul 2008 15:23:11 -0400
From:	"Daniel Rosenthal" <danielrosenthal@....org>
To:	linux-kernel@...r.kernel.org
Cc:	"Ingo Molnar" <mingo@...e.hu>,
	"Peter Zijlstra" <a.p.zijlstra@...llo.nl>,
	"Ulrich Drepper" <drepper@...hat.com>
Subject: scheduling hrtimers while holding rq->lock

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);
   //...
}

-------------------------------------------------------------------------------------------
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ