From owner-freebsd-ppc@freebsd.org Mon Nov 26 19:13:18 2018 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 892A11141718 for ; Mon, 26 Nov 2018 19:13:18 +0000 (UTC) (envelope-from dclarke@blastwave.org) Received: from atl4mhob09.registeredsite.com (atl4mhob09.registeredsite.com [209.17.115.47]) by mx1.freebsd.org (Postfix) with ESMTP id AACAD84862 for ; Mon, 26 Nov 2018 19:13:15 +0000 (UTC) (envelope-from dclarke@blastwave.org) Received: from mailpod.hostingplatform.com (atl4qobmail01pod2.registeredsite.com [10.30.77.35]) by atl4mhob09.registeredsite.com (8.14.4/8.14.4) with ESMTP id wAQJD8M6016285 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 26 Nov 2018 14:13:08 -0500 Received: (qmail 1093 invoked by uid 0); 26 Nov 2018 19:13:07 -0000 X-TCPREMOTEIP: 174.118.245.214 X-Authenticated-UID: dclarke@blastwave.org Received: from unknown (HELO ?172.16.35.3?) (dclarke@blastwave.org@174.118.245.214) by 0 with ESMTPA; 26 Nov 2018 19:13:07 -0000 To: FreeBSD PowerPC ML From: Dennis Clarke Subject: RC2 seems to need kern.smp.disabled=1 Message-ID: <57efdab7-568c-623e-4b66-cf5ed7c138bf@blastwave.org> Date: Mon, 26 Nov 2018 14:13:07 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:64.0) Gecko/20100101 Thunderbird/64.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: AACAD84862 X-Spamd-Result: default: False [1.66 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-0.50)[-0.498,0]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.63)[0.634,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-ppc@freebsd.org]; DMARC_NA(0.00)[blastwave.org]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[mx1.netsolmail.net]; NEURAL_SPAM_LONG(0.55)[0.550,0]; RCVD_IN_DNSWL_NONE(0.00)[47.115.17.209.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; IP_SCORE(-0.02)[country: US(-0.09)]; ASN(0.00)[asn:19871, ipnet:209.17.112.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 19:13:18 -0000 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@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:~ # 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 #include #include #include #include #include #include #include #include #include #include #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 \n", argv[0] ); fprintf ( stderr, " : Where 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