• Trond Myklebust's avatar
    [PATCH] RPC client receive deadlock removal on HIGHMEM systems · 68c45a68
    Trond Myklebust authored
    Remove another class of rpciod deadlocks on HIGHMEM systems. Kick habit of
    keeping pages kmap()ed for the entire duration of NFS
    read/readdir/readlink operations.
    
    Use struct page directly in RPC client data receive buffer. TCP and UDP
    sk->data_ready() bottom-halves copy (and checksum when needed) data into
    pages rather than iovecs. atomic_kmap() of single pages is used for the
    copy.
    
    include/linux/xdr.h
       Declare structure for copying an sk_buff here rather than in xprt.c.
       Forward declaration of new functions.
    
    include/linux/sunrpc/xprt.h
       RPC client receive buffer changed to use new format 'struct xdr_buf'.
    
    net/sunrpc/clnt.c
       Initialize new format receive buffer.
    
    net/sunrpc/sunrpc_syms.c
       Export xdr_inline_pages(), xdr_shift_buf()
    
    net/sunrpc/xdr.c
       xdr_inline_pages() inlines pages into the receive buffer.
       xdr_partial_copy_from_skb() replaces csum_partial_copy_to_page_cache()
    	and copy code in tcp_read_request(). Provides sendfile()-style
    	method for copying data from an skb into a struct xdr_buf.
       xdr_shift_buf() replaces xdr_shift_iovec() for when we overestimate
    	the size of the RPC/NFS header.
    
    net/sunrpc/xprt.c
       Adapt UDP and TCP receive routines to use new format xdr_buf.
    
    include/linux/nfs_xdr.h
       struct nfs_readargs, nfs_readdirargs, nfs_readlinkargs,
    	nfs3_readdirargs, nfs3_readlinkargs all transmit page information.
       struct nfs_readdirres, nfs_readlinkres, nfs3_readlinkres obsoleted.
       struct nfs_rpc_ops->readlink(), readdir(), read() now send pages
    
    fs/nfs/dir.c
       Adapt to new format ->readdir().
       Avoid kmap() around the RPC call.
    
    fs/nfs/read.c
       Adapt to new format ->read() and struct nfs_readargs.
    
    fs/nfs/symlink.c
       Adapt to new format ->readlink().
    
    fs/nfs/proc.c
       Convert nfs_proc_readlink(), nfs_proc_readdir(), nfs_proc_read()
    
    fs/nfs/nfs2xdr.c
       Convert XDR routines to transmit page information.
       Remove duplicate zeroing of pages when server returns a short read.
    
    fs/nfs/nfs3proc.c
       Convert nfs3_proc_readlink(),nfs3_proc_readdir(),nfs3_proc_read()
    
    fs/nfs/nfs3xdr.c
       Convert XDR routines to transmit page information.
       Remove duplicate zeroing of pages when server returns a short read.
    
    Cheers,
      Trond
    68c45a68
clnt.c 21.8 KB