No no, I had in mind keeping a pointer to the task_struct at the base of
the stack:
static inline struct task_struct * get_current(void)
{
struct task_struct **current;
__asm__("andl %%esp,%0; ":"=r" (current) : "0" (~8191UL));
return *current;
}
> Hardware is getting better all the time. The time when direct-mapped or
> even two-way mapped caches were de rigeur are long gone.
But still, for an N-way cache you can play with N task structs before
trouncing the cache. N is often 2 or 4. 2 is the bare minimum task
structs played with, at a context switch.
And when you have a number of processes doing similar kinds of I/O, they
will tend to be trouncing the same areas of their kernel stacks too.
-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/