[Iofsl-commits] branch, master, updated. merge-start-376-g35f2973
mysql vizuser
noreply at mcs.anl.gov
Wed Sep 11 10:44:29 CDT 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".
The branch, master has been updated
via 35f2973e8648ac66297df551516c06691383997a (commit)
via f03f53464af39caa080b390c5301446266c25e57 (commit)
via 901091ca3e752eb7043197c94f6a9764d0bbbc7b (commit)
via afe59acaa436a4744833db5707c6544f8174c2ac (commit)
via 4b6c71b1d3075226759fd68193b5f7e7bfb95224 (commit)
via 414a48b65e25c251786b101c44c76bd36a1f2ae2 (commit)
via 394f7d3da71f82c84dbed2d5692dd84c8a3094bc (commit)
via 868373402dacb06b8ef468abc2e7023def19cd1b (commit)
via af5c4044a10a4be1acedfc8ef8d8af44bc5648a4 (commit)
via b616dabf632229865c8ee3c8efebd1680fe20e9c (commit)
via 11ea3f4918f6de84764bd7cbe922d3fe3c551677 (commit)
via 8fa3865f7b0108e803d0801df8d9c57cf82fd6d3 (commit)
via 9008831950b1a2b52a586b6e455fc4b57e7f991e (commit)
via d374176fc89bdd8578a6b7d3793e4f5910a116d1 (commit)
via 2c72e8c7eea617af50aa526d8e32b9aa42ca0382 (commit)
via 4095c99f96dae0466e2e1f1b4bea1abe262f8cd8 (commit)
via d314f1dd7a615a4d43eac7564a5d2b504a79fe95 (commit)
from 37920582b5b849c7c8f8eb08732313021837cb7d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 35f2973e8648ac66297df551516c06691383997a
Author: Dries Kimpe <dkimpe at mcs.anl.gov>
Date: Wed Sep 11 10:24:26 2013 -0500
Spec file for IOFWD.
Contributed by "Zhang, Jingwang" <Jingwang.Zhang at emc.com>.
commit f03f53464af39caa080b390c5301446266c25e57
Author: Dries Kimpe <dkimpe at mcs.anl.gov>
Date: Wed Sep 11 10:01:56 2013 -0500
Make scripts/search-source.sh handle leading dash
commit 901091ca3e752eb7043197c94f6a9764d0bbbc7b
Author: Dries Kimpe <dkimpe at mcs.anl.gov>
Date: Wed Sep 11 09:44:17 2013 -0500
Fix build quality test/autotest scripts
- Update README in scripts dir
- Revert "initial testing script implementation"
This reverts commit 511a1dc7abd6cde10915a7365c0344d811f8dfbb.
commit afe59acaa436a4744833db5707c6544f8174c2ac
Author: Dries Kimpe <dkimpe at mcs.anl.gov>
Date: Tue Sep 10 20:34:22 2013 -0500
Disable protocol buffer requirement for FTB
FTB service is not receiving further development,
so disable for now.
This commit removes the protocol buffer dependency
(used only to encode the message being broadcasted over FTB)
commit 4b6c71b1d3075226759fd68193b5f7e7bfb95224
Author: Zhang Jingwang <jingwang.zhang at emc.com>
Date: Sat Apr 27 03:27:06 2013 -0400
Fix a race condition in state machine mode.
Resuming an active state machine might lead to an assertion. So if
it is an active state machine, we need to wait for it to complete
first and then resume it.
commit 414a48b65e25c251786b101c44c76bd36a1f2ae2
Author: Zhang Jingwang <jingwang.zhang at emc.com>
Date: Mon Jan 28 01:41:04 2013 -0500
Revert "Fix multi-thread problem in the "old" zoidfsclient."
This reverts commit dad2e6309603cee63f8743b0199784ed90ec8a0f.
The reverted patch is not the right fix. The problem should
be properly fixed by reverting the patch who changed BMI_test
to BMI_testcontext.
commit 394f7d3da71f82c84dbed2d5692dd84c8a3094bc
Author: Zhang Jingwang <jingwang.zhang at emc.com>
Date: Tue Jan 22 03:30:34 2013 -0500
Revert "change zoidfs c client to use BMI_testcontext instead of BMI_test"
Using BMI_testcontext will break multi-threaded applications.
This reverts commit 055c6757766790ae51bdf228fef5193e61d64390.
commit 868373402dacb06b8ef468abc2e7023def19cd1b
Author: Zhang Jingwang <jingwang.zhang at emc.com>
Date: Sun Jan 20 21:47:27 2013 -0500
Revert "Fix for page cache issue from Gary"
Previously, we found that when the memory is full of cached pages
(even they are all clean) the performance will drop significantly.
So we clear all cached pages when the file is closed.
However now we found that the problem is in Linux kernel and it has
been fixed in CentOS 6.2. So the previous patch is unnecessary if
we avoid to use SLES 11.
This reverts commit a62a6eea75041e7418f89e8d3dc6798ab67b254a.
commit af5c4044a10a4be1acedfc8ef8d8af44bc5648a4
Author: Zhang Jingwang <jingwang.zhang at emc.com>
Date: Tue Jan 15 01:26:25 2013 -0500
Add performance counter to monitor write performance.
Five counters are added by this commit, here is the details:
- write_sm: Counter on how many write state machine tasks are created.
It will be increased by one when a new write request arrives.
- write_sm_livetime: The duration from a specific write request is
created to the time it is deleted.
- write_sm_recvtime: The time duration spent to receive the data buffer
from the client in a write request.
- write_sm_waittime: The time duration spent in waiting for CPU in the
task queue for every write request.
- write_sm_fsiotime: The time duration spent in performing IO requests
to the backend file system.
This commit added a dumper thread to dump all the counters to std::cout
periodically. You can start this thread by giving a positive number to
"counters { dumpinterval = %% }" in the configure file.
These counters could be enabled separately in the configure file, this
commit also demonstrated how to do that.
Change-Id: Ieaf4d1f6c2ed71e8c17df3ab1f588be133c88a5a
commit b616dabf632229865c8ee3c8efebd1680fe20e9c
Author: Zhang Jingwang <jingwang.zhang at emc.com>
Date: Thu Dec 13 02:39:02 2012 -0500
Using a Cray ThreadPool implementation as default
The old default thread pool will create lots of short-lived threads
(and was the optimal one for BG/P systems running Zepto);
However, on most other systems, this is not the optimal behaviour,
especially under memory pressure.
Switch default to Cray Threadpool implementation.
commit 11ea3f4918f6de84764bd7cbe922d3fe3c551677
Author: Dom Cote <coted1 at emc.com>
Date: Wed Dec 5 22:12:52 2012 -0500
Extra '$' in configure.ac causes build to fail
Make calls autoconf in some cases and the boggus extra "$" gets reintroduced into the configure script, despite the previous fix.
This will cause g++ to fail by supplying a boggus filename, which in turn will show as an error like "cannot compute the size of size_t".
I have traced it back to this file.
If removed, then one can execute $./configure ... followed by $make without bumping into the issue.
Change-Id: Ie65765c82bbbb7b8fa78303d7663504c3141cbee
commit 8fa3865f7b0108e803d0801df8d9c57cf82fd6d3
Author: Zhang Jingwang <jingwang.zhang at emc.com>
Date: Wed Nov 28 03:13:36 2012 -0500
Advance the iterator before it is erased
Otherwise, the iterator might be invalidated by erase().
commit 9008831950b1a2b52a586b6e455fc4b57e7f991e
Author: Zhang Jingwang <jingwang.zhang at emc.com>
Date: Thu Oct 11 22:17:01 2012 -0400
Fix for page cache issue from Gary
Implement zoidfs_commit() call to drop all the page caches belong
to the given file. So that the client can use this call to release
page caches in the server side.
commit d374176fc89bdd8578a6b7d3793e4f5910a116d1
Author: Zhang Jingwang <jingwang.zhang at emc.com>
Date: Thu Sep 20 03:53:20 2012 -0400
Fix file caching issue when file is deleted.
Release the dcache entry and close the file when it is deleted. So
that underlying resources could be released.
commit 2c72e8c7eea617af50aa526d8e32b9aa42ca0382
Author: Zhang Jingwang <jingwang.zhang at emc.com>
Date: Wed Sep 12 03:27:31 2012 -0400
Fix multi-thread problem in the "old" zoidfsclient.
context cannot be shared among threads, so we should create context
for every thread.
In the fix, I create a BMI context in the private data of this thread.
commit 4095c99f96dae0466e2e1f1b4bea1abe262f8cd8
Author: root <root at debian.corp.emc.com>
Date: Thu Sep 6 22:29:46 2012 +0800
Move the ifdef HAVE_CUNIT to avoid undefined flags.
commit d314f1dd7a615a4d43eac7564a5d2b504a79fe95
Author: root <root at debian.corp.emc.com>
Date: Wed Apr 18 01:19:22 2012 +0800
fuse client should load the oldclient library
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 2 +-
defaultconfig.cf | 6 ++
iofwd.spec | 44 +++++++++++++++
lib/bmi | 1 -
scripts/README | 23 ++++++--
scripts/runtest.sh | 7 ++-
scripts/search-source.sh | 2 +-
src/iofwd/IOFWDMain.cpp | 31 ++++++++++-
src/iofwd/extraservice/ftb/FTBService.cpp | 16 +++---
src/iofwd/tasksm/WriteTaskSM.cpp | 79 ++++++++++++++++++++++++++++
src/iofwd/tasksm/WriteTaskSM.hh | 27 ++++++++++
src/iofwdevent/BMIResource.cpp | 8 ++-
src/iofwdutil/ThreadPool.hh | 1 +
src/iofwdutil/stats/CounterConfig.hh | 2 +-
src/iofwdutil/stats/SingleCounter.hh | 3 +
src/sm/SimpleSM.hh | 9 ++--
src/zoidfs/client/bmi_comm.c | 28 ++++++----
src/zoidfs/dispatcher/posix/zoidfs-posix.c | 10 ++++
test/Makefile.subdir | 6 ++-
{src/fuse => test}/zoidfs-fuse.c | 0
20 files changed, 264 insertions(+), 41 deletions(-)
create mode 100644 iofwd.spec
delete mode 160000 lib/bmi
copy {src/fuse => test}/zoidfs-fuse.c (100%)
Diff of changes:
diff --git a/configure.ac b/configure.ac
index 1a5f2ae..8b9f026 100644
--- a/configure.ac
+++ b/configure.ac
@@ -421,7 +421,7 @@ AC_CHECK_HEADER_DEFINE([<bmi.h>],[BMI_TCP_CHECK_UNEXPECTED],[],
AC_LANG_POP
CPPFLAGS="$OLDCPPFLAGS $BMI_CPPFLAGS"
-LDFLAGS="$OLDLDFLAGS $BMI_LDFLAGS$"
+LDFLAGS="$OLDLDFLAGS $BMI_LDFLAGS"
AC_SUBST([BMI_CPPFLAGS])
AC_SUBST([BMI_LDFLAGS])
diff --git a/defaultconfig.cf b/defaultconfig.cf
index f9ef172..74ab4a6 100644
--- a/defaultconfig.cf
+++ b/defaultconfig.cf
@@ -213,3 +213,9 @@ requesthandler {
//}
}
+
+counters
+{
+ sm = "write_sm_livetime.time.single.counter,write_sm.inc.single.counter,write_sm_recvtime.time.single.counter";
+ dumpinterval = "1";
+}
diff --git a/iofwd.spec b/iofwd.spec
new file mode 100644
index 0000000..4db2a38
--- /dev/null
+++ b/iofwd.spec
@@ -0,0 +1,44 @@
+%{!?_release: %define _release none}
+Name: iofwd
+Version: 1.1.0
+Release: %{_release}%{?dist}
+Summary: IOFWD server and client libraries.
+Group: Productivity/Networking/Iofsl
+License: BSD
+Source: %{name}-%{version}.tar.gz
+Prefix: /usr
+BuildRoot: %{_buildrootdir}
+
+BuildRequires: orangefs
+Requires: orangefs
+
+%description
+IOFWD server and client libraries.
+
+%prep
+%setup -q
+
+%build
+./configure CFLAGS=-fPIC --with-boost --with-boost-libdir=/usr/lib64 --without-mpi --prefix=%{_prefix} --libdir=%{_libdir}
+%{__make} %{?_smp_mflags}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%{__make} install DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,-)
+%doc defaultconfig.cf
+%{_libdir}/*
+%{_libdir}/pkgconfig/iofslrouter.pc
+%{_libdir}/pkgconfig/iofsl.pc
+%{_bindir}/zoidfsfuse
+%{_bindir}/iofwd
+%{_includedir}/*
+
+%changelog
+* Tue Jun 04 2013 Zhang Jingwang <jingwang.zhang at emc.com> - 1.1.0-1
+- Rewrite the spec file to get rid of rpmlint warning messages.
diff --git a/lib/bmi b/lib/bmi
deleted file mode 160000
index b7a189c..0000000
--- a/lib/bmi
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit b7a189c3a923d33f6a2e1b0f9c90240149587a13
diff --git a/scripts/README b/scripts/README
index abff4d7..50e3558 100644
--- a/scripts/README
+++ b/scripts/README
@@ -6,16 +6,28 @@ export IOFWD_SRCDIR=your_local_git_checkout_dir
Next you need to set the configure options/flags in
scripts/configoptions.your_host_name
+== Please do not modify any of the scripts directly and do not commit ==
+== any of the configoptions.yourhostname as they are specific to your ==
+== system. ==
+
Then run scripts/prepush.sh before pushing to the master repository.
Overview:
-scripts/prepush.sh: will build all revision that will be pushed on git push
-scripts/doeconfig.sh: will configure source tree using options from configfile
-scripts/runtest.sh: will run make distcheck with the correct options
+* scripts/prepush.sh:
+ - will build all revision that will be pushed on git push
+* scripts/doeconfig.sh:
+ - will configure source tree using options from configfile
+* scripts/runtest-rev.sh <gitrev>:
+ - builds and tests the specified git rev (use HEAD for current)
+ head of your local branch
+ (note: this is NOT does not include uncommitted (local) changes)
+* scripts/runtest-range.sh <range>: builds and tests specified range
+ - uses runtest-rev.sh internally
+* scripts/runtest.sh:
+ - will run make distcheck with the correct options
(i.e. builds your current source tree)
-scripts/runtest-rev.sh <gitrev>: builds and tests the specified git rev
-scripts/runtest-range.sh <range>: builds and tests specified range
+
Logs will be in ${IOFWD_SRCDIR}/buildlogs.
runtest-rev.log will, for each revision tested using runtest-rev.sh,
@@ -27,3 +39,4 @@ scripts/runtest-rev.sh HEAD
scripts/runtest-range.sh abc12..bcds23
+
diff --git a/scripts/runtest.sh b/scripts/runtest.sh
index 2a34a23..592b9c5 100755
--- a/scripts/runtest.sh
+++ b/scripts/runtest.sh
@@ -3,7 +3,6 @@
#
# Prepares, builds and tests
#
-IOFWD_SRCDIR=/homes/rjdamore/iofsl
SRCDIR=$PWD
if test -z "${IOFWD_SRCDIR}" ; then
echo "Need IOFWD_SRCDIR ! (to find configoptions)"
@@ -18,10 +17,12 @@ if test -r "${CONFIGFILE}" ; echo "config file is $CONFIGFILE" ; then
else echo "could not use config file"
fi
+OLDDIR="${PWD}"
cd ${SRCDIR}
./prepare || exit 1
+${SRCDIR}/configure ${DISTCHECK_CONFIGURE_FLAGS} || exit 2
+make distcheck || exit 3
+cd "${OLDDIR}"
-${SRCDIR}/configure ${CONFIGURE_OPTIONS} || exit 2
-make distcheck || exit 3
diff --git a/scripts/search-source.sh b/scripts/search-source.sh
index 7e9d94c..ae2e03a 100755
--- a/scripts/search-source.sh
+++ b/scripts/search-source.sh
@@ -7,4 +7,4 @@ else
fi
cd $DIR
-find . -iname \*.h -o -iname \*.c -o -iname \*.cpp -o -iname \*.hh | xargs grep "$*"
+find . -iname \*.h -o -iname \*.c -o -iname \*.cpp -o -iname \*.hh | xargs grep -- "$*"
diff --git a/src/iofwd/IOFWDMain.cpp b/src/iofwd/IOFWDMain.cpp
index a1891cc..ab29ea7 100644
--- a/src/iofwd/IOFWDMain.cpp
+++ b/src/iofwd/IOFWDMain.cpp
@@ -83,7 +83,8 @@ void IOFWDMain::boot ()
ZLOG_DEBUG (mainlog_, "Starting IOFWD Frontend");
//frontend_.reset (new frontend::IOFWDFrontend (*resources_));
-
+ iofwdutil::stats::CounterConfig::instance().parseConfig(config_.openSectionDefault ("counters"));
+
frontend_->setConfig (config_.openSectionDefault ("frontend"));
frontend_->init ();
@@ -115,13 +116,39 @@ void IOFWDMain::shutdown ()
iofwdutil::stats::CounterTable::instance().dumpCounters();
}
+class CounterMonitor {
+ int sleeptime;
+public:
+ CounterMonitor(int i = 1) : sleeptime(i) {};
+ void operator()() {
+ while (true) {
+ sleep(sleeptime);
+ iofwdutil::stats::CounterTable::instance().dumpCounters();
+ }
+ }
+};
void IOFWDMain::run ()
{
+ // Start counters dumper
+ ConfigFile config(config_.openSectionDefault("counters"));
+ try
+ {
+ int dumpinterval = config.getKeyAs<int>("dumpinterval");
+ if (dumpinterval > 0) {
+ CounterMonitor cm(dumpinterval);
+ boost::thread counterDumper(cm);
+ }
+ }
+ catch (const iofwdutil::CFKeyMissingException &e)
+ {
+ // It's OK, if dumpinterval is missing, we don't dump counters.
+ }
+
// Wait for ctrl-c
sigset_t set;
sigemptyset (&set);
-
+
if (!notrap_)
sigaddset (&set, SIGINT);
diff --git a/src/iofwd/extraservice/ftb/FTBService.cpp b/src/iofwd/extraservice/ftb/FTBService.cpp
index 470beb8..af9f711 100644
--- a/src/iofwd/extraservice/ftb/FTBService.cpp
+++ b/src/iofwd/extraservice/ftb/FTBService.cpp
@@ -6,7 +6,7 @@
#include "iofwd/Log.hh"
#include "iofwd/BMI.hh"
-#include "common/ftb/ftb.pb.h"
+// #include "common/ftb/ftb.pb.h"
#include <boost/format.hpp>
#include <boost/date_time/posix_time/posix_time_types.hpp>
@@ -81,8 +81,8 @@ namespace iofwd
const google::protobuf::MessageLite & msg)
{
std::string out;
- if (!msg.SerializeToString (&out))
- return;
+ // if (!msg.SerializeToString (&out))
+ // return;
FTB_event_properties prop;
@@ -103,7 +103,7 @@ namespace iofwd
{
boost::system_time nextwakeup = boost::get_system_time ();
- ftb::LoadUpdate load_update;
+ // ftb::LoadUpdate load_update;
// @TODO: get uuid (or more general server identity) in service?
boost::uuids::random_generator gen;
@@ -111,8 +111,8 @@ namespace iofwd
ZLOG_INFO (log_, format("Server UUID: %s") % u);
- load_update.mutable_id()->set_location(bmi_service_->getListenAddress ());
- load_update.mutable_id()->set_uuid (&u, sizeof (u));
+ // load_update.mutable_id()->set_location(bmi_service_->getListenAddress ());
+ //load_update.mutable_id()->set_uuid (&u, sizeof (u));
while (!needShutdown ())
{
@@ -120,9 +120,9 @@ namespace iofwd
ZLOG_DEBUG (log_, "Publishing events...");
- load_update.set_load (0.5);
+ // load_update.set_load (0.5);
- publishPB ("loadupdate", load_update);
+ // publishPB ("loadupdate", load_update);
//checkFTB (FTB_Publish (*ftbhandle_, "loadupdate", 0, &ehandle));
diff --git a/src/iofwd/tasksm/WriteTaskSM.cpp b/src/iofwd/tasksm/WriteTaskSM.cpp
index 77b6f8b..4695a8d 100644
--- a/src/iofwd/tasksm/WriteTaskSM.cpp
+++ b/src/iofwd/tasksm/WriteTaskSM.cpp
@@ -1,5 +1,48 @@
#include "iofwd/tasksm/WriteTaskSM.hh"
#include "zoidfs/zoidfs-proto.h"
+#include "iofwdutil/stats/TimeCounter.hh"
+#include "iofwdutil/stats/IncCounter.hh"
+
+namespace sm {
+ template<>
+ void sm::SimpleSlots<1, iofwd::tasksm::WriteTaskSM>::callback(int pos, const iofwdevent::CBException e) {
+ boost::mutex::scoped_lock l(locks_[pos]);
+
+ Slot & s = slots_[pos];
+
+ ASSERT((s.status_ == WAITING) && "Need to use it as callback"
+ " first!");
+
+ if (s.next_)
+ {
+ // if next was set, we had already executed a 'wait' on this
+ // slot. We can transition right away and the slot becomes free.
+ // We need to any slot exception as the current pending exception.
+
+ next_method_t next = s.next_;
+ s.next_ = 0;
+ s.status_ = FREE;
+
+ // We unlock the mutex so, that if we end up destroying
+ // ourselves,
+ // we don't destroy a locked mutex.
+ l.unlock ();
+ iofwdutil::stats::TimeCounter *tc;
+ tc = iofwdutil::stats::TimeCounter::get("write_sm_waittime");
+ if (tc)
+ client_.wait_time = tc->start();
+
+ client_.resumeSM (next, e);
+ }
+ else
+ {
+ // Didn't do a wait on this slot yet. Store any exception in the
+ // slot and update the status to COMPLETED
+ s.status_ = COMPLETED;
+ s.exception_ = e;
+ }
+ }
+}
namespace iofwd
{
@@ -26,10 +69,28 @@ namespace iofwd
ret_(zoidfs::ZFS_OK),
pipeline_size_(0)
{
+ wait_time = 0;
+ total_wait = 0;
+ iofwdutil::stats::TimeCounter *tc;
+ tc = iofwdutil::stats::TimeCounter::get("write_sm_livetime");
+ if (tc)
+ create_time = tc->start();
+ iofwdutil::stats::IncCounter *ic;
+ ic = iofwdutil::stats::IncCounter::get("write_sm");
+ if (ic) ic->update();
}
WriteTaskSM::~WriteTaskSM()
{
+ iofwdutil::stats::TimeCounter *tc;
+ tc = iofwdutil::stats::TimeCounter::get("write_sm_livetime");
+ if (tc) {
+ double duration = tc->stop() - create_time;
+ tc->update(duration);
+ }
+ tc = iofwdutil::stats::TimeCounter::get("write_sm_waittime");
+ if (tc) tc->update(total_wait);
+
/* cleanup rbuffer_ wrappers */
for(int i = 0 ; i < total_buffers_ ; i++)
{
@@ -45,9 +106,22 @@ namespace iofwd
delete &request_;
}
+ void WriteTaskSM::update_waittime() {
+ iofwdutil::stats::TimeCounter *tc;
+ tc = iofwdutil::stats::TimeCounter::get("write_sm_waittime");
+ if (tc && wait_time) {
+ total_wait += tc->stop() - wait_time;
+ wait_time = 0;
+ }
+ }
+
/* recv the input data to write to the disk */
void WriteTaskSM::recvBuffers()
{
+ iofwdutil::stats::TimeCounter *tc;
+ tc = iofwdutil::stats::TimeCounter::get("write_sm_recvtime");
+ if (tc)
+ recv_time = tc->start();
/* issue the recv buffer */
request_.recvBuffers(slots_[WRITE_SLOT], rbuffer_[0]);
@@ -58,6 +132,11 @@ namespace iofwd
/* execute the write I/O path */
void WriteTaskSM::writeNormal()
{
+ iofwdutil::stats::TimeCounter *tc;
+ tc = iofwdutil::stats::TimeCounter::get("write_sm_fsiotime");
+ if (tc)
+ fsio_time = tc->start();
+
#if SIZEOF_SIZE_T == SIZEOF_INT64_T
api_->write(slots_[WRITE_SLOT], &ret_, p.handle, p.mem_count,
const_cast<const void**>(reinterpret_cast<void**>(p.mem_starts.get())), p.mem_sizes.get(),
diff --git a/src/iofwd/tasksm/WriteTaskSM.hh b/src/iofwd/tasksm/WriteTaskSM.hh
index ac973de..a3c4071 100644
--- a/src/iofwd/tasksm/WriteTaskSM.hh
+++ b/src/iofwd/tasksm/WriteTaskSM.hh
@@ -9,6 +9,7 @@
#include "iofwdutil/InjectPool.hh"
#include "iofwd/WriteRequest.hh"
#include "iofwdutil/InjectPool.hh"
+#include "iofwdutil/stats/TimeCounter.hh"
#include "zoidfs/zoidfs.h"
@@ -95,6 +96,7 @@ class WriteTaskSM : public sm::SimpleSM< WriteTaskSM >, public
void waitAllocateSingleBuffer(iofwdevent::CBException e)
{
e.check ();
+ update_waittime();
// init the task params
request_.initRequestParams(p, rbuffer_[0]->buffer_->getMemory());
@@ -110,8 +112,15 @@ class WriteTaskSM : public sm::SimpleSM< WriteTaskSM >, public
void waitRecvInputBuffers(iofwdevent::CBException e)
{
+ update_waittime();
e.check ();
setNextMethod(&WriteTaskSM::postEnqueueWrite);
+ iofwdutil::stats::TimeCounter *tc;
+ tc = iofwdutil::stats::TimeCounter::get("write_sm_recvtime");
+ if (tc) {
+ double duration = tc->stop() - recv_time;
+ tc->update(duration);
+ }
}
void postEnqueueWrite(iofwdevent::CBException e)
@@ -122,11 +131,20 @@ class WriteTaskSM : public sm::SimpleSM< WriteTaskSM >, public
void waitEnqueueWrite(iofwdevent::CBException e)
{
+ update_waittime();
e.check ();
/* free the buffer */
request_.releaseBuffer(rbuffer_[0]);
setNextMethod(&WriteTaskSM::postReply);
+
+ iofwdutil::stats::TimeCounter *tc;
+ tc = iofwdutil::stats::TimeCounter::get("write_sm_fsiotime");
+ if (tc) {
+ double duration = tc->stop() - fsio_time;
+ tc->update(duration);
+ }
+
}
void postReply(iofwdevent::CBException e)
@@ -137,6 +155,7 @@ class WriteTaskSM : public sm::SimpleSM< WriteTaskSM >, public
void waitReply(iofwdevent::CBException e)
{
+ update_waittime();
e.check ();
// done...
}
@@ -228,6 +247,10 @@ class WriteTaskSM : public sm::SimpleSM< WriteTaskSM >, public
}
}
+ double wait_time;
+ double total_wait;
+ void update_waittime();
+
protected:
/* normal mode operations */
@@ -276,6 +299,10 @@ class WriteTaskSM : public sm::SimpleSM< WriteTaskSM >, public
iofwdevent::CBType s_;
size_t pipeline_size_;
+
+ double create_time;
+ double recv_time;
+ double fsio_time;
};
}
}
diff --git a/src/iofwdevent/BMIResource.cpp b/src/iofwdevent/BMIResource.cpp
index 21fd5b0..578c0a1 100644
--- a/src/iofwdevent/BMIResource.cpp
+++ b/src/iofwdevent/BMIResource.cpp
@@ -340,6 +340,7 @@ namespace iofwdevent
if (delivered)
{
UEClientListType::iterator removeclient = I;
+ I++; // erase() might invalidate the iterator.
ue_clientlist_.erase (removeclient);
*c.outcount = delivered;
@@ -366,10 +367,11 @@ namespace iofwdevent
ue_lock_.lock ();
// We need the lock to protect access to the mem pool
ue_client_pool_.free (&c);
- }
+ } else {
- // Try next client
- ++I;
+ // Try next client
+ ++I;
+ }
}
}
diff --git a/src/iofwdutil/ThreadPool.hh b/src/iofwdutil/ThreadPool.hh
index 5e9bbf1..bdd77e1 100644
--- a/src/iofwdutil/ThreadPool.hh
+++ b/src/iofwdutil/ThreadPool.hh
@@ -15,6 +15,7 @@
#include "iofwdutil/Singleton.hh"
#define CRAY_TP_CORE_MAX 12
+#define USE_CRAY_TP
/*
generic thread pool for the entire app
diff --git a/src/iofwdutil/stats/CounterConfig.hh b/src/iofwdutil/stats/CounterConfig.hh
index f8ab294..df7aed7 100644
--- a/src/iofwdutil/stats/CounterConfig.hh
+++ b/src/iofwdutil/stats/CounterConfig.hh
@@ -87,7 +87,7 @@ class CounterConfig : public iofwdutil::Singleton< CounterConfig >
public:
/* constructors, destructors, and assign ops */
- CounterConfig();
+ CounterConfig(): log_ (iofwdutil::IOFWDLog::getSource ("counters")) {};
CounterConfig(const CounterConfig & rhs);
CounterConfig & operator= (const CounterConfig & rhs);
~CounterConfig();
diff --git a/src/iofwdutil/stats/SingleCounter.hh b/src/iofwdutil/stats/SingleCounter.hh
index 025924f..2488a92 100644
--- a/src/iofwdutil/stats/SingleCounter.hh
+++ b/src/iofwdutil/stats/SingleCounter.hh
@@ -60,6 +60,9 @@ class SingleCounter : public BaseCounter
std::cout << name_
<< " "
<< boost::lexical_cast<std::string>(val_)
+ << " " << counter_min()
+ << " " << counter_mean()
+ << " " << counter_max()
<< std::endl;
}
}
diff --git a/src/sm/SimpleSM.hh b/src/sm/SimpleSM.hh
index 2cd34b4..f48132c 100644
--- a/src/sm/SimpleSM.hh
+++ b/src/sm/SimpleSM.hh
@@ -57,16 +57,16 @@ namespace sm
void resumeSM (next_method_t n, iofwdevent::CBException status =
iofwdevent::CBException ())
{
- {
+ while (true) {
boost::mutex::scoped_lock l(state_lock_);
+ if (running_) continue; // busy wait for other threads to complete.
// assert needs to be inside lock to prevent store/load race.
ALWAYS_ASSERT(!next_);
setNextMethod (n, status);
- }
+ break;
+ }
- if (!running_)
- {
/* if we are in poll mode, execute the next state now ! */
if(poll_)
{
@@ -77,7 +77,6 @@ namespace sm
{
smm_.schedule(this);
}
- }
}
diff --git a/src/zoidfs/client/bmi_comm.c b/src/zoidfs/client/bmi_comm.c
index 7ad136e..1404664 100644
--- a/src/zoidfs/client/bmi_comm.c
+++ b/src/zoidfs/client/bmi_comm.c
@@ -44,7 +44,8 @@ int bmi_comm_send(BMI_addr_t peer_addr, const void *buffer, bmi_size_t buflen,
return bmi2zfs(ret);
} else if (ret == 0) {
do {
- ret = BMI_testcontext(1, &op_id, &outcount, &error_code, &actual_size, NULL, MAX_IDLE_TIME, context);
+ ret = BMI_test(op_id, &outcount, &error_code, &actual_size, NULL,
+ MAX_IDLE_TIME, context);
} while (ret == 0 && outcount == 0);
if (ret < 0 || error_code != 0) {
@@ -93,7 +94,7 @@ int bmi_comm_isend_wait(bmi_op_id_t op_id, bmi_size_t buflen, bmi_context_id con
bmi_error_code_t error_code;
do {
- ret = BMI_testcontext(1, &op_id, &outcount, &error_code, &actual_size, NULL, MAX_IDLE_TIME, context);
+ ret = BMI_test(op_id, &outcount, &error_code, &actual_size, NULL, MAX_IDLE_TIME, context);
} while (ret == 0 && outcount == 0);
if (ret < 0 || error_code != 0)
@@ -129,7 +130,8 @@ int bmi_comm_recv(BMI_addr_t peer_addr, void *buffer, bmi_size_t buflen,
return bmi2zfs(ret);
} else if (ret == 0) {
do {
- ret = BMI_testcontext(1, &op_id, &outcount, &error_code, actual_size, NULL, MAX_IDLE_TIME, context);
+ ret = BMI_test(op_id, &outcount, &error_code, actual_size, NULL,
+ MAX_IDLE_TIME, context);
} while (ret == 0 && outcount == 0);
if (ret < 0 || error_code != 0) {
@@ -153,7 +155,7 @@ int bmi_comm_irecv_wait(bmi_op_id_t op_id, bmi_size_t * actual_size, bmi_context
bmi_error_code_t error_code;
do {
- ret = BMI_testcontext(1, &op_id, &outcount, &error_code, actual_size, NULL, MAX_IDLE_TIME, context);
+ ret = BMI_test(op_id, &outcount, &error_code, actual_size, NULL, MAX_IDLE_TIME, context);
} while (ret == 0 && outcount == 0);
if (ret < 0 || error_code != 0)
@@ -202,7 +204,8 @@ int bmi_comm_sendu(BMI_addr_t peer_addr, const void *buffer, bmi_size_t buflen,
return bmi2zfs(ret);
} else if (ret == 0) {
do {
- ret = BMI_testcontext(1, &op_id, &outcount, &error_code, &actual_size, NULL, MAX_IDLE_TIME, context);
+ ret = BMI_test(op_id, &outcount, &error_code, &actual_size, NULL,
+ MAX_IDLE_TIME, context);
} while (ret == 0 && outcount == 0);
if (ret < 0 || error_code != 0) {
@@ -246,7 +249,8 @@ int bmi_comm_isendu_wait(bmi_size_t buflen, bmi_context_id context, bmi_op_id_t
bmi_error_code_t error_code;
do {
- ret = BMI_testcontext(1, &op_id, &outcount, &error_code, &actual_size, NULL, MAX_IDLE_TIME, context);
+ ret = BMI_test(op_id, &outcount, &error_code, &actual_size, NULL,
+ MAX_IDLE_TIME, context);
} while (ret == 0 && outcount == 0);
if (ret < 0 || error_code != 0) {
@@ -324,7 +328,8 @@ int bmi_comm_send_list(BMI_addr_t peer_addr, size_t list_count,
return bmi2zfs(ret);
} else if (ret == 0) {
do {
- ret = BMI_testcontext(1, &op_id, &outcount, &error_code, &actual_size, NULL, MAX_IDLE_TIME, context);
+ ret = BMI_test(op_id, &outcount, &error_code, &actual_size, NULL,
+ MAX_IDLE_TIME, context);
} while (ret == 0 && outcount == 0);
if (ret < 0 || error_code != 0) {
@@ -370,7 +375,8 @@ int bmi_comm_isend_list_wait(bmi_op_id_t op_id, bmi_context_id context, bmi_size
do
{
- ret = BMI_testcontext(1, &op_id, &outcount, &error_code, &actual_size, NULL, MAX_IDLE_TIME, context);
+ ret = BMI_test(op_id, &outcount, &error_code, &actual_size, NULL,
+ MAX_IDLE_TIME, context);
}while (ret == 0 && outcount == 0);
if (ret < 0 || error_code != 0) {
@@ -409,7 +415,8 @@ int bmi_comm_recv_list(BMI_addr_t peer_addr, size_t list_count,
return bmi2zfs(ret);
} else if (ret == 0) {
do {
- ret = BMI_testcontext(1, &op_id, &outcount, &error_code, &actual_size, NULL, MAX_IDLE_TIME, context);
+ ret = BMI_test(op_id, &outcount, &error_code, &actual_size, NULL,
+ MAX_IDLE_TIME, context);
} while (ret == 0 && outcount == 0);
if (ret < 0 || error_code != 0) {
@@ -450,7 +457,8 @@ int bmi_comm_irecv_list_wait(bmi_op_id_t op_id, bmi_context_id context, bmi_size
do
{
- ret = BMI_testcontext(1, &op_id, &outcount, &error_code, actual_size, NULL, MAX_IDLE_TIME, context);
+ ret = BMI_test(op_id, &outcount, &error_code, actual_size, NULL,
+ MAX_IDLE_TIME, context);
}while (ret == 0 && outcount == 0);
if (ret < 0 || error_code != 0) {
diff --git a/src/zoidfs/dispatcher/posix/zoidfs-posix.c b/src/zoidfs/dispatcher/posix/zoidfs-posix.c
index 00005ab..8ef6593 100644
--- a/src/zoidfs/dispatcher/posix/zoidfs-posix.c
+++ b/src/zoidfs/dispatcher/posix/zoidfs-posix.c
@@ -921,10 +921,20 @@ static int zoidfs_posix_remove(const zoidfs_handle_t *parent_handle,
char tmpbuf[ZOIDFS_PATH_MAX];
const char * path = zoidfs_simplify_path (parent_handle, component_name,
full_path, tmpbuf);
+ struct stat s;
if (!path)
return ZFSERR_STALE;
+ // release open fd from cache.
+ if (lstat (path, &s) < 0)
+ return errno2zfs (errno);
+ if (S_ISREG(s.st_mode)) {
+ zoidfs_handle_t handle;
+ filename2handle (&s, path, &handle);
+ dcache_removefd(dcache, &handle);
+ }
+
// ignore component_name
if (unlink (path)< 0)
{
diff --git a/test/Makefile.subdir b/test/Makefile.subdir
index 328e8d0..c0ca10c 100644
--- a/test/Makefile.subdir
+++ b/test/Makefile.subdir
@@ -4,7 +4,6 @@ if BUILD_IOFWD_CLIENT
#
# unit tests build rules
#
-if HAVE_CUNIT
test_unit_tests_ldadd = \
@BOOST_PROGRAM_OPTIONS_LIB@ \
@@ -22,6 +21,7 @@ test_unit_tests_ldflags = \
@ZFS_DISPATCHER_LDFLAGS@ \
@BMI_LDFLAGS@
+if HAVE_CUNIT
noinst_PROGRAMS += test/xdrspeed
test_xdrspeed_SOURCES = test/xdr/xdrspeed.cpp
test_xdrspeed_LDADD = $(top_builddir)/lib/libiofslcommon.a $(top_builddir)/lib/libiofsloldclient.a $(test_unit_tests_ldadd)
@@ -119,7 +119,11 @@ test_servercomm_SOURCES = test/servercomm.cpp
test_servercomm_LDFLAGS = ${cppldflags}
test_servercomm_LDADD = ${cppldadd}
+noinst_PROGRAMS += test/zoidfsfuse
+test_zoidfsfuse_SOURCES = test/zoidfs-fuse.c
+test_zoidfsfuse_LDADD = $(top_builddir)/lib/libiofsloldclient.a ${test_unit_tests_ldadd} @FUSE_LIBS@
+test_zoidfsfuse_LDFLAGS = ${test_unit_tests_ldflags} @FUSE_LDFLAGS@
noinst_PROGRAMS += test/net
test_net_SOURCES = test/net.cpp test/TrackLive.cpp test/TrackLive.hh \
diff --git a/src/fuse/zoidfs-fuse.c b/test/zoidfs-fuse.c
similarity index 100%
copy from src/fuse/zoidfs-fuse.c
copy to test/zoidfs-fuse.c
hooks/post-receive
--
More information about the Iofsl-commits
mailing list