Re: Interesting scheduling times - NOT

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Mon, 21 Sep 1998 14:56:01 +0100


On Mon, Sep 21, 1998 at 07:04:20AM +0000, Linus Torvalds wrote:
> Jamie Lokier wrote:
> >Aha. Sounds like a good case for SLAB-allocating the task_state
> >structure separate from the stack. And also varying the initial
> >kernel stack pointer within the stack pages.
>
> Ehh. And in the process completely breaking the whole "current" macro.

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/