Hi, Sergey! On Nov 27, Sergey Vojtovich wrote:
revision-id: 6c19f0b0eb0600c276f8681673dc768d542d3bd3 (mariadb-10.1.9-8-g6c19f0b) parent(s): 3c0e9d31b3e6494931deb09f5c93b05a96df8471 committer: Sergey Vojtovich timestamp: 2015-11-27 13:58:30 +0400 message:
MDEV-9172 - Analyze patches for IBM System z
Extended my_timer_cycles() to support s390. Some compiler tunings for RHEL/SLES RPM packages on s390.
diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake index 8c79ec2..75ce57e 100644 --- a/cmake/build_configurations/mysql_release.cmake +++ b/cmake/build_configurations/mysql_release.cmake @@ -154,6 +154,25 @@ IF(UNIX) SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_CXX_FLAGS}") ENDIF()
+ # IBM Z flags + IF(CMAKE_SYSTEM_PROCESSOR MATCHES "s390x") + IF(RPM MATCHES "(rhel|centos)6" OR RPM MATCHES "(suse|sles)11") + SET(z_flags "-funroll-loops -march=z9-109 -mtune=z10 ") + ELSEIF(RPM MATCHES "(rhel|centos)7" OR RPM MATCHES "(suse|sles)12") + SET(z_flags "-funroll-loops -march=z196 -mtune=zEC12 ") + ELSE() + SET(z_flags "") + ENDIF()
Does MariaDB compile and work without these flags?
diff --git a/mysys/my_rdtsc.c b/mysys/my_rdtsc.c index 82e5609..4228973 100644 --- a/mysys/my_rdtsc.c +++ b/mysys/my_rdtsc.c @@ -249,6 +249,13 @@ ulonglong my_timer_cycles(void) clock_gettime(CLOCK_SGI_CYCLE, &tp); return (ulonglong) tp.tv_sec * 1000000000 + (ulonglong) tp.tv_nsec; } +#elif defined(__GNUC__) && defined(__s390__) + /* covers both s390 and s390x */ + { + ulonglong result; + __asm__ __volatile__ ("stck %0" : "=Q" (result) : : "cc");
I cannot really review that :) If you've checked the documentation and tested it and whatever, then let's push it.
+ return result; + } #elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME)
Regards, Sergei Chief Architect MariaDB and security@mariadb.org -- Vote for my Percona Live 2016 talks: https://www.percona.com/live/data-performance-conference-2016/sessions/maria... https://www.percona.com/live/data-performance-conference-2016/sessions/maria...