Re: Access to kernel routine (find_task_by_pid)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Vincenzo Mallozzi wrote:

I've forgiven!!! You can also download "The Linux Kernel Module Programming Guide". There are two version: 2.4 and 2.6 .
Vincenzo Mallozzi.


5. Insert the code in file and then print it. Continue studying the Chapter I've indicate to you (except the one treating IOCTL mechanism) and step by step you'll understand better what I'm wrote (and you'll find lso errors that
I've make).


Amazing. I will study this. But, rigth now I need something that works. This solution
(using a module) will probably replace the actual later.




Mulyadi Santosa wrote:

from what I see here, your goal are trying to be as simple as it can to control the runtime of process and trying not to reinvent the wheel, am I correct?

So, in short, there is a big chance you can't get a fine granularity...which is luckily..you already aware of it


The idea is to minimize the load of the supervisor program take the minimum
amout of time, namely be as simple as possible. And, the granularity must be the finest possible. The ideal would be to control directly the cpu cycle, but since it's impossible, a solution which control every 1 ms (HZ) is acceptable. If this is
really necessary, we can increase HZ.

My suggestion...try to check scheduler_tick() on kernel/sched.c. Hack the code especially ones that calculate how much time slice is left. Of course you will need someway to pass the pid of the task you want to control. In this case, create a /proc entry that is related to a kernel variable. This variable, shall we say "target_pid", can be used inside the scheduler_tick() ..perhaps using something like:


I think that this will change the priority of the targert program, but that's all.
Suppose that we want to limit its load to 50%, we will reduce the number of
time slice by the half. But, if there is no other process, the epoch will finish and a new epoch will begin. I don't see how we can control this with the time
slice given by the scheduler.

if you want "higher" level of experiment...try to google for "Bossa scheduler". I never use it by myself, but it is kinda of scheduler which has capabilities to receive hints from userspace. IMHO this is useful for experiments, e.g tuning the policy without the need of frequent recompilation.

A new pist. Thanks.

But, for now, I have enough to do with implementing a module and study the code
of Vincenzo Mallozzi.

Thanks everybody.

--
Canon


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux