mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Use large stacks when available
While stack size will vary by architecture it has historically defaulted to 8K on x86_64 systems. However, as of Linux 3.15 the default thread stack size was increased to 16K. These kernels are now the default in most non- enterprise distributions which means we no longer need to assume 8K stacks. This patch takes advantage of that fact by appropriately reverting stack conservation changes which were made to ensure stability. Changes which may have had a negative impact on performance for certain workloads. This also has the side effect of bringing the code slightly more in line with upstream. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Richard Yao <ryao@gentoo.org> Closes #4059
This commit is contained in:
+2
-1
@@ -7,7 +7,8 @@ AM_CFLAGS += ${NO_BOOL_COMPARE}
|
||||
AM_CFLAGS += -fno-strict-aliasing
|
||||
AM_CPPFLAGS = -D_GNU_SOURCE -D__EXTENSIONS__ -D_REENTRANT
|
||||
AM_CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_FILE_OFFSET_BITS=64
|
||||
AM_CPPFLAGS += -D_LARGEFILE64_SOURCE -DTEXT_DOMAIN=\"zfs-linux-user\"
|
||||
AM_CPPFLAGS += -D_LARGEFILE64_SOURCE -DHAVE_LARGE_STACKS=1
|
||||
AM_CPPFLAGS += -DTEXT_DOMAIN=\"zfs-linux-user\"
|
||||
AM_CPPFLAGS += -DLIBEXECDIR=\"$(libexecdir)\"
|
||||
AM_CPPFLAGS += -DRUNSTATEDIR=\"$(runstatedir)\"
|
||||
AM_CPPFLAGS += -DSBINDIR=\"$(sbindir)\"
|
||||
|
||||
+27
-1
@@ -460,9 +460,35 @@ AC_DEFUN([ZFS_AC_KERNEL_CONFIG], [
|
||||
], [
|
||||
])
|
||||
|
||||
ZFS_AC_KERNEL_CONFIG_THREAD_SIZE
|
||||
ZFS_AC_KERNEL_CONFIG_DEBUG_LOCK_ALLOC
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Check configured THREAD_SIZE
|
||||
dnl #
|
||||
dnl # The stack size will vary by architecture, but as of Linux 3.15 on x86_64
|
||||
dnl # the default thread stack size was increased to 16K from 8K. Therefore,
|
||||
dnl # on newer kernels and some architectures stack usage optimizations can be
|
||||
dnl # conditionally applied to improve performance without negatively impacting
|
||||
dnl # stability.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_CONFIG_THREAD_SIZE], [
|
||||
AC_MSG_CHECKING([whether kernel was built with 16K or larger stacks])
|
||||
ZFS_LINUX_TRY_COMPILE([
|
||||
#include <linux/module.h>
|
||||
],[
|
||||
#if (THREAD_SIZE < 16384)
|
||||
#error "THREAD_SIZE is less than 16K"
|
||||
#endif
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_LARGE_STACKS, 1, [kernel has large stacks])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Check CONFIG_DEBUG_LOCK_ALLOC
|
||||
dnl #
|
||||
@@ -572,7 +598,7 @@ dnl #
|
||||
dnl # ZFS_LINUX_CONFIG
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_LINUX_CONFIG],
|
||||
[AC_MSG_CHECKING([whether Linux was built with CONFIG_$1])
|
||||
[AC_MSG_CHECKING([whether kernel was built with CONFIG_$1])
|
||||
ZFS_LINUX_TRY_COMPILE([
|
||||
#include <linux/module.h>
|
||||
],[
|
||||
|
||||
Reference in New Issue
Block a user