[lkml]   [2001]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] task_struct colouring ...
On Fri, 30 Nov 2001, Alan Cox wrote:

> > So You like the idea of stocking structure pointers inside CPU registers
> > or I missed Your point ?
> > The proposed implementation is "uniform" between architectures, that's my
> > point.
> An uniform implementation for a totally non uniform set of processors. Not
> actually useful. The x86 is one of the few cpus so short of registers that
> current in a global register is not a win performancewise.

The point is why store kernel pointers in global registers when You can
achieve the same functionality, with a smaller patch, that does not need
to be recoded for each CPU, without using global registers.

> The cache behaviour also heavily depends on the processor. In paticular the
> problem with having to align stacks to do current tricks is absent on non
> x86 processors so they can use properly coloured stacks.
> current is far too critical to generalise

This is the diff for current :

static inline struct task_struct * get_current(void)
- struct task_struct *current;
- __asm__("andl %%esp,%0; ":"=r" (current) : "0" (~8191UL));
- return current;
+ unsigned long *tskptr;
+ __asm__("andl %%esp,%0; ":"=r" (tskptr) : "0" (~8191UL));
+ return (struct task_struct *) *tskptr;

- Davide

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:13    [W:0.093 / U:2.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site