1. 18 6月, 2009 2 次提交
    • R
      nfs41: New backchannel helper routines · fb7a0b9a
      Ricardo Labiaga 提交于
      This patch introduces support to setup the callback xprt on the client side.
      It allocates/ destroys the preallocated memory structures used to process
      backchannel requests.
      
      At setup time, xprt_setup_backchannel() is invoked to allocate one or
      more rpc_rqst structures and substructures.  This ensures that they
      are available when an RPC callback arrives.  The rpc_rqst structures
      are maintained in a linked list attached to the rpc_xprt structure.
      We keep track of the number of allocations so that they can be correctly
      removed when the channel is destroyed.
      
      When an RPC callback arrives, xprt_alloc_bc_request() is invoked to
      obtain a preallocated rpc_rqst structure.  An rpc_xprt structure is
      returned, and its RPC_BC_PREALLOC_IN_USE bit is set in
      rpc_xprt->bc_flags.  The structure is removed from the the list
      since it is now in use, and it will be later added back when its
      user is done with it.
      
      After the RPC callback replies, the rpc_rqst structure is returned
      by invoking xprt_free_bc_request().  This clears the
      RPC_BC_PREALLOC_IN_USE bit and adds it back to the list, allowing it
      to be reused by a subsequent RPC callback request.
      
      To be consistent with the reception of RPC messages, the backchannel requests
      should be placed into the 'struct rpc_rqst' rq_rcv_buf, which is then in turn
      copied to the 'struct rpc_rqst' rq_private_buf.
      
      [nfs41: Preallocate rpc_rqst receive buffer for handling callbacks]
      Signed-off-by: NRicardo Labiaga <Ricardo.Labiaga@netapp.com>
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      [Update copyright notice and explain page allocation]
      Signed-off-by: NRicardo Labiaga <Ricardo.Labiaga@netapp.com>
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      fb7a0b9a
    • R
      nfs41: client callback structures · 56632b5b
      Ricardo Labiaga 提交于
      Adds new list of rpc_xprt structures, and a readers/writers lock to
      protect the list.  The list is used to preallocate resources for
      the backchannel during backchannel requests.  Callbacks are not
      expected to cause significant latency, so only one callback will
      be allowed at this time.
      
      It also adds a pointer to the NFS callback service so that
      requests can be directed to it for processing.
      
      New callback members added to svc_serv. The NFSv4.1 callback service will
      sleep on the svc_serv->svc_cb_waitq until new callback requests arrive.
      The request will be queued in svc_serv->svc_cb_list. This patch adds this
      list, the sleep queue and spinlock to svc_serv.
      
      [nfs41: NFSv4.1 callback support]
      Signed-off-by: NRicardo Labiaga <ricardo.labiaga@netapp.com>
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      56632b5b
  2. 03 5月, 2009 1 次提交
  3. 20 3月, 2009 1 次提交
    • T
      SUNRPC: Add the equivalent of the linger and linger2 timeouts to RPC sockets · 7d1e8255
      Trond Myklebust 提交于
      This fixes a regression against FreeBSD servers as reported by Tomas
      Kasparek. Apparently when using RPC over a TCP socket, the FreeBSD servers
      don't ever react to the client closing the socket, and so commit
      e06799f9 (SUNRPC: Use shutdown() instead of
      close() when disconnecting a TCP socket) causes the setup to hang forever
      whenever the client attempts to close and then reconnect.
      
      We break the deadlock by adding a 'linger2' style timeout to the socket,
      after which, the client will abort the connection using a TCP 'RST'.
      
      The default timeout is set to 15 seconds. A subsequent patch will put it
      under user control by means of a systctl.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      7d1e8255
  4. 12 3月, 2009 1 次提交
  5. 24 12月, 2008 1 次提交
  6. 20 4月, 2008 2 次提交
    • T
      SUNRPC: Don't disconnect more than once if retransmitting NFSv4 requests · 7c1d71cf
      Trond Myklebust 提交于
      NFSv4 requires us to ensure that we break the TCP connection before we're
      allowed to retransmit a request. However in the case where we're
      retransmitting several requests that have been sent on the same
      connection, we need to ensure that we don't interfere with the attempt to
      reconnect and/or break the connection again once it has been established.
      
      We therefore introduce a 'connection' cookie that is bumped every time a
      connection is broken. This allows requests to track if they need to force a
      disconnection.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      7c1d71cf
    • T
      SUNRPC: Fix up xprt_write_space() · b6ddf64f
      Trond Myklebust 提交于
      The rest of the networking layer uses SOCK_ASYNC_NOSPACE to signal whether
      or not we have someone waiting for buffer memory. Convert the SUNRPC layer
      to use the same idiom.
      Remove the unlikely()s in xs_udp_write_space and xs_tcp_write_space. In
      fact, the most common case will be that there is nobody waiting for buffer
      space.
      
      SOCK_NOSPACE is there to tell the TCP layer whether or not the cwnd was
      limited by the application window. Ensure that we follow the same idiom as
      the rest of the networking layer here too.
      
      Finally, ensure that we clear SOCK_ASYNC_NOSPACE once we wake up, so that
      write_space() doesn't keep waking things up on xprt->pending.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      b6ddf64f
  7. 30 1月, 2008 6 次提交
  8. 10 10月, 2007 7 次提交
  9. 11 7月, 2007 2 次提交
  10. 15 5月, 2007 1 次提交
  11. 01 5月, 2007 3 次提交
    • C
      SUNRPC: introduce rpcbind: replacement for in-kernel portmapper · a509050b
      Chuck Lever 提交于
      Introduce a replacement for the in-kernel portmapper client that supports
      all 3 versions of the rpcbind protocol.  This code is not used yet.
      
      Original code by Groupe Bull updated for the latest kernel, with multiple
      bug fixes.
      
      Note that rpcb_clnt.c does not yet support registering via versions 3 and
      4 of the rpcbind protocol.  That is planned for a later patch.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      a509050b
    • C
      SUNRPC: Eliminate side effects from rpc_malloc · c5a4dd8b
      Chuck Lever 提交于
      Currently rpc_malloc sets req->rq_buffer internally.  Make this a more
      generic interface:  return a pointer to the new buffer (or NULL) and
      make the caller set req->rq_buffer and req->rq_bufsize.  This looks much
      more like kmalloc and eliminates the side effects.
      
      To fix a potential deadlock, this patch also replaces GFP_NOFS with
      GFP_NOWAIT in rpc_malloc.  This prevents async RPCs from sleeping outside
      the RPC's task scheduler while allocating their buffer.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      c5a4dd8b
    • C
      SUNRPC: RPC buffer size estimates are too large · 2bea90d4
      Chuck Lever 提交于
      The RPC buffer size estimation logic in net/sunrpc/clnt.c always
      significantly overestimates the requirements for the buffer size.
      A little instrumentation demonstrated that in fact rpc_malloc was never
      allocating the buffer from the mempool, but almost always called kmalloc.
      
      To compute the size of the RPC buffer more precisely, split p_bufsiz into
      two fields; one for the argument size, and one for the result size.
      
      Then, compute the sum of the exact call and reply header sizes, and split
      the RPC buffer precisely between the two.  That should keep almost all RPC
      buffers within the 2KiB buffer mempool limit.
      
      And, we can finally be rid of RPC_SLACK_SPACE!
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      2bea90d4
  12. 06 12月, 2006 9 次提交
  13. 22 11月, 2006 1 次提交
    • D
      WorkStruct: Separate delayable and non-delayable events. · 52bad64d
      David Howells 提交于
      Separate delayable work items from non-delayable work items be splitting them
      into a separate structure (delayed_work), which incorporates a work_struct and
      the timer_list removed from work_struct.
      
      The work_struct struct is huge, and this limits it's usefulness.  On a 64-bit
      architecture it's nearly 100 bytes in size.  This reduces that by half for the
      non-delayable type of event.
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      52bad64d
  14. 04 10月, 2006 1 次提交
  15. 29 9月, 2006 1 次提交
  16. 23 9月, 2006 1 次提交