[Pvfs2-cvs] commit by pw in pvfs2: Makefile.in configure configure.in

CVS commit program cvs at parl.clemson.edu
Fri Feb 15 14:17:22 EST 2008


Update of /projects/cvsroot/pvfs2
In directory parlweb1:/tmp/cvs-serv696

Modified Files:
	Makefile.in configure configure.in 
Log Message:
threaded kmod helper

Add --enable-threaded-kmod-helper option to build a threaded
pvfs2-client-core, that is, an executable linked against
pvfs2-threaded.so.  Take care to make sure only what libraries
are needed based on --enable-static, --enable-shared, and this
new option.

Remove the "--threaded" argument from pvfs2-client.  Whatever version
of client-core that was configured is all that is available at runtime.
It will always be installed as pvfs2-client-core.



Index: Makefile.in
===================================================================
RCS file: /projects/cvsroot/pvfs2/Makefile.in,v
diff -u -p -p -u -r1.258 -r1.259
--- Makefile.in	12 Feb 2008 22:22:43 -0000	1.258
+++ Makefile.in	15 Feb 2008 19:17:20 -0000	1.259
@@ -406,8 +406,7 @@ VISMISCSRC :=
 KARMASRC :=
 # userland helper programs for kernel drivers
 KERNAPPSRC :=
-#
-KERNAPPSTHRSRC :=
+KERNAPPTHRSRC :=
 # MISCSRC are sources that don't fall into the other categories
 MISCSRC := 
 # c files generated from state machines
@@ -425,18 +424,18 @@ SERVER_STUB := src/server/pvfs2-server-s
 SERVER := src/server/pvfs2-server
 endif
 
-# LIBRARIES is a list of the pvfs2 client libraries
+# LIBRARIES is a list of the pvfs2 client libraries that will be installed
 LIBRARIES :=
 LIBRARIES_THREADED :=
 ifeq ($(build_shared),yes)
 LIBRARIES_SHARED = lib/libpvfs2.so
 LIBRARIES += $(LIBRARIES_SHARED)
+LIBRARIES_THREADED += lib/libpvfs2-threaded.so
 endif
 ifeq ($(build_static),yes)
 LIBRARIES_STATIC = lib/libpvfs2.a
 LIBRARIES += $(LIBRARIES_STATIC)
-LIBRARIES_THREADED_STATIC = lib/libpvfs2-threaded.a
-LIBRARIES_THREADED += $(LIBRARIES_THREADED_STATIC)
+LIBRARIES_THREADED += lib/libpvfs2-threaded.a
 endif
 
 ################################################################
