Question about svc_age_temp_sockets
Subsystems (2)
I'm confused about how svc_age_temp_sockets is supposed to work. From my reading, the timer fires every 6 minutes and calls the svc_age_temp_sockets function. This function sweeps the tempsocks list and unconditionally test_and_sets every transport SK_OLD. If it was the first to set it, it will test if the transport's not busy and then shut it down. So here's what I don't get:
- A transport that was added 5 minutes into the timer period, could get shut down after only a minute of idleness
- A transport that was busy may _never_ get shutdown because it will already have it's SK_OLD bit set when it comes back through 6 minutes later. If no more requests ever arrive from the client, the SK_OLD bit will never get reset and the test_and_set check skips the transport if the bit's already set.
- There's a check for a zero sk_inuse count. I don't see a legitimate way for a socket to be on the tempsocks list with a zero refcount.
Am I just hopelessly confused here or is this code broken?
Tom
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
Quoted 6 lines · Tom Tucker
I'm confused about how
svc_age_temp_socketsis supposed to work. [...]
- There's a check for a zerosk_inusecount. I don't see a legitimate way for a socket to be on the tempsocks list with a zero refcount.Am I just hopelessly confused here or is this code broken?
When the code was written, the natural idle state of a svcsock was sk_inuse == 0. Later, in commit
Neil changed this so the natural idle state is sk_inuse == 1 and the sk_inuse == 0 condition only happens transiently during socket shutdown. This is a far better design, but it seems the check in svc_age_temp_sockets() wasn't updated at the time and is now dead code. It could probably be removed.
Greg.
Signature · 11 lines
Greg Banks, R&D Software Engineer, SGI Australian Software Group. Apparently, I'm Bedevere. Which MPHG character are you? I don't speak for SGI. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ NFS maillist - [email protected] https://lists.sourceforge.net/lists/listinfo/nfs