From a485a00a3b238ffb7d91b942fb3ab68be1758422 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Tue, 27 Mar 2012 08:46:56 -0400 Subject: [PATCH] LU-249 mds: Increase the maximum number of threads on MDS Currently the largest number of the threads that can exist on the MDS is 512. For very large system is those threads can easily be exhausted and end up back logging the system. This patch allows the user to define the upper limit of how many threads are created on the MDS. If not selected the default behavior of 512 is kept. Change-Id: Ie48eb00f48ddcd98cc518178ba5e1da9ea1e40eb Signed-off-by: James Simmons Reviewed-on: http://review.whamcloud.com/2354 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Johann Lombardi --- lustre/autoconf/lustre-core.m4 | 17 +++++++++++++++++ lustre/include/lustre_net.h | 2 ++ 2 files changed, 19 insertions(+) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 74552bd..1a86fce 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -90,6 +90,20 @@ kernel patches from Lustre version 1.4.3 or above.]) ]) # +# Allow the user to set the MDS thread upper limit +# +AC_DEFUN([LC_MDS_THREADS_MAX], +[ + AC_ARG_WITH([mds_max_threads], + AC_HELP_STRING([--with-mds-max-threads=size], + [define the maximum number of threads available on the MDS: (default=512)]), + [ + MDS_THREAD_COUNT=$with_mds_max_threads + AC_DEFINE_UNQUOTED(MDS_THREADS_MAX, $MDS_THREAD_COUNT, [maximum number of mdt threads]) + ]) +]) + +# # LC_CONFIG_BACKINGFS # # setup, check the backing filesystem @@ -2410,6 +2424,9 @@ if test $target_cpu == "i686" -o $target_cpu == "x86_64"; then CFLAGS="$CFLAGS -Werror" fi +# maximum MDS thread count +LC_MDS_THREADS_MAX + # include/liblustre.h AC_CHECK_HEADERS([asm/page.h sys/user.h sys/vfs.h stdint.h blkid/blkid.h]) diff --git a/lustre/include/lustre_net.h b/lustre/include/lustre_net.h index 02ec64c..1efff00 100644 --- a/lustre/include/lustre_net.h +++ b/lustre/include/lustre_net.h @@ -111,7 +111,9 @@ /* Absolute limits */ #define MDS_THREADS_MIN 2 +#ifndef MDS_THREADS_MAX #define MDS_THREADS_MAX 512 +#endif #define MDS_THREADS_MIN_READPAGE 2 #define MDS_NBUFS (64 * num_online_cpus()) #define MDS_BUFSIZE (8 * 1024) -- 1.8.3.1