RE: Can't set total quantum with L4_Set_Timeslice()

Jan Stoess <[email protected]> Tue, 24 Apr 2012 07:52:22 +0000
Newsgroups gmane.comp.micro-kernel.l4.l4ka.general
Message-ID <[email protected]>
Hi Farid,

If you're referring to the user-space scheduling prototype described in the=
 paper: the prototype has never made it into the mainline kernel. It was an=
 experiment and had significant performance implications (as described in t=
he paper), and we didn't want to pollute the mainline tree with it. If you'=
re interested in the code let me know and I'll dig.=20

If you're referring to the normal scheduling behavior in pistachio (RR with=
 Prios): the preemption message has been specified in the manual, but has n=
ever been completely implemented (at least in L4Ka::Pistachio). Nobody has =
required or used that functionality, and since it requires careful implemen=
tation (see code comment snippet below) , it has been a "TODO" ever since.=
=20

From kernel/src/api/v4/sched-rr/schedule.cc
/**
 * sends preemption IPC to the scheduler thread that the total quantum
 * has expired */
void rr_scheduler_t::total_quantum_expired(tcb_t * tcb)
{
    TRACEPOINT(TOTAL_QUANTUM_EXPIRED, "total quantum expired for %t\n", tcb=
);
   =20
    enter_kdebug("total quantum IPC unimplemented");
    UNIMPLEMENTED();
    /* Total quantum IPC is an open point.  The expiration may happen
     * in the wrong thread context and thus we have to tunnel the IPC.
     * Also it may happen in the middle of a long IPC which leads to
     * nesting of four.  More details in eSk's p-core posting.
     * Disabled for the time being.
     */
    //tcb->send_preemption_ipc(current_time);
}

Best,
-Jan
--
Dr. Jan Stoess, KIT System Architecture Group


> -----Original Message-----
> From: [email protected] [mailto:[email protected]
> karlsruhe.de] On Behalf Of Farid Hajji
> Sent: Monday, April 23, 2012 5:09 PM
> To: [email protected]
> Subject: Can't set total quantum with L4_Set_Timeslice()
>=20
> Hello,
>=20
> I'm experimenting with user space scheduling on L4Ka::Pistachio
> (amd64) as specified in the paper
>   "Towards Effective User-Controlled Scheduling for Microkernel-Based
> Systems"
> and I'd like a worker thread to RPC its associated scheduler thread, when=
 it
> has used up its total quantum.
>=20
> This however never seems to happen. In the KDB, I always see that 'tq' is=
 set
> to 0usec, in other words, to L4_Never. Is it right that the user space
> scheduler would never be RPC-ed in this case?
>=20
> So I've tried to change the 'tq' with a call to L4_Set_Timeslice().
> But even then, the 'tq' always remain at 0usec, and what's worse, the tim=
e
> slice also jumps to 0usec, even when set to some other value.
>=20
> Is the call to L4_Set_Timeslice() broken?
>=20
> Attached is a simple test case, and the output of KDB before and after th=
e
> call to L4_Set_Timeslice().
>=20
> Thanks in advance,
> -Farid Hajji.