RC2 seems to need kern.smp.disabled=1
Dennis Clarke
dclarke at blastwave.org
Mon Nov 26 19:13:18 UTC 2018
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. 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.
Dennis
More information about the freebsd-ppc
mailing list