Skip to contentSkip to conversation

Question about svc_age_temp_sockets

DISCUSSION Tom Tucker 2 participants 2 messages Sep 9, 2007 – Sep 14, 2007

Subsystems (2)
lore
Share & tools
lore

Tom Tucker

author
#0 lore raw

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

#1 lore raw
Quoted 6 lines · Tom Tucker

I'm confused about how svc_age_temp_sockets is supposed to work. [...]
- 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?

When the code was written, the natural idle state of a svcsock was sk_inuse == 0. Later, in commit

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=aaf68cfbf2241d24d46583423f6bff5c47e088b3

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