Re: current pointer question/suggestion

H. Peter Anvin (hpa@transmeta.com)
16 Jul 1998 06:45:22 GMT


Followup to: <199807150905.CAA02063@dm.cobaltmicro.com>
By author: "David S. Miller" <davem@dm.cobaltmicro.com>
In newsgroup: linux.dev.kernel
>
> Date: Wed, 15 Jul 1998 10:46:08 +0200
> From: Alexander Kjeldaas <astor@guardian.no>
>
> This just occurred to me. Would it be possible to have current point
> to a location within the kernel area that was mapped individually for
> each task?
>
> There are severe performance penalties for this technique on SMP, and
> to a lesser extent on uniprocessors as well. This method is old hat
> and was investigated by us a year or two ago, it was found to be
> inferior to the current scheme.
>
> Later,
> David S. Miller
> davem@dm.cobaltmicro.com
>

Hey, hang on... the SMP problem shouldn't occur since only one
processor can own a process at any one time, so you don't need to
invalidate the TLBs of the other CPUs (which is what makes it suck.)

This is different from using virtual-memory allocations to grow the
process stack.

NOW, what is dangerous with it is that you must NEVER dereference
pointers to automatic variables for another process... those variables
simply will not exist in your new process context...

-hpa

-- 
    PGP: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD  1E DF FE 69 EE 35 BD 74
    See http://www.zytor.com/~hpa/ for web page and full PGP public key
        I am Bahá'í -- ask me about it or see http://www.bahai.org/
   "To love another person is to see the face of God." -- Les Misérables

- 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.altern.org/andrebalsa/doc/lkml-faq.html