Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Jul 2003 06:08:08 +0800
From:      "David Xu" <davidxu@freebsd.org>
To:        "Julian Elischer" <julian@elischer.org>, <deischen@freebsd.org>
Cc:        marcel@xcllnt.net
Subject:   Re: KSD/TSD take 2 (was: KSE critical regions)
Message-ID:  <002501c35230$1205be60$0701a8c0@tiger>
References:  <Pine.BSF.4.21.0307241229170.69488-100000@InterJet.elischer.org>

index | next in thread | previous in thread | raw e-mail


----- Original Message ----- 
From: "Julian Elischer" <julian@elischer.org>
To: <deischen@freebsd.org>
Cc: <threads@freebsd.org>; "David Xu" <davidxu@freebsd.org>; <marcel@xcllnt.net>
Sent: Friday, July 25, 2003 4:59 AM
Subject: Re: KSD/TSD take 2 (was: KSE critical regions)
 to the kernel.
> 
> In the i386 case, (and only the i386 case (unless the amd-64 case is the
> same)) the KSE MAILBOX is what we are pointing %gs:0 at, and in that
> case, the pointer to the TCB (not the thread mailbox) is stored there.
> (and set there by the UTS when scheduling a thread).
> 
> Thus the struct kse_mailbox would have:
> 
> struct kse_mailbox { 
> #ifdef __i386__
>        void                    *TLS_tcb;       /* current TCB for TLS  */
> #endif
>        uint32_t                km_version;     /* Mailbox version */
>        uint32_t                km_flags;       /* KSE flags */
>        struct kse_thr_mailbox  *km_curthread;  /* Currently running thread */
>        struct kse_thr_mailbox  *km_completed;  /* Threads back from kernel */
>        [...]
> 

userland can always adapt the layout by:

    struct lib_kse_mailbox {
        void *TLS_tcb;
        struct kse_mailbox kmbx;
    };

and set base address to lib_kse_mailbox, userland can
do whatever it wants to do. same thing can be done for
thread mailbox.

I don't think too many fields not related to interaction
between kernel and userland should be pushed into mailbox,
it is too ugly.

David Xu




home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?002501c35230$1205be60$0701a8c0>