Re: scheduler syscall requirements

Espen Skoglund <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.l4ka.general
Message-ID <[email protected]>
[Al ]
> Hi.
> I am interested in scheduling for L4 so I had a look at the source
> of Scheduler syscall in Pistachio and wondered how the scheduler and
> its scheduled thread necessarily should be in the same address
> space.

Wrong.  The scheduler thread of the destination and the current thread
must reside in the same addres space, i.e., the current thread must be
a thread in the "scheduler server" of the destination.

> pistachio/kernel/src/api/v4/schedule.cc

> 609     // are we in the same address space as the scheduler of the thread?
> 610     tcb_t * sched_tcb =
> get_current_space()->get_tcb(dest_tcb->get_scheduler());
> 611     if (sched_tcb->get_global_id() != dest_tcb->get_scheduler() ||
> 612          sched_tcb->get_space() != get_current_space())
> 613     {
> 614          get_current_tcb ()->set_error_code (ENO_PRIVILEGE);
> 615          return_schedule(0, 0);
> 616     }

> For me it restricts the opportunities for scheduling policy and the
> manageability for program systems on top of L4.

It does not restrict any oppoprtunities.  It just more easily allows
for schedulers to be multi-threaded; for example, in an MP system you
might have one scheduler thread per CPU.

> Also nothing is mentioned about these requirements in "L4 kernel
> reference manual".

Thought this had already been updated in the refman.  Have updated it
to be more clear on this point now.

> Is there any reasonable explanation for this?

> BTW, there is no checking that Scheduler syscall invoked by thread
> registered as scheduler for destination thread, and proposed
> priority less than current thread's. It seems easy to fix, so maybe
> it provided deviation?

Right.  The test seems to be missing from the implementation.

	eSk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.