From cad6a6dedbe139e48173a9f491a3457de71026e0 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Fri, 29 Apr 2011 11:17:05 -0400 Subject: [PATCH] LU-249 Allow the user to set the upper limit to the thread count on the 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 keep. Change-Id: I1952bbb5a446dd5debf5f787489e1c456da7945a Signed-off-by: James Simmons Reviewed-on: http://review.whamcloud.com/477 Tested-by: Hudson Reviewed-by: Lai Siyao Reviewed-by: Mikhail Pershin Reviewed-by: Brian J. Murrell Reviewed-by: Oleg Drokin --- lustre/autoconf/lustre-core.m4 | 17 +++++++++++++++++ lustre/include/lustre_net.h | 8 +++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index b963b6d..822af2a 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -165,6 +165,20 @@ LB_LINUX_TRY_COMPILE([ ]) # +# Allow the user to set the MDS thread upper limit +# +AC_DEFUN([LC_MDS_MAX_THREADS], +[ + 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(MDT_MAX_THREADS, $MDS_THREAD_COUNT, [maximum number of mdt threads]) + ]) +]) + +# # LC_CONFIG_BACKINGFS # # setup, check the backing filesystem @@ -2580,6 +2594,9 @@ if test $target_cpu == "i686" -o $target_cpu == "x86_64"; then CFLAGS="$CFLAGS -Werror" fi +# maximum MDS thread count +LC_MDS_MAX_THREADS + # include/liblustre.h AC_CHECK_HEADERS([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 a361f14..d9d52d0 100644 --- a/lustre/include/lustre_net.h +++ b/lustre/include/lustre_net.h @@ -129,13 +129,11 @@ #define LDLM_MAXREQSIZE (5 * 1024) #define LDLM_MAXREPSIZE (1024) +/** Absolute limits */ #define MDT_MIN_THREADS 2UL +#ifndef MDT_MAX_THREADS #define MDT_MAX_THREADS 512UL - -/** Absolute limits */ -#define MDS_THREADS_MIN 2 -#define MDS_THREADS_MAX 512 -#define MDS_THREADS_MIN_READPAGE 2 +#endif #define MDS_NBUFS (64 * cfs_num_online_cpus()) #define MDS_BUFSIZE (8 * 1024) /** -- 1.8.3.1