[PATCH] PATCH 12/16: NFSD: TCP: Close idle TCP connections
authorNeil Brown <neilb@cse.unsw.edu.au>
Tue, 26 Feb 2002 06:23:44 +0000 (22:23 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Tue, 26 Feb 2002 06:23:44 +0000 (22:23 -0800)
commitcbf593fcd65839fb89ff55a6696896b7841d77cb
tree53ceadd85030681ef114519da962f4356d0b48da
parent84e9f22a623a88f653aa6f078925e410f3665474
[PATCH] PATCH 12/16: NFSD: TCP: Close idle TCP connections

Close idle rpc/tcp sockets

We split the list of sv_allsocks into two, one
of permanent sockets (udp, tcp listener) and one
of temporary sockets (tcp data).

Whenever we complete a successful receive on a temp socket,
it gets pushed to the end of the list.

Whenever a thread wants to do something, it first checks if
the oldest temp socket has not has a receive for 6 mintutes
(should possibly be configurable).  It so, we simulate
a close.

Finally we make sure that threads wake up every few minutes
so that if the server is completely idle, all temp
sockets will get closed.
fs/nfsd/nfssvc.c
include/linux/sunrpc/svc.h
include/linux/sunrpc/svcsock.h
net/sunrpc/svc.c
net/sunrpc/svcsock.c