Hi,

this is my first post in linux-smp, so my apologies if this has already
been asked ( I searched the archives but couldn't find a reference to
this ).

First, a small explanation of what I intend to do:

At my group at my university we're trying to implement a "reserve"
mechanism for multiprocessors using Linux. Basically a process asks for
a certain reserve of computation time, and that reserve will be
replenished with a certain period. If a process has depleted it's
allocated computation time, it will be suspended until its reserve has
been replenished. This implementation is a first step towards an
implementation of RMS ( rate montonic scheduling ) on multiprocessors
using R-bound .

So, this is what I have done:

We have an admission control mechanism that, against a computation time
and replenishmen period requirement, calculates the utilization
requested, and check it against the available utilization in every CPU.
According to it, will assign the new task to a specific CPU ( the first
CPU that has utilization available, with our limit being 66 % per CPU ).
By assign, I mean it will modify the "processor" field in the task
structure of that process. I've also added a specific field in the task
structure ( migration ) that is set up to FALSe at that moment, and
modified the schedule() routine to check (after going through the
goodness function ) if that task has migration disabled. If so, it will
only schedule that task if the CPU curently running in  schedule() is
the CPU indcated in the processor field ( when I talk about migration
I'm trying ot avoid the migration sometimes doen by the goodness
funtion). Also, the task is set as SCHED_FIFO and priority 50.
In order to set up the replenishment, I have a timer that will call the
replenish routine periodically. That timer will be set the first time
the slave task is scheduled AFTER changing its characteristics ( I
cannot do it before cause I'm also modifying the local APIC timer of a
specific CPU, and putting it in one shot mode )

My problem:

In order to test this, I have a small task in a while(1) loop, doing
nothing, not even a printf ( let's call it slave task ), which is the
one I want to modify.  I also have another task ( master task ) that
will send to the kernel ( through some syscalls ) the pid of a task and
a computation and replenish requirement.
I'm working with a machine with 2 CPUS ( 0 and 1 ). So, I start the
slave task, and somehow, it ends up initially in the CPU 1. Then, I
execute the master task and send the request to modify the running
characteristics of the slave task ( to give it reserves characteristics
). The admission algorithm decides that the slave task need to go to CPU
0 and sets all the fields accordingly. The only that I have left ot do
is start the replenishment timer after the slave tasks get scheduled
again. 
Now, that is my problem. It seems that my slave task doesn't get
rescheduled again ( I'm still not sure, but I checked the schedule()
routine and it never get thrugh, I put a hook at the end to check if an
RK task passed by ). Because of that, I'm not able to replenish the
reserve and start all my algorithm ( I initially set up the task as
DEPLETED ). I am not putting it to sleep anywhre in the middle ( I think
).

So, my impression is that it is still running ( in CPU 1 ), so I'd like
to have at the end of the system call a way to have this slave task (
running on the CPU 1, remmeber the master task which is the one
executing in CPU 0 ) to stop execution, get back to the ready queue (
runque in Linux ) and do another schedule. Hopefully, acus eI disabled
migration, it will be only selected by CPU 0 ( it will have a big
wieught at the end of the good ness function ). I tried to do an
smp_send_reschedule( 0 ) to CPU 0 at rthe end of the system call, but I
couldn't get it to select again the slave task. 

Sometimes I managed to get it working, that is cause the slave task was
already running in CPU 0 ( don't need to force a migration ).

As another question, if I'm running in a syscall in CPU 0, current will
refer to myself, right ? How could I refer to the current task in the
other CPU ? Do I need to check all the runqueue ?

Sorry fo the long post, any help will be appreciated

Hugo

--
Hugo Varotto
Computer Science Dept.
University of Pittsburgh
[EMAIL PROTECTED]
http://www.cs.pitt.edu/FORTS
-
Linux SMP list: FIRST see FAQ at http://www.irisa.fr/prive/mentre/smp-faq/
To Unsubscribe: send "unsubscribe linux-smp" to [EMAIL PROTECTED]

Reply via email to