lkml.org 
[lkml]   [2004]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: get_current is __pure__, maybe __const__ even
    On Thu, Sep 16, 2004 at 11:11:28AM +0200, Andi Kleen wrote:
    > > IOW, think from a tasks point of view. It gets into the scheduler,
    > > and switch_to() is just a normal function which just happens to sleep
    > > for some time.
    >
    > On x86/x86-64 the stack switch is inlined into schedule()

    Yes, and does it not save the whole CPU context and restore it, or tell
    the compiler that certain registers which you don't preserve are
    clobbered? If it didn't, I think you'd find that you have a bug
    there.

    The scheduler quite rightly expects, for any thread, that any variable
    which may be stored in a CPU register before the context switch has the
    same value as after the context switch.

    (note - "preserve" above - I don't mean from one thread to another,
    I mean preserved within the context of one thread.)

    --
    Russell King
    Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
    maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/
    2.6 Serial core
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

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