Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Nov 2018 11:41:18 -0800
From:      Mark Millard <marklmi@yahoo.com>
To:        Dennis Clarke <dclarke@blastwave.org>
Cc:        FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>
Subject:   Re: RC2 seems to need kern.smp.disabled=1
Message-ID:  <179CF982-D123-483D-B3B9-188010C39BD5@yahoo.com>
In-Reply-To: <57efdab7-568c-623e-4b66-cf5ed7c138bf@blastwave.org>
References:  <57efdab7-568c-623e-4b66-cf5ed7c138bf@blastwave.org>

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


On 2018-Nov-26, at 11:13, Dennis Clarke <dclarke at blastwave.org> =
wrote:


> Hello ppc64 types:
>=20
> Merely an observation that RC1 was running more or less fine without =
the
> need to castrate the smp feature whereas RC2 won't even boot.

If you were able to smp boot a PowerMac G5 based on a version that
was based on:

#define VM_MAX_KERNEL_ADDRESS           0xe0000007ffffffffUL

from sys/powerpc/include/vmparam.h that is interesting.

This is the value I (and others?) have been reverting to:

#define VM_MAX_KERNEL_ADDRESS           0xe0000001c7ffffffUL

in order to allow smp use on such G5's. Quoting an old reply
from 2018-Oct-11 (-r??????'s are from 13-CURRENT):

QUOTE
Until the problems with -r334498 's adjustment to VM_MAX_KERNEL_ADDRESS
are dealt with, PowerMac G5's have boot problems (and possibly other
problems), at least those with multiple sockets (for what I can test).
(I've no access to other forms of PowerMac G5's.)
See:
https://lists.freebsd.org/pipermail/freebsd-ppc/2018-October/009669.html
and later in that thread. (Earlier in the thread is likely a waste of =
time
to read, given what is now known.)
My G5 contexts are operational by reverting -r334498 . The contexts are
otherwise based on -r339076 currently.
Note:
My boot test on a 8 GiByte, dual-socket, one "CPU" per socket,
PowerMac G5 met the conditions of Andreas Tobler's requested test
conditions and the machine boot fine (VM_MAX_KERNEL_ADDRESS near
the RAM size, on the low side).
The G5 so-called "Quad Core"s, 4 cores total in each system but
split evenly across 2 sockets in each), one with 12 GiByte and
one with 16 GiByte of RAM, booted fine as well. But
VM_MAX_KERNEL_ADDRESS was somewhat under 8GiByte and so not near
those sizes.
ENDQUOTE

