Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
1d99e4d6
Commit
1d99e4d6
authored
Mar 08, 2020
by
Vicențiu Ciorbaru
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '10.2' into 10.3
parents
44045262
d7f74150
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
31 deletions
+26
-31
cmake/install_layout.cmake
cmake/install_layout.cmake
+3
-7
debian/rules
debian/rules
+0
-3
mysys/my_getncpus.c
mysys/my_getncpus.c
+23
-21
No files found.
cmake/install_layout.cmake
View file @
1d99e4d6
...
...
@@ -174,7 +174,7 @@ SET(INSTALL_SCRIPTDIR_DEB "bin")
SET
(
INSTALL_SYSCONFDIR_DEB
"/etc"
)
SET
(
INSTALL_SYSCONF2DIR_DEB
"/etc/mysql/conf.d"
)
#
SET
(
INSTALL_LIBDIR_DEB
"lib"
)
SET
(
INSTALL_LIBDIR_DEB
"lib
/
${
CMAKE_CXX_LIBRARY_ARCHITECTURE
}
"
)
SET
(
INSTALL_PLUGINDIR_DEB
"lib/mysql/plugin"
)
#
SET
(
INSTALL_INCLUDEDIR_DEB
"include/mariadb"
)
...
...
@@ -186,7 +186,7 @@ SET(INSTALL_INFODIR_DEB "share/info")
#
SET
(
INSTALL_SHAREDIR_DEB
"share"
)
SET
(
INSTALL_MYSQLSHAREDIR_DEB
"share/mysql"
)
SET
(
INSTALL_MYSQLTESTDIR_DEB
"mysql-test"
)
SET
(
INSTALL_MYSQLTESTDIR_DEB
"
share/mysql/
mysql-test"
)
SET
(
INSTALL_SQLBENCHDIR_DEB
"."
)
SET
(
INSTALL_SUPPORTFILESDIR_DEB
"share/mysql"
)
#
...
...
@@ -196,11 +196,7 @@ SET(INSTALL_UNIX_ADDRDIR_DEB "/var/run/mysqld/mysqld.sock")
SET
(
INSTALL_SYSTEMD_UNITDIR_DEB
"/lib/systemd/system"
)
SET
(
INSTALL_SYSTEMD_SYSUSERSDIR_DEB
"/usr/lib/sysusers.d"
)
SET
(
INSTALL_SYSTEMD_TMPFILESDIR_DEB
"/usr/lib/tmpfiles.d"
)
IF
(
CMAKE_SIZEOF_VOID_P EQUAL 8
)
SET
(
INSTALL_PAMDIR_DEB
"/lib/x86_64-linux-gnu/security"
)
ELSE
()
SET
(
INSTALL_PAMDIR_DEB
"/lib/i386-linux-gnu/security"
)
ENDIF
()
SET
(
INSTALL_PAMDIR_DEB
"/lib/
${
CMAKE_CXX_LIBRARY_ARCHITECTURE
}
/security"
)
#
# SVR4 layout
...
...
debian/rules
View file @
1d99e4d6
...
...
@@ -86,9 +86,6 @@ endif
-DSYSTEM_TYPE="debian-$(DEB_HOST_GNU_SYSTEM)" \
-DCMAKE_SYSTEM_PROCESSOR=$(DEB_HOST_ARCH) \
-DBUILD_CONFIG=mysql_release \
-DINSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \
-DINSTALL_PLUGINDIR=lib/mysql/plugin \
-DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test \
-DPLUGIN_AWS_KEY_MANAGEMENT=NO \
-DDEB=$(DEB_VENDOR) ..'
...
...
mysys/my_getncpus.c
View file @
1d99e4d6
...
...
@@ -30,50 +30,52 @@ static int ncpus=0;
int
my_getncpus
(
void
)
{
#if (defined(__linux__) || defined(__FreeBSD__)) && defined(HAVE_PTHREAD_GETAFFINITY_NP)
cpu_set_t
set
;
if
(
!
ncpus
)
{
/*
First attempt to get the total number of available cores. sysconf is
the fallback, but it can return a larger number. It will return the
total number of cores, not the ones available to the process - as
configured via core affinity.
*/
#if (defined(__linux__) || defined(__FreeBSD__)) && defined(HAVE_PTHREAD_GETAFFINITY_NP)
cpu_set_t
set
;
if
(
pthread_getaffinity_np
(
pthread_self
(),
sizeof
(
set
),
&
set
)
==
0
)
{
#ifdef CPU_COUNT
/* CPU_COUNT was introduced with glibc 2.6. */
ncpus
=
CPU_COUNT
(
&
set
);
}
else
{
#ifdef _SC_NPROCESSORS_ONLN
ncpus
=
sysconf
(
_SC_NPROCESSORS_ONLN
);
#else
ncpus
=
2
;
/* Implementation for platforms with glibc < 2.6 */
size_t
i
;
for
(
i
=
0
;
i
<
CPU_SETSIZE
;
i
++
)
if
(
CPU_ISSET
(
i
,
&
set
))
ncpus
++
;
#endif
return
ncpus
;
}
}
#else
/* __linux__ || FreeBSD && HAVE_PTHREAD_GETAFFINITY_NP */
#endif
/* (__linux__ || __FreeBSD__) && HAVE_PTHREAD_GETAFFINITY_NP */
if
(
!
ncpus
)
{
#ifdef _SC_NPROCESSORS_ONLN
ncpus
=
sysconf
(
_SC_NPROCESSORS_ONLN
);
#elif defined(__WIN__)
SYSTEM_INFO
sysinfo
;
/*
*
We are not calling GetNativeSystemInfo here because (1) we
*
don't believe that they return different values for number
*
of processors and (2) if WOW64 limits processors for Win32
*
then we don't want to try to override that.
We are not calling GetNativeSystemInfo here because (1) we
don't believe that they return different values for number
of processors and (2) if WOW64 limits processors for Win32
then we don't want to try to override that.
*/
GetSystemInfo
(
&
sysinfo
);
ncpus
=
sysinfo
.
dwNumberOfProcessors
;
#else
/*
u
nknown so play safe: assume SMP and forbid uniprocessor build */
/*
U
nknown so play safe: assume SMP and forbid uniprocessor build */
ncpus
=
2
;
#endif
}
#endif
/* __linux__ || FreeBSD && HAVE_PTHREAD_GETAFFINITY_NP */
return
ncpus
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment