LinSched: The Linux Scheduler Simulator

46 views
Skip to first unread message

Facundo Viale

unread,
Oct 15, 2010, 3:59:27 PM10/15/10
to c-t...@googlegroups.com
Buenas a todos! Para aquellos interesados en la programación hardcore con Linux existe una tool que se llama LinSched. 

LinSched is a user-space program that hosts the Linux scheduling subsystem. Its purpose is to provide a tool for observing and modifying the behavior of the Linux scheduler, and prototyping new Linux scheduling policies, in a way that may be easier (or otherwise less painful or time-consuming) to many developers than direct experimentation with the Linux kernel, especially in the initial stages of development. Due to the high degree of code sharing between LinSched and the Linux scheduler, porting LinSched code to Linux is reasonably straightforward. LinSched may be especially useful to those who are new to Linux scheduler development.

LinSched is now publicly available, though the code is still somewhat messy and the only existing documentation is this paper. I have not yet had the chance to perform the cleanup necessary to release a better version, but may do so in the future. If you do any code cleanup yourself, please let me know as it may be useful to incorporate it into LinSched. Since LinSched is a derivative work of Linux (kernel version 2.6.23.14), it is licensed under the GPLv2.


Básicamente unos tipo agarraron el Kernel de Linux, le sacaron el Scheduler (O.o) y lo encapsularon dentro de una libreria que permite hacer simulaciones sobre el planificador. Ej:

/* Initialize linsched. */
linsched_init();

/* Create some tasks with "callbacks" that should be called every scheduling decision.*/
linsched_create_normal_task(&linsched_announce_callback, 0);
linsched_create_normal_task(&linsched_announce_callback, 0);
linsched_create_normal_task(&linsched_announce_callback, -5);
linsched_create_normal_task(&linsched_announce_callback, 5);
linsched_create_batch_task(&linsched_announce_callback, 15);
linsched_create_batch_task(&linsched_announce_callback, -1);

linsched_create_RTrr_task(&linsched_announce_callback, 90);
linsched_create_RTfifo_task(&linsched_announce_callback, 55);
// create more tasks here...

/* Run simulation for 500 ticks. */
linsched_run_sim(500);


También se pueden hacer cosas bizarras como seleccionar la cantidad de CPU sobre las que se tiene que planificar o forzar migración de procesos de un procesador a otro. El proyecto es nuevo ( de este año ) y aun esta en pañales, pero parece que le están haciendo cosas muy copadas y seguro que a futuro va a ser una tool muy copada.

Saludos!
Reply all
Reply to author
Forward
0 new messages