Skip to content
  1. Aug 20, 2019
  2. Jul 19, 2019
  3. Jul 18, 2019
  4. Jul 16, 2019
  5. Jul 12, 2019
  6. Jul 09, 2019
    • Chuck Lever's avatar
      xprtrdma: Modernize ops->connect · 675dd90a
      Chuck Lever authored
      
      
      Adapt and apply changes that were made to the TCP socket connect
      code. See the following commits for details on the purpose of
      these changes:
      
      Commit 7196dbb0 ("SUNRPC: Allow changing of the TCP timeout parameters on the fly")
      Commit 3851f1cd ("SUNRPC: Limit the reconnect backoff timer to the max RPC message timeout")
      Commit 02910177 ("SUNRPC: Fix reconnection timeouts")
      
      Some common transport code is moved to xprt.c to satisfy the code
      duplication police.
      
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      675dd90a
    • Chuck Lever's avatar
      xprtrdma: Remove rpcrdma_req::rl_buffer · 5828ceba
      Chuck Lever authored
      
      
      Clean up.
      
      There is only one remaining function, rpcrdma_buffer_put(), that
      uses this field. Its caller can supply a pointer to the correct
      rpcrdma_buffer, enabling the removal of an 8-byte pointer field
      from a frequently-allocated shared data structure.
      
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      5828ceba
    • Chuck Lever's avatar
      xprtrdma: Refactor chunk encoding · 6a6c6def
      Chuck Lever authored
      
      
      Clean up.
      
      Move the "not present" case into the individual chunk encoders. This
      improves code organization and readability.
      
      The reason for the original organization was to optimize for the
      case where there there are no chunks. The optimization turned out to
      be inconsequential, so let's err on the side of code readability.
      
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      6a6c6def
    • Chuck Lever's avatar
      xprtrdma: Streamline rpcrdma_post_recvs · 9ef33ef5
      Chuck Lever authored
      
      
      rb_lock is contended between rpcrdma_buffer_create,
      rpcrdma_buffer_put, and rpcrdma_post_recvs.
      
      Commit e340c2d6 ("xprtrdma: Reduce the doorbell rate (Receive)")
      causes rpcrdma_post_recvs to take the rb_lock repeatedly when it
      determines more Receives are needed. Streamline this code path so
      it takes the lock just once in most cases to build the Receive
      chain that is about to be posted.
      
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      9ef33ef5
    • Chuck Lever's avatar
      xprtrdma: Simplify rpcrdma_rep_create · 379d1bc5
      Chuck Lever authored
      
      
      Clean up.
      
      Commit 7c8d9e7c ("xprtrdma: Move Receive posting to Receive
      handler") reduced the number of rpcrdma_rep_create call sites to
      one. After that commit, the backchannel code no longer invokes it.
      
      Therefore the free list logic added by commit d698c4a0
      ("xprtrdma: Fix backchannel allocation of extra rpcrdma_reps") is
      no longer necessary, and in fact adds some extra overhead that we
      can do without.
      
      Simply post any newly created reps. They will get added back to
      the rb_recv_bufs list when they subsequently complete.
      
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      379d1bc5
    • Chuck Lever's avatar
      xprtrdma: Wake RPCs directly in rpcrdma_wc_send path · 0ab11523
      Chuck Lever authored
      
      
      Eliminate a context switch in the path that handles RPC wake-ups
      when a Receive completion has to wait for a Send completion.
      
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      0ab11523
    • Chuck Lever's avatar
      xprtrdma: Reduce context switching due to Local Invalidation · d8099fed
      Chuck Lever authored
      
      
      Since commit ba69cd12 ("xprtrdma: Remove support for FMR memory
      registration"), FRWR is the only supported memory registration mode.
      
      We can take advantage of the asynchronous nature of FRWR's LOCAL_INV
      Work Requests to get rid of the completion wait by having the
      LOCAL_INV completion handler take care of DMA unmapping MRs and
      waking the upper layer RPC waiter.
      
      This eliminates two context switches when local invalidation is
      necessary. As a side benefit, we will no longer need the per-xprt
      deferred completion work queue.
      
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      d8099fed
    • Chuck Lever's avatar
      xprtrdma: Add mechanism to place MRs back on the free list · 40088f0e
      Chuck Lever authored
      
      
      When a marshal operation fails, any MRs that were already set up for
      that request are recycled. Recycling releases MRs and creates new
      ones, which is expensive.
      
      Since commit f2877623 ("xprtrdma: Chain Send to FastReg WRs")
      was merged, recycling FRWRs is unnecessary. This is because before
      that commit, frwr_map had already posted FAST_REG Work Requests,
      so ownership of the MRs had already been passed to the NIC and thus
      dealing with them had to be delayed until they completed.
      
      Since that commit, however, FAST_REG WRs are posted at the same time
      as the Send WR. This means that if marshaling fails, we are certain
      the MRs are safe to simply unmap and place back on the free list
      because neither the Send nor the FAST_REG WRs have been posted yet.
      The kernel still has ownership of the MRs at this point.
      
      This reduces the total number of MRs that the xprt has to create
      under heavy workloads and makes the marshaling logic less brittle.
      
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      40088f0e
    • Chuck Lever's avatar
      xprtrdma: Remove fr_state · 84756894
      Chuck Lever authored
      
      
      Now that both the Send and Receive completions are handled in
      process context, it is safe to DMA unmap and return MRs to the
      free or recycle lists directly in the completion handlers.
      
      Doing this means rpcrdma_frwr no longer needs to track the state of
      each MR, meaning that a VALID or FLUSHED MR can no longer appear on
      an xprt's MR free list. Thus there is no longer a need to track the
      MR's registration state in rpcrdma_frwr.
      
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      84756894
    • Chuck Lever's avatar
      xprtrdma: Remove the RPCRDMA_REQ_F_PENDING flag · 5809ea4f
      Chuck Lever authored
      
      
      Commit 9590d083 ("xprtrdma: Use xprt_pin_rqst in
      rpcrdma_reply_handler") pins incoming RPC/RDMA replies so they
      can be left in the pending requests queue while they are being
      processed without introducing a race between ->buf_free and the
      transport's reply handler. Therefore RPCRDMA_REQ_F_PENDING is no
      longer necessary.
      
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      5809ea4f
    • Chuck Lever's avatar
      xprtrdma: Fix occasional transport deadlock · 05eb06d8
      Chuck Lever authored
      
      
      Under high I/O workloads, I've noticed that an RPC/RDMA transport
      occasionally deadlocks (IOPS goes to zero, and doesn't recover).
      Diagnosis shows that the sendctx queue is empty, but when sendctxs
      are returned to the queue, the xprt_write_space wake-up never
      occurs. The wake-up logic in rpcrdma_sendctx_put_locked is racy.
      
      I noticed that both EMPTY_SCQ and XPRT_WRITE_SPACE are implemented
      via an atomic bit. Just one of those is sufficient. Removing
      EMPTY_SCQ in favor of the generic bit mechanism makes the deadlock
      un-reproducible.
      
      Without EMPTY_SCQ, rpcrdma_buffer::rb_flags is no longer used and
      is therefore removed.
      
      Unfortunately this patch does not apply cleanly to stable. If
      needed, someone will have to port it and test it.
      
      Fixes: 2fad6592 ("xprtrdma: Wait on empty sendctx queue")
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      05eb06d8
    • Chuck Lever's avatar
      xprtrdma: Replace use of xdr_stream_pos in rpcrdma_marshal_req · 1310051c
      Chuck Lever authored
      
      
      This is a latent bug. xdr_stream_pos works by subtracting
      xdr_stream::nwords from xdr_buf::len. But xdr_stream::nwords is not
      initialized by xdr_init_encode().
      
      It works today only because all fields in rpcrdma_req::rl_stream
      are initialized to zero by rpcrdma_req_create, making the
      subtraction in xdr_stream_pos always a no-op.
      
      I found this issue via code inspection. It was introduced by commit
      39f4cd9e ("xprtrdma: Harden chunk list encoding against send
      buffer overflow"), but the code has changed enough since then that
      this fix can't be automatically applied to stable.
      
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      1310051c
  7. Jul 08, 2019
  8. Jul 06, 2019
Loading