> The fans
> just roar and it sits there roaring. So RC2 :
>=20
> root@eris:~ # uname -a
> FreeBSD eris 12.0-RC2 FreeBSD 12.0-RC2 r340839 GENERIC  powerpc
> root@eris:~ # getconf -a | grep -i "NPROC"
> getconf: sysconf: _POSIX_FILE_LOCKING: Invalid argument
> getconf: sysconf: _POSIX_THREAD_SPORADIC_SERVER: Invalid argument
> getconf: sysconf: _POSIX_TRACE_EVENT_FILTER: Invalid argument
> getconf: sysconf: _POSIX_TRACE_INHERIT: Invalid argument
> getconf: sysconf: _POSIX_TRACE_LOG: Invalid argument
> getconf: sysconf: _XOPEN_VERSION: Invalid argument
> NPROCESSORS_CONF: 1
> NPROCESSORS_ONLN: 1
> root@eris:~ #
>=20
> However the exact same machine was fine yesterday with RC1 :
>=20
> eris$ /usr/bin/time -p ./factorial 20
> -------------------------------------------------------------
>        system name =3D FreeBSD
>          node name =3D eris
>            release =3D 12.0-RC1
>            version =3D FreeBSD 12.0-RC1 r340470 GENERIC
>            machine =3D powerpc
> -------------------------------------------------------------
> GMP  library version : 6.1.2
> inf : pagesize seems to be 4096
> inf : physical pages number seems to be 2085549
> inf : total memory seems to be 8542408704
> inf : number of configured processors seems to be 4
> inf : number of online processors seems to be 4
> -------------------------------------------------------------
>=20
>             n       approx time in nanosecs
>       ---------+----------------------------
>         10000                 28782119 nsec
>         20000                113344390 nsec
>         30000                264088884 nsec
>         40000                482695132 nsec
>         50000                772446957 nsec
>         60000               1130731802 nsec
>         70000               1564791040 nsec
>         80000               2069463850 nsec
>         90000               2649433561 nsec
>        100000               3302860225 nsec
>        110000               4031924958 nsec
>        120000               4841946952 nsec
>        130000               5725338148 nsec
>        140000               6684564457 nsec
>        150000               7726752108 nsec
>        160000               8842535135 nsec
>        170000              10032317230 nsec
>        180000              11316147413 nsec
>        190000              12666156577 nsec
>        200000              14101113493 nsec
>       --------------------------------------
> real 98.35
> user 98.23
> sys 0.02
>=20
>=20
> Would love to see what anyone else gets from that same code.  Also =
what the heck is this double underscore "__BSD_VISIBLE" requirement in =
order to get reasonable data from sysconf()?
>=20
>=20
> /*********************************************************************
> * The Open Group Base Specifications Issue 6
> * IEEE Std 1003.1, 2004 Edition
> *
> *    An XSI-conforming application should ensure that the feature
> *    test macro _XOPEN_SOURCE is defined with the value 600 before
> *    inclusion of any header. This is needed to enable the
> *    functionality described in The _POSIX_C_SOURCE Feature Test
> *    Macro and in addition to enable the XSI extension.
> *
> *********************************************************************/
> #define _XOPEN_SOURCE 600
> #define __BSD_VISIBLE 1
>=20
> #include <stdio.h>
> #include <stdlib.h>
> #include <stdint.h>
> #include <stddef.h>
> #include <string.h>
> #include <errno.h>
> #include <time.h>
> #include <assert.h>
> #include <locale.h>
> #include <unistd.h>
> #include <sys/utsname.h>
>=20
> #include "gmp.h"
>=20
> uint64_t timediff( struct timespec start, struct timespec end )
> {
>    /* return the delta time as a 64-bit positive number of
>     * nanoseconds.  Regardless of the time direction between
>     * start and end we always get a positive result. */
>=20
>    struct timespec temp;
>    uint64_t s, n;
>=20
>    if ( ( end.tv_nsec - start.tv_nsec ) < 0 ) {
>        /* make a full second adjustment to tv_sec */
>        temp.tv_sec =3D end.tv_sec - start.tv_sec - 1;
>        /* we have to add a full second to temp.tv_nsec */
>        temp.tv_nsec =3D 1000000000 + end.tv_nsec - start.tv_nsec;
>    } else {
>        temp.tv_sec =3D end.tv_sec - start.tv_sec;
>        temp.tv_nsec =3D end.tv_nsec - start.tv_nsec;
>    }
>    s =3D (uint64_t) temp.tv_sec;
>    n =3D (uint64_t) temp.tv_nsec;
>    return ( s * (uint64_t)1000000000 + n );
> }
>=20
> void gmp_fact( int n )
> {
>    int         i;
>    mpz_t       p;
>=20
>    mpz_init_set_ui( p, 1 ); /* p =3D 1 */
>    for ( i =3D 1; i <=3D n ; ++i ) {
>        mpz_mul_ui( p, p, i ); /* p =3D p * i */
>    }
>    /* will fail wonderfully if n is large */
>    /******************************************************
>     ***** actually lets not bother to print anything *****
>     * fprintf ( stdout, "\n    %d!  =3D  ", n );
>     * mpz_out_str( stdout, 10, p );
>     * fprintf ( stdout, "\n\n" );
>     ******************************************************/
>    mpz_clear( p );
>=20
> }
>=20
> int main(int argc, char *argv[])
> {
>    int    n, k, state;
>    long pagesize, phypages, nproc_onln, nproc_cfg;
>    struct timespec    start, end;
>    struct utsname uname_data;
>    uint64_t t_delta;
>=20
>    if ( argc <=3D 1) {
> usage:  fprintf ( stderr, "Usage: %s <number> \n", argv[0] );
>        fprintf ( stderr, "     : Where <number> is a positive " );
>        fprintf ( stderr, "integer for the number of loops to\n" );
>        fprintf ( stderr, "     : perform. In each loop a factorial" );
>        fprintf ( stderr, " shall be computed which is a\n" );
>        fprintf ( stderr, "     : multiple of ten thousand.\n" );
>        return ( EXIT_FAILURE );
>    } else {
>        n =3D (int) strtol( argv[1], (char **)NULL, 10);
>        if ( n < 0 ) goto usage;
>    }
>=20
>    setlocale( LC_MESSAGES, "C" );
>    if ( uname( &uname_data ) < 0 ) {
>        fprintf ( stderr,
>                 "WARNING : Could not attain system uname data.\n" );
>        perror ( "uname" );
>    } else {
>        printf ( "-------------------------------" );
>        printf ( "------------------------------\n" );
>        printf ( "        system name =3D %s\n", uname_data.sysname );
>        printf ( "          node name =3D %s\n", uname_data.nodename );
>        printf ( "            release =3D %s\n", uname_data.release );
>        printf ( "            version =3D %s\n", uname_data.version );
>        printf ( "            machine =3D %s\n", uname_data.machine );
>        printf ( "-------------------------------" );
>        printf ( "------------------------------" );
>    }
>    printf ("\n");
>=20
>    printf("GMP  library version : %d.%d.%d\n",
>            __GNU_MP_VERSION,
>            __GNU_MP_VERSION_MINOR,
>            __GNU_MP_VERSION_PATCHLEVEL );
>=20
>    /* try to get an idea of system processors available and memory */
>    state =3D 1;
>    pagesize =3D sysconf(_SC_PAGESIZE);
>    if (pagesize =3D=3D -1){
>        fprintf(stderr,
>                 "dbg : could not attain _SC_PAGESIZE\n     : %s\n",
>                                                     strerror(errno));
>        state =3D 0;
>    }else{
>        printf("inf : pagesize seems to be %i\n", pagesize);
>    }
>    phypages =3D sysconf(_SC_PHYS_PAGES);
>    if (phypages =3D=3D -1){
>        fprintf(stderr,
>                 "dbg : could not attain _SC_PHYS_PAGES\n     : %s\n",
>                                                     strerror(errno));
>        state =3D 0;
>    }else{
>        printf("inf : physical pages number seems to be %i\n", =
phypages);
>    }
>    if(state){
>        printf("inf : total memory seems to be %llu\n",
>                            (uint64_t)pagesize * (uint64_t)phypages);
>    }else{
>        fprintf(stderr,"dbg : there is no way to determine system =
memory.\n");
>    }
>=20
>    nproc_cfg =3D sysconf(_SC_NPROCESSORS_CONF);
>    if (nproc_cfg =3D=3D -1){
>        fprintf(stderr,
>                 "dbg : could not attain _SC_NPROCESSORS_CONF\n     : =
%s\n",
>                                                     strerror(errno));
>    }else{
>        printf("inf : number of configured processors seems to be =
%i\n", nproc_cfg);
>    }
>    nproc_onln =3D sysconf(_SC_NPROCESSORS_ONLN);
>    if (nproc_onln =3D=3D -1){
>        fprintf(stderr,
>                 "dbg : could not attain _SC_NPROCESSORS_ONLN\n     : =
%s\n",
>                                                      strerror(errno));
>    }else{
>        printf("inf : number of online processors seems to be %i\n", =
nproc_onln);
>    }
>=20
>    printf("-------------------------------");
>    printf("------------------------------\n\n");
>=20
>    printf("             n       approx time in nanosecs\n");
>    printf("       ---------+----------------------------\n");
>=20
>    for ( k=3D0; k<n; k++ ) {
>        clock_gettime( CLOCK_MONOTONIC, &start );
>        gmp_fact( (k+1) * 10000 );
>        clock_gettime( CLOCK_MONOTONIC, &end );
>=20
>        t_delta =3D timediff( start, end );
>        fprintf ( stdout, "        %6i         %16lld nsec\n",
>                                              (k+1) * 10000, t_delta );
>    }
>    printf ( "       --------------------------------------\n" );
>=20
>    return ( EXIT_SUCCESS );
> }
>=20
> Anyways I am going to see if there is a way around this ugly
> kern.smp.disabled requirement. Hope there is one.



=3D=3D=3D
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?179CF982-D123-483D-B3B9-188010C39BD5>