another location where EHOSTUNREACH can be returned
such that we can timeout the request immediately
(cherry picked from commit f7b9cd54e50e553486c2ad850df1a8ecaee0d954)
when collecting rx statistics in response to an RPC query, the rx library
attempts to enumerate the number file descriptors in use. This is fine
except that file descriptors are a C Run Time Library concept on Windows
and are not related to networking. In Visual Studio 8, the run time library
will assert() if an invalid file descriptor is passed to fstat() which is
the test used to determine if a file descriptor is valid.
This patch simply returns 0 for the number of file descriptors in use
because that is what would have been returned anyway with the existing
code. What we probably want to return is the number of open socket
handles.
(cherry picked from commit 8c3cf4b89445d969c9f85e929d5e030f53773f81)
FIXES 24267
must provide prototype for osi_Alloc() on systems with 64-bit pointers
and 32-bit int
(cherry picked from commit d00359b24139753b8f6a62c6a9137c8f8ccd3b7e)
FIXES 24267
include rx.h in order to safely include rx_prototypes.h in order
to obtain a prototype for osi_Alloc() in order to prevent pointer
truncation on systems with 64-bit pointers and 32-bit int.
(cherry picked from commit f75b0075a79807eaae4e071ea4d0f3bd60d7f547)
FIXES 23143
at least i'm guessing it fixes that one
fix memory leak for multilevel packet queue stuff
(cherry picked from commit 421e063d9b6500299b5e02b999b22c01dcc7c496)
* add a version of rxi_DebugPrint for Windows that uses OutputDebugString
* migrate all printf statements to the dpf macro
* stop masking the errors from rx_sendmsg() so that higher level functions
can make decisions based upon the failure.
* Windows reports EHOSTUNREACHABLE. Similar to Linux, if it is reported
reset the send packet start time to 0 in order to immediately cause the
server to be marked down.
(cherry picked from commit 9ac9185b0feb87eff820963f83a6c861c49bdab5)
heavily reworked by jaltman@secure-endpoints.com
and then a little further editing by me
see if we can avoid doing to sleep forever waiting on the tq to flush
====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================
do not decrement tqWaiters in the while evaluation. This will
result in an invalid count if the value was zero to begin with.
(cherry picked from commit b08017e91f5b4d175b5c9b1f6d68adb9effa3360)
FIXES 19027
After profiling RX for a while, I've found a few more bottlenecks in the
packet handling code. This patch addresses a couple of these issues.
The major change in this patch is a new API to allow bulk packet
alloc/free ops on rx_queue's of packets. Benefits include reduced lock
contention on rx_freePktQ_lock, elimination of a lot of unnecessary cache
line invalidates, and reduced register window thrashing on sparc.
In addition, this patch dedicates one rx_packet per thread to rxi_SendAck,
since that function is in the critical path, and represents a large
percentage of execution time.
(cherry picked from commit d049ca2ae4e7708df028fca739c2a35ccb906bfb)
On at least one system it was noticed that threads waiting in rx_NewCall
would starve forever (aka deadlock). This was the result of one out of
two problems related to a race condition on the RX_CONN_MAKECALL_WAITING
bit flag. This flag was set once in rx_NewCall and cleared in rx_EndCall.
However, it was possible for the flag to be cleared even though there
were additional flags waiting in rx_NewCall. This was due to a failure
to check the value of makeCallWaiters before clearing the flag and also
due to a failure to properly lock the access to the makeCallWaiters field.
The second problem was an ability to destroy a connection on which threads
are waiting within rx_NewCall.
(cherry picked from commit 10f6e5d6e2960469eb4d0e75f62fa9b33629b132)
FIXES 17805
here's a patch that reduces the overhead of transfers
between the local and global free packet queues. The old algorithm was
O(n) in the number of store instructions -- 7 per rx_packet. I've added
some bulk transfer macros to the rx_queue package. Now, the number of
store instructions is O(1) -- 6 total. This should help reduce bus
contention and cache line invalidates on SMPs.
(cherry picked from commit 35285dad3e20e50f592afa95d994b68ded5c8b2b)
FIXES 17805
I've been stress testing a patch all weekend that changes the way
thread-local packet quotas are computed. I was able to replicate the
unbounded packet alloc problem on unix server components by eliminating my
code from rxi_StartServerProcs that sets the maximum number of expected
threads. This patch makes the upper thread limit get computed on the fly,
adds some thread-local free packet queue statistics, and a few other minor
tweaks. I still don't have a working windows development environment, so
I can't say whether this will fix all the windows client problems. But,
the unbounded packet allocation problem should go away with this patch.
stress testing on windows succeeds as well. <jaltman@secure-endpoints.com>
(cherry picked from commit 1099227e08af3df856d8a998746d98405e3ef04b)
FIXES 17805
Add a new function called rx_StartClientThread() which parallels the
behavior of rx_StartServer but is used for initializing client threads.
====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================
FIXES 17805
Add a new function called rx_StartClientThread() which parallels the
behavior of rx_StartServer but is used for initializing client threads.
Disable use of RX_TSFPQ_ENABLE on Windows as it slows the client down.
(cherry picked from commit c630f81194666e438d93b79fc2510d112050e524)
FIXES 18079
more complete version of what's in the patch, kill all refs to struct osi_socket in favor of just osi_socket
from psomogyi@gamax.hu
(cherry picked from commit 2dc87bcf1e632444b163eea94172b77e7d376d5c)
FIXES 17805
this time we'll work it out on windows. multitier free packet queues to increase performance
(cherry picked from commit 004be0249387802cc7abe45d50c6f8b67c4832d0)
FIXES 17805
The attached patch turns the rx free packet queue into a 2-tiered cache
with a local thread-specific queue, backed by a global queue when using
pthreaded rx. The patch is against 1.3.79. Preliminary benchmarks show
scalability much closer to 2 cpus on sparc with this patch. Also,
fileserver performance under heavy load is improved: 50% improvement in
throughput for sequential writes, and a 10% improvement in performance for
random writes against an smp sparc solaris 10 fileserver.
(cherry picked from commit 5c6b956257f4f43122d393eaf119ad7616084576)
* Removed memory allocation functions only used on AIX and ancient
HPUX. If the performance penalty is noticeable, implement a wrapper
at the osi-level in the same manner as LINUX/FBSD (ie not sprayed
throughout the code).
* Removed all remnants of splnet()-style locking, it was not
sufficient for MP anyway which the real locks are. Affects only AIX
and HPUX.
* Drop the global locking in rxi_Alloc since the real locks do their
jobs, affects only AIX41 and up (ie. MP capable OS).
* Fix the non-kernel wrapper for osi_Alloc/Free on AIX to take void *
in the same manner as the rest of the functions. IMO this wrapper
shouldn't be necessary since you should never ever malloc() 0 bytes,
but since it's there I'd guess someone made stupid assumptions
somewhere...
* Restores MAXKTCTICKETLEN to 12000 on AIX
* Restores AFS_LWP_MINSTACKSIZE to 48k on AIX (might affect
server-stuff)
(cherry picked from commit 412854593cf368006c18e6c0dc607a9ecd76a0e0)
Code ifdef'd any of AFS_MACH_ENV, AFS_GFS_ENV, AFS_DEC_ENV dies
Code ifdef'd AFS_SUN_ENV either becomes AFS_SUN5_ENV or dies as appropriate,
in the kernel only. The database servers etc are probably still buildable,
and I still have a SunOS 4.1.4 machine. ;-) But the Solaris vnops get all
SunOS 4 code nuked.
Uses of AFS_ALPHA_ENV which secretly meant OSF/1,D/UX,Tru64 become
AFS_OSF_ENV.
Bozon lock use gets its own ifdef. OSF and Solaris define it. Darwin and any
BSDs have bozon lock usage removed: note that only OSF and Solaris were
bothering to *init* the bozon lock during NewVCache. Bozon locks are for
platforms where basically we could end up deadlocking ourselves because of
how locks are handled.
Some nonsensical ifdefs removed.
Some if 0'd code removed.
Some obsolete code (hpux pre-10, for instance) removed.
(cherry picked from commit 706530c295dcf528d7307a524020457a0a6d5f59)