1. 18 6月, 2009 3 次提交
    • R
      nfs41: Process the RPC call direction · f4a2e418
      Ricardo Labiaga 提交于
      Reading and storing the RPC direction is a three step process.
      
      1. xs_tcp_read_calldir() reads the RPC direction, but it will not store it
      in the XDR buffer since the 'struct rpc_rqst' is not yet available.
      
      2. The 'struct rpc_rqst' is obtained during the TCP_RCV_COPY_DATA state.
      This state need not necessarily be preceeded by the TCP_RCV_READ_CALLDIR.
      For example, we may be reading a continuation packet to a large reply.
      Therefore, we can't simply obtain the 'struct rpc_rqst' during the
      TCP_RCV_READ_CALLDIR state and assume it's available during TCP_RCV_COPY_DATA.
      
      This patch adds a new TCP_RCV_READ_CALLDIR flag to indicate the need to
      read the RPC direction.  It then uses TCP_RCV_COPY_CALLDIR to indicate the
      RPC direction needs to be saved after the 'struct rpc_rqst' has been allocated.
      
      3. The 'struct rpc_rqst' is obtained by the xs_tcp_read_data() helper
      functions.  xs_tcp_read_common() then saves the RPC direction in the XDR
      buffer if TCP_RCV_COPY_CALLDIR is set.  This will happen when we're reading
      the data immediately after the direction was read.  xs_tcp_read_common()
      then clears this flag.
      
      [was nfs41: Skip past the RPC call direction]
      Signed-off-by: NRicardo Labiaga <Ricardo.Labiaga@netapp.com>
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      [nfs41: sunrpc: Add RPC direction back into the XDR buffer]
      Signed-off-by: NRicardo Labiaga <Ricardo.Labiaga@netapp.com>
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      [nfs41: sunrpc: Don't skip past the RPC call direction]
      Signed-off-by: NRicardo Labiaga <Ricardo.Labiaga@netapp.com>
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      f4a2e418
    • R
      nfs41: Add ability to read RPC call direction on TCP stream. · 18dca02a
      Ricardo Labiaga 提交于
      NFSv4.1 callbacks can arrive over an existing connection. This patch adds
      the logic to read the RPC call direction (call or reply). It does this by
      updating the state machine to look for the call direction invoking
      xs_tcp_read_calldir(...) after reading the XID.
      
      [nfs41: Keep track of RPC call/reply direction with a flag]
      
      As per 11/14/08 review of RFC 53/85.
      
      Add a new flag to track whether the incoming message is an RPC call or an
      RPC reply.  TCP_RPC_REPLY is set in the 'struct sock_xprt' tcp_flags in
      xs_tcp_read_calldir() if the message is an RPC reply sent on the forechannel.
      It is cleared if the message is an RPC request sent on the back channel.
      Signed-off-by: NRicardo Labiaga <Ricardo.Labiaga@netapp.com>
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      18dca02a
    • A
      nfs41: sunrpc: Export the call prepare state for session reset · aae2006e
      Andy Adamson 提交于
      Signed-off-by: Andy Adamson<andros@netapp.com>
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      aae2006e
  2. 28 5月, 2009 2 次提交
  3. 27 5月, 2009 1 次提交
  4. 04 5月, 2009 1 次提交
  5. 03 5月, 2009 1 次提交
  6. 26 4月, 2009 1 次提交
  7. 04 4月, 2009 1 次提交
  8. 02 4月, 2009 1 次提交
  9. 31 3月, 2009 1 次提交
    • A
      proc 2/2: remove struct proc_dir_entry::owner · 99b76233
      Alexey Dobriyan 提交于
      Setting ->owner as done currently (pde->owner = THIS_MODULE) is racy
      as correctly noted at bug #12454. Someone can lookup entry with NULL
      ->owner, thus not pinning enything, and release it later resulting
      in module refcount underflow.
      
      We can keep ->owner and supply it at registration time like ->proc_fops
      and ->data.
      
      But this leaves ->owner as easy-manipulative field (just one C assignment)
      and somebody will forget to unpin previous/pin current module when
      switching ->owner. ->proc_fops is declared as "const" which should give
      some thoughts.
      
      ->read_proc/->write_proc were just fixed to not require ->owner for
      protection.
      
      rmmod'ed directories will be empty and return "." and ".." -- no harm.
      And directories with tricky enough readdir and lookup shouldn't be modular.
      We definitely don't want such modular code.
      
      Removing ->owner will also make PDE smaller.
      
      So, let's nuke it.
      
      Kudos to Jeff Layton for reminding about this, let's say, oversight.
      
      http://bugzilla.kernel.org/show_bug.cgi?id=12454Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      99b76233
  10. 30 3月, 2009 2 次提交
  11. 29 3月, 2009 16 次提交
  12. 28 3月, 2009 2 次提交
  13. 20 3月, 2009 5 次提交
  14. 19 3月, 2009 3 次提交
    • O
      svcrpc: take advantage of tcp autotuning · 47a14ef1
      Olga Kornievskaia 提交于
      Allow the NFSv4 server to make use of TCP autotuning behaviour, which
      was previously disabled by setting the sk_userlocks variable.
      
      Set the receive buffers to be big enough to receive the whole RPC
      request, and set this for the listening socket, not the accept socket.
      
      Remove the code that readjusts the receive/send buffer sizes for the
      accepted socket. Previously this code was used to influence the TCP
      window management behaviour, which is no longer needed when autotuning
      is enabled.
      
      This can improve IO bandwidth on networks with high bandwidth-delay
      products, where a large tcp window is required.  It also simplifies
      performance tuning, since getting adequate tcp buffers previously
      required increasing the number of nfsd threads.
      Signed-off-by: NOlga Kornievskaia <aglo@citi.umich.edu>
      Cc: Jim Rees <rees@umich.edu>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      47a14ef1
    • G
      knfsd: add file to export stats about nfsd pools · 03cf6c9f
      Greg Banks 提交于
      Add /proc/fs/nfsd/pool_stats to export to userspace various
      statistics about the operation of rpc server thread pools.
      
      This patch is based on a forward-ported version of
      knfsd-add-pool-thread-stats which has been shipping in the SGI
      "Enhanced NFS" product since 2006 and which was previously
      posted:
      
      http://article.gmane.org/gmane.linux.nfs/10375
      
      It has also been updated thus:
      
       * moved EXPORT_SYMBOL() to near the function it exports
       * made the new struct struct seq_operations const
       * used SEQ_START_TOKEN instead of ((void *)1)
       * merged fix from SGI PV 990526 "sunrpc: use dprintk instead of
         printk in svc_pool_stats_*()" by Harshula Jayasuriya.
       * merged fix from SGI PV 964001 "Crash reading pool_stats before
         nfsds are started".
      Signed-off-by: NGreg Banks <gnb@sgi.com>
      Signed-off-by: NHarshula Jayasuriya <harshula@sgi.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      03cf6c9f
    • G
      knfsd: avoid overloading the CPU scheduler with enormous load averages · 59a252ff
      Greg Banks 提交于
      Avoid overloading the CPU scheduler with enormous load averages
      when handling high call-rate NFS loads.  When the knfsd bottom half
      is made aware of an incoming call by the socket layer, it tries to
      choose an nfsd thread and wake it up.  As long as there are idle
      threads, one will be woken up.
      
      If there are lot of nfsd threads (a sensible configuration when
      the server is disk-bound or is running an HSM), there will be many
      more nfsd threads than CPUs to run them.  Under a high call-rate
      low service-time workload, the result is that almost every nfsd is
      runnable, but only a handful are actually able to run.  This situation
      causes two significant problems:
      
      1. The CPU scheduler takes over 10% of each CPU, which is robbing
         the nfsd threads of valuable CPU time.
      
      2. At a high enough load, the nfsd threads starve userspace threads
         of CPU time, to the point where daemons like portmap and rpc.mountd
         do not schedule for tens of seconds at a time.  Clients attempting
         to mount an NFS filesystem timeout at the very first step (opening
         a TCP connection to portmap) because portmap cannot wake up from
         select() and call accept() in time.
      
      Disclaimer: these effects were observed on a SLES9 kernel, modern
      kernels' schedulers may behave more gracefully.
      
      The solution is simple: keep in each svc_pool a counter of the number
      of threads which have been woken but have not yet run, and do not wake
      any more if that count reaches an arbitrary small threshold.
      
      Testing was on a 4 CPU 4 NIC Altix using 4 IRIX clients, each with 16
      synthetic client threads simulating an rsync (i.e. recursive directory
      listing) workload reading from an i386 RH9 install image (161480
      regular files in 10841 directories) on the server.  That tree is small
      enough to fill in the server's RAM so no disk traffic was involved.
      This setup gives a sustained call rate in excess of 60000 calls/sec
      before being CPU-bound on the server.  The server was running 128 nfsds.
      
      Profiling showed schedule() taking 6.7% of every CPU, and __wake_up()
      taking 5.2%.  This patch drops those contributions to 3.0% and 2.2%.
      Load average was over 120 before the patch, and 20.9 after.
      
      This patch is a forward-ported version of knfsd-avoid-nfsd-overload
      which has been shipping in the SGI "Enhanced NFS" product since 2006.
      It has been posted before:
      
      http://article.gmane.org/gmane.linux.nfs/10374Signed-off-by: NGreg Banks <gnb@sgi.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      59a252ff