@@ -498,14 +497,21 @@ MISCOBJS := $(patsubst %.c,%.o, $(filter
 MISCDEPENDS := $(patsubst %.c,%.d, $(filter %.c,$(MISCSRC)))
 
 # KERNAPPOBJS is a list of kernel driver userland objects
-KERNAPPOBJS := $(patsubst %.c,%.o, $(filter %.c,$(KERNAPPSRC)))
+KERNAPPOBJS := $(patsubst %.c,%.o, $(filter %.c,$(KERNAPPSRC))) \
+               $(patsubst %.c,%-threaded.o, $(filter %.c,$(KERNAPPTHRSRC)))
 # KERNAPPS is a list of kernel driver userland executables
 KERNAPPS := $(patsubst %.c,%, $(filter %.c, $(KERNAPPSRC)))
+KERNAPPSTHR := $(patsubst %.c,%, $(filter %.c, $(KERNAPPTHRSRC)))
 # KERNAPPDEPENDS is a list of dependency files for kernel driver userland
 # objects
-KERNAPPDEPENDS := $(patsubst %.c,%.d, $(filter %.c,$(KERNAPPSRC)))
-
-KERNAPPSTHR := $(patsubst %.c,%-threaded, $(filter %.c, $(KERNAPPSTHRSRC)))
+KERNAPPDEPENDS := $(patsubst %.c,%.d, $(filter %.c,$(KERNAPPSRC) $(KERNAPPTHRSRC)))
+# Be sure to build/install the threaded lib too; just pick the shared
+# one if configure asked for both.
+ifneq (,$(KERNAPPSTHR))
+ifeq (,$(filter $(firstword $(LIBRARIES_THREADED)),$(LIBRARIES)))
+LIBRARIES += $(firstword $(LIBRARIES_THREADED))
+endif
+endif
 
 # VISOBJS is a list of visualization program objects
 VISOBJS := $(patsubst %.c,%.o, $(filter %.c,$(VISSRC)))
@@ -715,8 +721,11 @@ $(VISS): %: %.o $(VISMISCOBJS) $(LIBRARI
 # all applications depend on the pvfs2 library
 $(ADMINTOOLS): %: %.o $(LIBRARIES)
 $(ADMINTOOLS_SERVER): %: %.o $(LIBRARIES) lib/libpvfs2-server.a
+
 $(KERNAPPS): %: %.o $(LIBRARIES)
 $(KERNAPPSTHR): %: %.o $(LIBRARIES_THREADED)
+	$(Q) "  LD		$@"
+	$(E)$(LD) -o $@ $(LDFLAGS) $< $(LIBS_THREADED) $(call modldflags,$<)
 
 # special rules to build state machine compiler using build host compiler
 $(STATECOMPOBJS): %.o: %.c
@@ -943,7 +952,7 @@ just_kmod_install: just_kmod
 .PHONY: kmod_install
 kmod_install: kmod kernapps just_kmod_install
 	install -d $(prefix)/sbin
-	install -m 755 $(KERNAPPS) $(prefix)/sbin
+	install -m 755 $(KERNAPPS) $(KERNAPPSTHR) $(prefix)/sbin
 endif
 
 ifneq (,$(LINUX24_KERNEL_SRC))
@@ -964,7 +973,7 @@ just_kmod24_install: just_kmod24
 .PHONY: kmod24_install
 kmod24_install: kmod24 kernapps just_kmod24_install
 	install -d $(prefix)/sbin
-	install -m 755 $(KERNAPPS) $(prefix)/sbin
+	install -m 755 $(KERNAPPS) $(KERNAPPSTHR) $(prefix)/sbin
 	install -m 755 src/apps/kernel/linux/mount.pvfs2 $(prefix)/sbin
 	@echo ""
 	@echo "For improved linux-2.4 support,"

Index: configure
===================================================================
RCS file: /projects/cvsroot/pvfs2/configure,v
diff -u -p -p -u -r1.378 -r1.379
--- configure	12 Feb 2008 22:22:43 -0000	1.378
+++ configure	15 Feb 2008 19:17:20 -0000	1.379
@@ -692,6 +692,7 @@ build_static
 REDHAT_RELEASE
 NPTL_WORKAROUND
 MISC_TROVE_FLAGS
+THREADED_KMOD_HELPER
 LINUX_KERNEL_SRC
 LINUX24_KERNEL_SRC
 LINUX24_KERNEL_MINOR_VER
@@ -1331,6 +1332,7 @@ Optional Features:
   --disable-aio-threaded-callbacks  Disable use of AIO threaded callbacks
   --disable-kernel-aio    Forcibly disable kernel aio
   --enable-kernel-sendfile    Forcibly enable kernel sendfile
+  --enable-threaded-kmod-helper  Use threads in the kernel helper application
   --enable-fast           Disable optional debugging, enable optimizations.
   --enable-strict         Turn on strict compiler warnings
   --enable-verbose-build  Enables full output during build process
@@ -5966,6 +5968,58 @@ fi
 
 
 
+#
+# Threading options.
+#
+# Client - thread-safe or not
+#   --disable-thread-safety : chooses null or posix locking mechanism
+#   For applications that know they are not multi-threaded, or choose
+#   to handle locking themselves, this configure option can be used to
+#   slightly decrease library-induced latency by removing the locking.
+#
+# Client - job threading
+#   libpvfs2-threaded.{so,a} with __PVFS2_JOB_THREADED__
+#   This option causes the client library to spawn an extra thread
+#   to handle network communications.  In this way, it is possible
+#   that the library can handle new and completed requests from
+#   the application while also interacting with the network.
+#
+#   These separate libraries can not be built using the existing
+#   configure mechanism.  They are only built if required by the
+#   kernel module helper.
+#
+# Server - three options:
+#   trove
+#     (hack Makefile.in)
+#   job
+#     (hack Makefile.in)
+#   aio
+#     --disable-aio-threaded-callbacks
+#
+#   Trove (storage) and job threading in the server are implemented
+#   using #defines, but not exported through the configure mechanism.
+#   AIO threaded callbacks are a separate thread used in conjunction
+#   with trove, and can be disabled through a configure option as
+#   AIO has been found to be buggy on many systems.
+#
+#
+# Kernel module helper - job threading
+#   --enable-threaded-kmod-helper
+#
+#   This is a special client that "helps" applications that access PVFS
+#   through the kernel using normal VFS calls (e.g. "ls").  This
+#   configure options builds it using __PVFS2_JOB_THREADED__ as described
+#   above.  That enables a thread for the network layer and a thread
+#   for the kernel interface.  This has the potential to increase the
+#   rate at which concurrent operations are processed, but has the potential
+#   drawback of somewhat higher overhead for a single operation and lack
+#   of testing.
+#
+#   Enabling this options causes one of libpvfs2-threaded.{so,a} to be
+#   built, depending on --enable-shared and --enable-static.  If both are
+#   enabled, the shared library takes precedence.
+#
+
 { echo "$as_me:$LINENO: checking for client library thread safety support" >&5
 echo $ECHO_N "checking for client library thread safety support... $ECHO_C" >&6; }
 # Check whether --enable-thread-safety was given.
@@ -11759,6 +11813,16 @@ _ACEOF
 
 fi
 
+# Check whether --enable-threaded-kmod-helper was given.
+if test "${enable_threaded_kmod_helper+set}" = set; then
+  enableval=$enable_threaded_kmod_helper;  if test "x$enableval" = "xyes" ; then
+    THREADED_KMOD_HELPER=yes
+  fi
+
+fi
+
+
+
 BUILD_ABSOLUTE_TOP=`pwd`
 SRC_RELATIVE_TOP=$srcdir
 SRC_ABSOLUTE_TOP=`cd $srcdir ; pwd`
@@ -18459,6 +18523,7 @@ build_static!$build_static$ac_delim
 REDHAT_RELEASE!$REDHAT_RELEASE$ac_delim
 NPTL_WORKAROUND!$NPTL_WORKAROUND$ac_delim
 MISC_TROVE_FLAGS!$MISC_TROVE_FLAGS$ac_delim
+THREADED_KMOD_HELPER!$THREADED_KMOD_HELPER$ac_delim
 LINUX_KERNEL_SRC!$LINUX_KERNEL_SRC$ac_delim
 LINUX24_KERNEL_SRC!$LINUX24_KERNEL_SRC$ac_delim
 LINUX24_KERNEL_MINOR_VER!$LINUX24_KERNEL_MINOR_VER$ac_delim
@@ -18476,7 +18541,6 @@ GNUC!$GNUC$ac_delim
 DB_CFLAGS!$DB_CFLAGS$ac_delim
 DB_LIB!$DB_LIB$ac_delim
 NEEDS_LIBRT!$NEEDS_LIBRT$ac_delim
-TARGET_OS_DARWIN!$TARGET_OS_DARWIN$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -18518,6 +18582,7 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+TARGET_OS_DARWIN!$TARGET_OS_DARWIN$ac_delim
 TARGET_OS_LINUX!$TARGET_OS_LINUX$ac_delim
 BUILD_BMI_TCP!$BUILD_BMI_TCP$ac_delim
 BUILD_GM!$BUILD_GM$ac_delim
@@ -18544,7 +18609,7 @@ LIBOBJS!$LIBOBJS$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 24; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 25; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5

Index: configure.in
===================================================================
RCS file: /projects/cvsroot/pvfs2/configure.in,v
diff -u -p -p -u -r1.337 -r1.338
--- configure.in	12 Feb 2008 22:22:45 -0000	1.337
+++ configure.in	15 Feb 2008 19:17:22 -0000	1.338
@@ -91,6 +91,58 @@ AC_SUBST(BUILD_CC)
 AC_SUBST(BUILD_CFLAGS)
 AC_SUBST(BUILD_LDFLAGS)
 
+#
+# Threading options.
+#
+# Client - thread-safe or not
+#   --disable-thread-safety : chooses null or posix locking mechanism
+#   For applications that know they are not multi-threaded, or choose
+#   to handle locking themselves, this configure option can be used to
+#   slightly decrease library-induced latency by removing the locking.
+#
+# Client - job threading
+#   libpvfs2-threaded.{so,a} with __PVFS2_JOB_THREADED__
+#   This option causes the client library to spawn an extra thread
+#   to handle network communications.  In this way, it is possible
+#   that the library can handle new and completed requests from
+#   the application while also interacting with the network.
+#
+#   These separate libraries can not be built using the existing
+#   configure mechanism.  They are only built if required by the
+#   kernel module helper.
+#
+# Server - three options:
+#   trove
+#     (hack Makefile.in)
+#   job
+#     (hack Makefile.in)
+#   aio
+#     --disable-aio-threaded-callbacks
+#
+#   Trove (storage) and job threading in the server are implemented
+#   using #defines, but not exported through the configure mechanism.
+#   AIO threaded callbacks are a separate thread used in conjunction
+#   with trove, and can be disabled through a configure option as
+#   AIO has been found to be buggy on many systems.
+#
+#
+# Kernel module helper - job threading
+#   --enable-threaded-kmod-helper
+#
+#   This is a special client that "helps" applications that access PVFS
+#   through the kernel using normal VFS calls (e.g. "ls").  This
+#   configure options builds it using __PVFS2_JOB_THREADED__ as described
+#   above.  That enables a thread for the network layer and a thread
+#   for the kernel interface.  This has the potential to increase the
+#   rate at which concurrent operations are processed, but has the potential
+#   drawback of somewhat higher overhead for a single operation and lack
+#   of testing.
+#
+#   Enabling this options causes one of libpvfs2-threaded.{so,a} to be
+#   built, depending on --enable-shared and --enable-static.  If both are
+#   enabled, the shared library takes precedence.
+#
+
 dnl a mechanism to turn off threads in the client library
 AC_MSG_CHECKING([for client library thread safety support])
 AC_ARG_ENABLE(thread-safety,
@@ -522,6 +574,19 @@ if test -n "$lk_src" ; then
     AX_KERNEL_FEATURES
     AC_DEFINE(WITH_LINUX_KMOD, 1, [Define to build for linux kernel module userspace helper.])
 fi
+
+dnl
+dnl Enabling this option links pvfs2-client-core against libpvfs2-threaded.so.
+dnl Note that even without this option, pvfs2-client-core always requires
+dnl pthreads to run its remount thread.
+dnl
+AC_ARG_ENABLE([threaded-kmod-helper],
+[  --enable-threaded-kmod-helper  Use threads in the kernel helper application],
+[ if test "x$enableval" = "xyes" ; then
+    THREADED_KMOD_HELPER=yes
+  fi
+])
+AC_SUBST(THREADED_KMOD_HELPER)
 
 dnl PAV configuration needs absolute location of source and build.
 dnl Linux-2.6 module needs absolute location of source, and uses the



More information about the Pvfs2-cvs mailing list