Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Dec 2002 12:23:38 -0500 (EST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Terry Lambert <tlambert2@mindspring.com>
Cc:        Alex <akruijff@dds.nl>, phk@FreeBSD.ORG, Johnson David <DavidJohnson@Siemens.com>, current@FreeBSD.ORG
Subject:   Re: 80386 out of GENERIC
Message-ID:  <XFMail.20021218122338.jhb@FreeBSD.org>
In-Reply-To: <3DFFE7FB.2317DFCF@mindspring.com>

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

On 18-Dec-2002 Terry Lambert wrote:
> John Baldwin wrote:
>> This has nothing to do with /dev/random.  Please stop with the constant
>> FUDing Terry.
> 
>| Revision 1.296 / (download) - annotate - [select for diffs], Sun Jan 14
>| 10:11:10 2001 UTC (23 months ago) by jhb 
>| Branch: MAIN 
>| Changes since 1.295: +2 -2 lines
>| Diff to previous 1.295 (colored) 
>| 
>| Remove I386_CPU from GENERIC.  Support for the 386 seriously pessimizes
>| performance on other x86 processors.  Custom kernels can still be built
>| that will run on the 386.
> 
> The pessimization that was being discussed right before that happened
> was "harvesting entropy for /dev/random".  I can provide mailing list
> quotes about that bracketing those dates.

No, the pessimization is:

#if defined(I386_CPU) || defined(CPU_DISABLE_CMPXCHG)

static __inline int
atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src)
{
        int res = exp;

        __asm __volatile(
        "       pushfl ;                "
        "       cli ;                   "
        "       cmpl    %0,%2 ;         "
        "       jne     1f ;            "
        "       movl    %1,%2 ;         "
        "1:                             "
        "       sete    %%al;           "
        "       movzbl  %%al,%0 ;       "
        "       popfl ;                 "
        "# atomic_cmpset_int"
        : "+a" (res)                    /* 0 (result) */
        : "r" (src),                    /* 1 */
          "m" (*(dst))                  /* 2 */
        : "memory");

        return (res);
}

#else /* defined(I386_CPU) */

static __inline int
atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src)
{
        int res = exp;

        __asm __volatile (
        "       " __XSTRING(MPLOCKED) " "
        "       cmpxchgl %1,%2 ;        "
        "       setz    %%al ;          "
        "       movzbl  %%al,%0 ;       "
        "1:                             "
        "# atomic_cmpset_int"
        : "+a" (res)                    /* 0 (result) */
        : "r" (src),                    /* 1 */
          "m" (*(dst))                  /* 2 */
        : "memory");

        return (res);
}

#endif /* defined(I386_CPU) */

> Was there a particular pessimization other than /dev/random that you
> were thinking of when you made the commit comment?

Yes, the one above.  It came in as part of SMPng.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20021218122338.jhb>