actually enable atomics for the darwin kernel, whose API is
just slightly different
Change-Id: I566149428d253806c4546fa0c5a3f96e8098c4eb
Reviewed-on: http://gerrit.openafs.org/2884
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
rx_Readv() is a bit "faster" than rx_Read() and typically used by most
afs transaction.
server% rxperf server
client% rxperf client -c send -s server
SEND: threads 1, times 100, bytes 1048576: 2073 msec
server% rxperf server -v
client% rxperf client -c send -s server
SEND: threads 1, times 100, bytes 1048576: 983 msec
Change-Id: I27b06dbbb61f2bc34fa91bcda3c6e046c787ff62
Reviewed-on: http://gerrit.openafs.org/2877
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
RXAFS_GetVolumeStatus can return VNOVOL, VMOVED, etc. In order to
process them and update volume state a fid must be passed to cm_Analyze().
Use the volume root fid.
LICENSE MIT
Change-Id: Ia6115a17aae06144277271048e8287e5ad52ff2a
Reviewed-on: http://gerrit.openafs.org/2883
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Add some routines to maintain a pool of threads, for working through a
Vwork_queue.
This adds the afs_tp* series of functions. Originally written by
Tom Keiser.
Change-Id: I8735aa14ca6622ae0eca7a7589e69b0f3b3daf08
Reviewed-on: http://gerrit.openafs.org/1863
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Add some routines for specifying chunks of work to be done. The idea
is to be able to pass these to different threads, and specify
dependencies between them, wait on them completing, etc.
This adds the afs_wq* family of functions. Originally written by Tom
Keiser.
Change-Id: If556cf4da12de8c4be1e53376d85d791584ae177
Reviewed-on: http://gerrit.openafs.org/1862
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
if we set lastReceiveTime to 0 to hint that no net, honor that here as
"just time out"
Change-Id: Ifb06fad782669649027841e3930ff94600b6c900
Reviewed-on: http://gerrit.openafs.org/2875
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Only report detailed per-chain volume statistics on shutdown/SIGXCPU
if LogLevel is 125 (or 25 for smaller per-chain stats). If a
fileserver is configured with a large -vhashsize, printing out stats
for each chain can take awhile and use up a nontrivial amount of disk
space for logging, so only print out these stats if we're asked for
them.
Change-Id: Iceb38e29ab40958e05f3cf146687f679bd0f061c
Reviewed-on: http://gerrit.openafs.org/2759
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
sendtimes and recvtimes are actually the data byte counts to be
exchanged during an rpc test not an iteration count as implied
by their names
Change-Id: I3d567aacf1ab1d25fda20e48a6bbb68a63330230
Reviewed-on: http://gerrit.openafs.org/2876
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
the test for this build feature is reversed. by default, the value for
with_linux_kernel_packaging will not be defined which makes the existing
test pick MPS='SP' instead of LINUX_WHICH_MODULES. based on the configure
help messages, this would appear to be an opt-in not an opt-out.
...
Optional Packages:
...
--with-linux-kernel-packaging
use standard naming conventions to aid Linux kernel
build packaging (disables MPS, sets the kernel
module name to openafs.ko, and installs kernel
modules into the standard Linux location)
...
Change-Id: Ie16fba165e6c85b7ecbce887badb9ffc06a3a7a8
Reviewed-on: http://gerrit.openafs.org/2869
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
You can only specify a -vhashsize between 6 and 28 (inclusive).
Document that in the dafileserver man page.
Change-Id: I44d1c71f4ff303174e8aebf74b0b9075c07bc8b4
Reviewed-on: http://gerrit.openafs.org/2650
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
ucontext requires glibc version info to engage.
glibc info comes from features.h, which if we include afs_sysnames.h,
we get... so, let's swap these.
Change-Id: I26e5554f2c5c5f9f8a74fb591efdfdc1f6ae7257
Reviewed-on: http://gerrit.openafs.org/2868
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
rxi_FreeCall changes its number of arguments depending on whether
locks are enabled or not. That's a little bit nasty to read, so just
change it so that it always takes two arguments, and ignores the
second when it doesn't need it.
Change-Id: I5f869bea9bcf01bac16d8c5eec93373788d17978
Reviewed-on: http://gerrit.openafs.org/2863
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Make the rx_statistics statistics gathering infrastructure use
atomics for all of its counters. This significantly reduces
lock contention. However, it also (potentially) changes the format
of the rx_stats variable which has been used by callers in the past.
To simplify this process, and to aid with future changes, we remove
direct access to rx_stats. Instead, two additional API functions
rx_GetStatistics and rx_FreeStatistics are provided. These give the
caller access to an 'normal' rx_statistics structure.
Tom Keiser has suggested that we should explore using thread-local
statistics structures, and just aggregating them when we are asked
to report. This is a fine idea, and is equally possible with the
new interface that this patch introduces.
Change-Id: I859cea8f7354a655be007b95fa8a61f995308b35
Reviewed-on: http://gerrit.openafs.org/2862
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Make the nWaiting and nWaited counters atomic, and get rid of the
mutex which used to protect them.
Change-Id: I0c4d8f1df1860baa2bb189ea77bf20ee9f2066f7
Reviewed-on: http://gerrit.openafs.org/2860
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
The fileserver and the fsync server were locking an internal RX
mutex, and incrementing an internal counter in order to obtain fake
pthread thread IDs. Instead of letting them muck around in the
internals of RX, provide an API that can be called to obtain a
ThreadId counter, and use that API throughout the code.
Change-Id: I68f41d1486cdafeb757da2c0df899ae1ca2b2bfc
Reviewed-on: http://gerrit.openafs.org/2859
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Add support for an atomic type, and atomic operators for RX. This
builds on work which has already been done for Windows, where
InterlockedOperations are used for statistics gathering.
A new opaque type, rx_atomic_t is introduced so that normal arithmetic
operations will fail on atomic data.
An implementation using native atomic methods is provided for Darwin,
Solaris and Windows. A native kernel implementation is used for Linux.
Where OpenAFS is built with a sufficiently modern gcc, gcc's atomic
primitives will be used. Sadly, gcc's builtin operations are not
available for i386, they will only be used with builds the set
-march=i486 (or later).
Otherwise, we fall back to a single mutex which protects all atomic
operations.
Change-Id: I5f69677a80617e3936f82b177cd58250a6dbf31f
Reviewed-on: http://gerrit.openafs.org/2858
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Data which is accessed only by the reader thread doesn't need to be
protected by call->lock
Remove the call->lock protection where it isn't required, which makes
certain read/write calls lock free.
Stop rx_ResetCall from manipulating reader thread data. This data will
be zero'd and cleared when the reader thread calls rx_EndCall, and
doesn't need to be reset by the Listener thread.
The change which made rx_ResetCall reset reader thread information
was originally part of 559ea99b. It caused race conditions that were
fixed by adding additional lock protection in d0cc6e, 4dadd2 and
423ab97e. This commit reverts portions of all of those changes. It
is safe to not clear the iovc in ResetCall because any NewCall must
be balanced by a corresponding EndCall in the reader thread, and
EndCall does the appropriate freeing of reader elements.
Change-Id: I450469a4591fbe4af34482a2b219708795c57e8e
Reviewed-on: http://gerrit.openafs.org/2856
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
We're now properly registered in syscalls.master for HEAD
(i.e. proto-9.0) and RELENG_8 (proto-8.2), which means that
afs3_syscall is prototyped in sys/sysproto.h . Accordingly,
don't declare it in afs_prototypes.h for those cases.
Also add FBSD82_ENV checks for the new syscall-registration code,
and cast afs3_syscall to sy_call_t* for the sysent structure.
Change-Id: I0e7427274b018043c3a6a8ca6181a78a385d9aa2
Reviewed-on: http://gerrit.openafs.org/2864
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The RX ack packet can only acknowledge 255 packets at once. In the
current implementation, this limits our maximum window size to 255,
as we can't acknowledge any packets we receive outside of that window
size.
Change-Id: If12eeb4a71cdf0bcd2a82f86b416e387543b7ea8
Reviewed-on: http://gerrit.openafs.org/2857
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Fix instances of variables defined and set but never used in the
volser directory.
Spotted by gcc 4.6
Change-Id: Ibb1896cdde51985d1c14b563f8a6de6cec90403f
Reviewed-on: http://gerrit.openafs.org/2852
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
change things so we conform with the usual prototype for main()
Change-Id: Ia3bfe6bb1b135fdba53ccca1650b0b7223108a27
Reviewed-on: http://gerrit.openafs.org/2850
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Remove or ifdef out some variables that are set but never used.
Spotted by gcc 4.6
Change-Id: I895740680997cff29d96ee5257830531c71711af
Reviewed-on: http://gerrit.openafs.org/2853
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Rework the install targets for udebug to avoid warnings in the case
where afssrvbindir = bindir
Remove commented out compile line for udebug
Change-Id: I500ba2575e7d71114dbdec704d6b3d22585cfdd3
Reviewed-on: http://gerrit.openafs.org/2851
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
On Unix, the UDP buffer size has to be set before we open any sockets.
Otherwise, the default (64k) buffer size is used and never changed.
Move the calls to SetUdpBufSize in rxperf.c so that the -u command
line option actually has an effect.
Change-Id: Ic925faabca8264c0359693e97c2ab5b637902797
Reviewed-on: http://gerrit.openafs.org/2855
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Contains DKMS robustness fixes, improvements to the defaults for the
module build, and cleanup of the openafs-client init script. Updates
the build system for the new demand-attach binary naming and for the
changes to supported configure options. Fixes some issues with
afs-newcell. Forces disabling of the Linux syscall probing in kernel
module builds, since no supported Debian kernel allows this and it
causes problems. Update debhelper to V8, which allows simplification
of debian/rules and debian/module/rules.
Change-Id: I4db4df873607129548557389f08c7ec1480e7204
Reviewed-on: http://gerrit.openafs.org/2849
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Fetches and stores are already defined as unsigned, so format
them as unsigned values when displaying in scout. This fixes
the bug where scout shows those counts as negative values on
busy servers which have been running for a while.
Change-Id: I460172720d76e081ede4381b2718f75386af4285
Reviewed-on: http://gerrit.openafs.org/2843
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
The commit which took our Window size to 128 caused rxperf to run
40 times slower than before. All of the recent rx improvements have
reduced this to being around 2x slower than before, but we're still
not ready for large window sizes.
As 1.6 is nearing release, reset back to the old, fast, window size
of 32. We can revist this as further performance improvements and
restructuring happen on master.
Change-Id: Ic1de2cf33f42edaf1455b72580110d56fe968a7b
Reviewed-on: http://gerrit.openafs.org/2844
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
... in the same way as shlibafsrpc
Change-Id: I02d8c35efadd9c9b865bb91eabd0e5b3c10a115e
Reviewed-on: http://gerrit.openafs.org/2842
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
LKM currently builds and will mount when forced with the entry point
manually defined. Contents of /afs can be discovered, but when listing
the directory, the system call will not return.
Change-Id: I68ba1897b56613bd4ebbe331eea3140c6a963a7d
Reviewed-on: http://gerrit.openafs.org/2767
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The pthreaded version of rxperf is much more interesting than the
LWP one now, so add some rules so that Unix can play with it too.
Change-Id: Ia76dd89482c8d62805ed8dfd58a1963e4bf8cc65
Reviewed-on: http://gerrit.openafs.org/2841
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
hcrypto uses a single pthread mutex, which is only required when
we're running in a pthreaded world (in a cooperative threading world
such as LWP, there's no way that two processes can both access the
Fortuna PRNG at the same time)
So, build an LWP version of hcrypto which just disables the mutexes.
Change-Id: I0b894cfa0d16ba6d16544a4d725191c965ac6e50
Reviewed-on: http://gerrit.openafs.org/2833
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The structures defined in des/stats.h are rxkad specific, and so
should be handled by an rxkad header file, rather than by something
in the eventually-to-be-removed DES directory.
The structure shouldn't be initialised in libutil. Move initialisation
to rxkad_common, where it is already initialised in the pthread case.
Change-Id: I3de49cfe1752eaa5f273796516e2ff6c289d9533
Reviewed-on: http://gerrit.openafs.org/2576
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Fix the tests so that they work when we have a separate build
directory.
Change-Id: I1329a4186b126c84f611c9751fd228b80c80c82c
Reviewed-on: http://gerrit.openafs.org/2828
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Add the rx_identity structure which can be used by rx security
layers to store and return identity information to applications.
A number of helper functions for manipulating rx_identity structures
are also provided.
Change-Id: I64ae2b62a4bc8a401c1ac877f4662c66a39247f8
Reviewed-on: http://gerrit.openafs.org/2827
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Add a type to RX to hold counted data chunks, and some helper
functions to assist callers with using that type.
Change-Id: Ia81ceea50e43f6fba101122a085f84776dbf3807
Reviewed-on: http://gerrit.openafs.org/2826
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The two commands are documented identically for right now, so just link
the dafssync-debug man page to the fssync-debug man page. Remove the
incorrect statement in the man page that fssync-debug only works with
demand-attach.
FIXES 128166
Change-Id: I812641ad7a345c7f5412c3c97ed1ba393e981639
Reviewed-on: http://gerrit.openafs.org/2836
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The demand-attach fileserver binaries now have a "da" prefix. Adjust
the documentation in the man page for bos create accordingly, and add
the new binaries to SEE ALSO.
Change-Id: Ib70bad87aaf8bfc483ffbfe402db01c178e6c4e4
Reviewed-on: http://gerrit.openafs.org/2830
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Document ktc_ListTokensEx, and add a stub implementation of the
function for Windows.
Change-Id: Ie168081f1a991fcf13358a5a1eeb8d0b96f5800a
Reviewed-on: http://gerrit.openafs.org/2825
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Add an implementation of dirfd to our local roken implementation for
platforms that don't have one.
Code taken from Heimdal.
Change-Id: I4284c18430b6f49200886f5340191a14dcf34b57
Reviewed-on: http://gerrit.openafs.org/2608
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Add the ability to initiate multiple pthread threads issuing
calls on the same connection to the server.
Add ability to set max window size.
Add ability to adjust min peer timeout.
Change-Id: I896650b033ae0adfa42d3e5831ff799ca1331bd5
Reviewed-on: http://gerrit.openafs.org/2835
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
libuafs used to #define user to usr_user, so that any references to
'struct user' would become 'struct usr_user'. However, none of the
kernel code uses struct user, and this #define conflicts with the
definitions in sys/user.h on Linux.
So, just remove it.
Thanks to Russ Allbery for the original problem report.
Change-Id: I7868c8ddade2df626f5ecae597144641dfc551b7
Reviewed-on: http://gerrit.openafs.org/2838
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Fix assorted errors in the rxperf utility so that it will build
on Unix.
Change-Id: I8ba4e5e6bc2bab38b38f27f5fae3138a0924caa6
Reviewed-on: http://gerrit.openafs.org/2834
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>