Re: Interception for a resource based scheduler

From: Arjan van de Ven
Date: Fri Dec 31 2004 - 02:50:29 EST


On Thu, 2004-12-30 at 22:51 -0800, selvakumar nagendran wrote:
> hi,
> I am using these information for the scheduler I am
> developing in Linux. The scheduler selects the next
> process to run based on the resources needed so that a
> high priority process will not starve for a semaphore
> key, file lock etc that were acquired by a low
> priority process. The user may change the file
> descriptor only through syscalls. If I intercept them
> and update the resource history that I am maintaining,
> then will the information break?

I think you missed the point. I'll reexplain:

what do you is

syscall_wrapper()
{
original_syscall_that_copies_the_numbers_to_userspace();
kmalloc(GFP_KERNEL); <-- can sleep
copy_numbers_back_from_userspace();
}

it is REALLY easy for another thread of the userspace program that did
the syscall to change IT'S OWN MEMORY where the 2 FD numbers are stored
between the moment the original syscall copies them there, and the
moment you *recopy* them back.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/