1. 06 2月, 2016 3 次提交
  2. 01 2月, 2016 4 次提交
    • T
      SUNRPC: Make freeing of struct xprt rcu-safe · fda1bfef
      Trond Myklebust 提交于
      Have it call kfree_rcu() to ensure that we can use it on rcu-protected
      lists.
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      fda1bfef
    • T
      SUNRPC: Uninline xprt_get(); It isn't performance critical. · 30c5116b
      Trond Myklebust 提交于
      Also allow callers to pass NULL arguments to xprt_get() and xprt_put().
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      30c5116b
    • T
      SUNRPC: Reorder rpc_task to put waitqueue related info in same cachelines · 5edd1051
      Trond Myklebust 提交于
      Try to group all the data required by the waitqueues, their timers and timer
      callbacks into the same cachelines for performance. With this reordering,
      "pahole" reports the following structure on x86_64:
      
      struct rpc_task {
              atomic_t                   tk_count;             /*     0     4 */
              int                        tk_status;            /*     4     4 */
              struct list_head           tk_task;              /*     8    16 */
              void                       (*tk_callback)(struct rpc_task *); /*    24
              void                       (*tk_action)(struct rpc_task *); /*    32
              long unsigned int          tk_timeout;           /*    40     8 */
              long unsigned int          tk_runstate;          /*    48     8 */
              struct rpc_wait_queue *    tk_waitqueue;         /*    56     8 */
              /* --- cacheline 1 boundary (64 bytes) --- */
              union {
                      struct work_struct tk_work;              /*          64 */
                      struct rpc_wait    tk_wait;              /*          56 */
              } u;                                             /*    64    64 */
              /* --- cacheline 2 boundary (128 bytes) --- */
              struct rpc_message         tk_msg;               /*   128    32 */
              void *                     tk_calldata;          /*   160     8 */
              const struct rpc_call_ops  * tk_ops;             /*   168     8 */
              struct rpc_clnt *          tk_client;            /*   176     8 */
              struct rpc_rqst *          tk_rqstp;             /*   184     8 */
              /* --- cacheline 3 boundary (192 bytes) --- */
              struct workqueue_struct *  tk_workqueue;         /*   192     8 */
              ktime_t                    tk_start;             /*   200     8 */
              pid_t                      tk_owner;             /*   208     4 */
              short unsigned int         tk_flags;             /*   212     2 */
              short unsigned int         tk_timeouts;          /*   214     2 */
              short unsigned int         tk_pid;               /*   216     2 */
              unsigned char              tk_priority:2;        /*   218: 6  1 */
              unsigned char              tk_garb_retry:2;      /*   218: 4  1 */
              unsigned char              tk_cred_retry:2;      /*   218: 2  1 */
              unsigned char              tk_rebind_retry:2;    /*   218: 0  1 */
      
              /* size: 224, cachelines: 4, members: 24 */
              /* padding: 5 */
              /* last cacheline: 32 bytes */
      };
      
      whereas on i386, it reports everything fitting into the 1st cacheline.
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      5edd1051
    • T
  3. 20 1月, 2016 8 次提交
  4. 23 12月, 2015 1 次提交
    • S
      sunrpc: Add a function to close temporary transports immediately · c3d4879e
      Scott Mayhew 提交于
      Add a function svc_age_temp_xprts_now() to close temporary transports
      whose xpt_local matches the address passed in server_addr immediately
      instead of waiting for them to be closed by the timer function.
      
      The function is intended to be used by notifier_blocks that will be
      added to nfsd and lockd that will run when an ip address is deleted.
      
      This will eliminate the ACK storms and client hangs that occur in
      HA-NFS configurations where nfsd & lockd is left running on the cluster
      nodes all the time and the NFS 'service' is migrated back and forth
      within a short timeframe.
      Signed-off-by: NScott Mayhew <smayhew@redhat.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      c3d4879e
  5. 25 11月, 2015 1 次提交
    • J
      nfsd4: fix gss-proxy 4.1 mounts for some AD principals · 414ca017
      J. Bruce Fields 提交于
      The principal name on a gss cred is used to setup the NFSv4.0 callback,
      which has to have a client principal name to authenticate to.
      
      That code wants the name to be in the form servicetype@hostname.
      rpc.svcgssd passes down such names (and passes down no principal name at
      all in the case the principal isn't a service principal).
      
      gss-proxy always passes down the principal name, and passes it down in
      the form servicetype/hostname@REALM.  So we've been munging the name
      gss-proxy passes down into the format the NFSv4.0 callback code expects,
      or throwing away the name if we can't.
      
      Since the introduction of the MACH_CRED enforcement in NFSv4.1, we've
      also been using the principal name to verify that certain operations are
      done as the same principal as was used on the original EXCHANGE_ID call.
      
      For that application, the original name passed down by gss-proxy is also
      useful.
      
      Lack of that name in some cases was causing some kerberized NFSv4.1
      mount failures in an Active Directory environment.
      
      This fix only works in the gss-proxy case.  The fix for legacy
      rpc.svcgssd would be more involved, and rpc.svcgssd already has other
      problems in the AD case.
      Reported-and-tested-by: NJames Ralston <ralston@pobox.com>
      Acked-by: NSimo Sorce <simo@redhat.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      414ca017
  6. 03 11月, 2015 3 次提交
  7. 29 10月, 2015 1 次提交
  8. 24 10月, 2015 1 次提交
    • N
      sunrpc/cache: make cache flushing more reliable. · 77862036
      Neil Brown 提交于
      The caches used to store sunrpc authentication information can be
      flushed by writing a timestamp to a file in /proc.
      
      This timestamp has a one-second resolution and any entry in cache that
      was last_refreshed *before* that time is treated as expired.
      
      This is problematic as it is not possible to reliably flush the cache
      without interrupting NFS service.
      If the current time is written to the "flush" file, any entry that was
      added since the current second started will still be treated as valid.
      If one second beyond than the current time is written to the file
      then no entries can be valid until the second ticks over.  This will
      mean that no NFS request will be handled for up to 1 second.
      
      To resolve this issue we make two changes:
      
      1/ treat an entry as expired if the timestamp when it was last_refreshed
        is before *or the same as* the expiry time.  This means that current
        code which writes out the current time will now flush the cache
        reliably.
      
      2/ when a new entry in added to the cache -  set the last_refresh timestamp
        to 1 second *beyond* the current flush time, when that not in the
        past.
        This ensures that newly added entries will always be valid.
      
      Now that we have a very reliable way to flush the cache, and also
      since we are using "since-boot" timestamps which are monotonic,
      change cache_purge() to set the smallest future flush_time which
      will work, and leave it there: don't revert to '1'.
      
      Also disable the setting of the 'flush_time' far into the future.
      That has never been useful and is now awkward as it would cause
      last_refresh times to be strange.
      Finally: if a request is made to set the 'flush_time' to the current
      second, assume the intent is to flush the cache and advance it, if
      necessary, to 1 second beyond the current 'flush_time' so that all
      active entries will be deemed to be expired.
      
      As part of this we need to add a 'cache_detail' arg to cache_init()
      and cache_fresh_locked() so they can find the current ->flush_time.
      Signed-off-by: NNeilBrown <neilb@suse.com>
      Reported-by: NOlaf Kirch <okir@suse.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      77862036
  9. 08 10月, 2015 1 次提交
    • T
      SUNRPC: Move TCP receive data path into a workqueue context · edc1b01c
      Trond Myklebust 提交于
      Stream protocols such as TCP can often build up a backlog of data to be
      read due to ordering. Combine this with the fact that some workloads such
      as NFS read()-intensive workloads need to receive a lot of data per RPC
      call, and it turns out that receiving the data from inside a softirq
      context can cause starvation.
      
      The following patch moves the TCP data receive into a workqueue context.
      We still end up calling tcp_read_sock(), but we do so from a process
      context, meaning that softirqs are enabled for most of the time.
      
      With this patch, I see a doubling of read bandwidth when running a
      multi-threaded iozone workload between a virtual client and server setup.
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      edc1b01c
  10. 18 9月, 2015 1 次提交
  11. 29 8月, 2015 1 次提交
  12. 18 8月, 2015 3 次提交
  13. 13 8月, 2015 3 次提交
  14. 11 8月, 2015 8 次提交
  15. 06 8月, 2015 1 次提交