cvs commit: src/sys/nfsclient nfs.h nfs_socket.c

Mohan Srinivasan mohan_srinivasan at yahoo.com
Mon Nov 20 16:17:58 UTC 2006


--- Bruce Evans <bde at zeta.org.au> wrote:

> >  2) Reduce the acquisitions of the Giant lock in the nfs_socket.c paths significantly.
> >  - We don't need to acquire Giant before tsleeping on lbolt anymore,
> >    since jhb specialcased lbolt handling in msleep.
> >  - nfs_up() needs to acquire Giant only if printing the "server up"
> >    message.
> 
> Giant isn't required here either.  tprintf() does its own locking as
> required.  This locking happens to be Giant locking, and callers
> unfortunately have to be aware of this to avoid LORs.  It may be
> necessary to acquire at a higher level, but fortunately, most calls
> to tprintf() are already at a high level, and since you've managed
> to push down the calls here, the calls are apparently already at
> a high level.

Thanks. I'll fix this.
 
> Giant was never required for plain printf().  nfs_printf() was never
> needed since it only wraps plain printf() with Giant locking.
> 
> >  - nfs_timer() held Giant for the duration of the NFS timer processing,
> >    just because the printing of the message in nfs_down() needed it
> >    (and we acquire other locks in nfs_timer()). The acquisition of
> >    Giant is moved down into nfs_down() now, reducing the time Giant is
> >    held in that path.
> 
> Like nfs_up().

Yes. I had to re-work some of the locking in nfs_timer() to push Giant 
into nfs_down(), to make the call to tprintf() a "higher level" call in that path.

mohan


More information about the cvs-src mailing list