Whamcloud - gitweb
LU-249 Allow the user to set the upper limit to the thread count on the MDS
authorJames Simmons <uja.ornl@gmail.com>
Fri, 29 Apr 2011 15:17:05 +0000 (11:17 -0400)
committerOleg Drokin <green@whamcloud.com>
Fri, 20 May 2011 18:55:20 +0000 (11:55 -0700)
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 <uja.ornl@gmail.com>
Reviewed-on: http://review.whamcloud.com/477
Tested-by: Hudson
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Reviewed-by: Mikhail Pershin <tappro@whamcloud.com>
Reviewed-by: Brian J. Murrell <brian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/autoconf/lustre-core.m4
lustre/include/lustre_net.h

index b963b6d..822af2a 100644 (file)
@@ -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])
 
index a361f14..d9d52d0 100644 (file)
 #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)
 /**