RC2 seems to need kern.smp.disabled=1
Mark Millard
marklmi at yahoo.com
Mon Nov 26 19:41:33 UTC 2018
On 2018-Nov-26, at 11:13, Dennis Clarke <dclarke at blastwave.org> wrote:
> Hello ppc64 types:
>
> 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 :
>
> root at eris:~ # uname -a
> FreeBSD eris 12.0-RC2 FreeBSD 12.0-RC2 r340839 GENERIC powerpc
> root at 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 at eris:~ #
>
> However the exact same machine was fine yesterday with RC1 :
>
> eris$ /usr/bin/time -p ./factorial 20
> -------------------------------------------------------------
> system name = FreeBSD
> node name = eris
> release = 12.0-RC1
> version = FreeBSD 12.0-RC1 r340470 GENERIC
> machine = 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
> -------------------------------------------------------------
>
> 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
>
>
> 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()?
>
>
> /*********************************************************************
> * 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
>
> #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>
>
> #include "gmp.h"
>
> 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. */
>
> struct timespec temp;
> uint64_t s, n;
>
> if ( ( end.tv_nsec - start.tv_nsec ) < 0 ) {
> /* make a full second adjustment to tv_sec */
> temp.tv_sec = end.tv_sec - start.tv_sec - 1;
> /* we have to add a full second to temp.tv_nsec */
> temp.tv_nsec = 1000000000 + end.tv_nsec - start.tv_nsec;
> } else {
> temp.tv_sec = end.tv_sec - start.tv_sec;
> temp.tv_nsec = end.tv_nsec - start.tv_nsec;
> }
> s = (uint64_t) temp.tv_sec;
> n = (uint64_t) temp.tv_nsec;
> return ( s * (uint64_t)1000000000 + n );
> }
>
> void gmp_fact( int n )
> {
> int i;
> mpz_t p;
>
> mpz_init_set_ui( p, 1 ); /* p = 1 */
> for ( i = 1; i <= n ; ++i ) {
> mpz_mul_ui( p, p, i ); /* p = p * i */
> }
> /* will fail wonderfully if n is large */
> /******************************************************
> ***** actually lets not bother to print anything *****
> * fprintf ( stdout, "\n %d! = ", n );
> * mpz_out_str( stdout, 10, p );
> * fprintf ( stdout, "\n\n" );
> ******************************************************/
> mpz_clear( p );
>
> }
>
> 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;
>
> if ( argc <= 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 = (int) strtol( argv[1], (char **)NULL, 10);
> if ( n < 0 ) goto usage;
> }
>
> 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 = %s\n", uname_data.sysname );
> printf ( " node name = %s\n", uname_data.nodename );
> printf ( " release = %s\n", uname_data.release );
> printf ( " version = %s\n", uname_data.version );
> printf ( " machine = %s\n", uname_data.machine );
> printf ( "-------------------------------" );
> printf ( "------------------------------" );
> }
> printf ("\n");
>
> printf("GMP library version : %d.%d.%d\n",
> __GNU_MP_VERSION,
> __GNU_MP_VERSION_MINOR,
> __GNU_MP_VERSION_PATCHLEVEL );
>
> /* try to get an idea of system processors available and memory */
> state = 1;
> pagesize = sysconf(_SC_PAGESIZE);
> if (pagesize == -1){
> fprintf(stderr,
> "dbg : could not attain _SC_PAGESIZE\n : %s\n",
> strerror(errno));
> state = 0;
> }else{
> printf("inf : pagesize seems to be %i\n", pagesize);
> }
> phypages = sysconf(_SC_PHYS_PAGES);
> if (phypages == -1){
> fprintf(stderr,
> "dbg : could not attain _SC_PHYS_PAGES\n : %s\n",
> strerror(errno));
> state = 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");
> }
>
> nproc_cfg = sysconf(_SC_NPROCESSORS_CONF);
> if (nproc_cfg == -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 = sysconf(_SC_NPROCESSORS_ONLN);
> if (nproc_onln == -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);
> }
>
> printf("-------------------------------");
> printf("------------------------------\n\n");
>
> printf(" n approx time in nanosecs\n");
> printf(" ---------+----------------------------\n");
>
> for ( k=0; k<n; k++ ) {
> clock_gettime( CLOCK_MONOTONIC, &start );
> gmp_fact( (k+1) * 10000 );
> clock_gettime( CLOCK_MONOTONIC, &end );
>
> t_delta = timediff( start, end );
> fprintf ( stdout, " %6i %16lld nsec\n",
> (k+1) * 10000, t_delta );
> }
> printf ( " --------------------------------------\n" );
>
> return ( EXIT_SUCCESS );
> }
>
> Anyways I am going to see if there is a way around this ugly
> kern.smp.disabled requirement. Hope there is one.
===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)
More information about the freebsd-ppc
mailing list