staging/lustre/ptlrpc: Remove ptlrpc_update_export_timer()
authorOleg Drokin <green@linuxhacker.ru>
Sun, 27 Sep 2015 20:45:36 +0000 (16:45 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 02:06:17 +0000 (04:06 +0200)
This is only used on the server to keep track of alive clients
and feeds into ping evictor (that was removed from the client code).
Also remove struct obd's obd_exports_timed and
struct obd_export's exp_obd_chain_timed used to keep track of that

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/include/lustre_export.h
drivers/staging/lustre/lustre/include/obd.h
drivers/staging/lustre/lustre/obdclass/genops.c
drivers/staging/lustre/lustre/obdclass/obd_config.c
drivers/staging/lustre/lustre/obdecho/echo_client.c
drivers/staging/lustre/lustre/ptlrpc/service.c

index e02a39a721d6892d6434d932c7ce325536b6ad83..c29bfdbef12db86e9af0a68317f88cd5b344464a 100644 (file)
@@ -148,13 +148,6 @@ struct obd_export {
        struct list_head                exp_obd_chain;
        struct hlist_node         exp_uuid_hash; /** uuid-export hash*/
        struct hlist_node         exp_nid_hash; /** nid-export hash */
-       /**
-        * All exports eligible for ping evictor are linked into a list
-        * through this field in "most time since last request on this export"
-        * order
-        * protected by obd_dev_lock
-        */
-       struct list_head                exp_obd_chain_timed;
        /** Obd device of this export */
        struct obd_device       *exp_obd;
        /**
@@ -179,8 +172,6 @@ struct obd_export {
        spinlock_t                exp_uncommitted_replies_lock;
        /** Last committed transno for this export */
        __u64                exp_last_committed;
-       /** When was last request received */
-       unsigned long           exp_last_request_time;
        /** On replay all requests waiting for replay are linked here */
        struct list_head                exp_req_replay_queue;
        /**
@@ -265,13 +256,6 @@ static inline int exp_connect_multibulk(struct obd_export *exp)
        return exp_max_brw_size(exp) > ONE_MB_BRW_SIZE;
 }
 
-static inline int exp_expired(struct obd_export *exp, long age)
-{
-       LASSERT(exp->exp_delayed);
-       return time_before(cfs_time_add(exp->exp_last_request_time, age),
-                          get_seconds());
-}
-
 static inline int exp_connect_cancelset(struct obd_export *exp)
 {
        LASSERT(exp != NULL);
index c12edc5cd032a6e51902de4673d1b59d3b85b5b2..24fc5fd575d7eb58ea9a9e64a447f97b7dcc8987 100644 (file)
@@ -777,8 +777,6 @@ struct obd_device {
        struct rw_semaphore     obd_observer_link_sem;
        struct obd_notify_upcall obd_upcall;
        struct obd_export       *obd_self_export;
-       /* list of exports in LRU order, for ping evictor, with obd_dev_lock */
-       struct list_head              obd_exports_timed;
 
        int                           obd_max_recoverable_clients;
        atomic_t                     obd_connected_clients;
index da01ea5a35b2d3bb45debd0cf27af56201d2281f..8a58b78cfdbf29dfcc90bc64ddac026c78d6da2c 100644 (file)
@@ -846,7 +846,6 @@ struct obd_export *class_new_export(struct obd_device *obd,
        INIT_LIST_HEAD(&export->exp_handle.h_link);
        INIT_LIST_HEAD(&export->exp_hp_rpcs);
        class_handle_hash(&export->exp_handle, &export_handle_ops);
-       export->exp_last_request_time = get_seconds();
        spin_lock_init(&export->exp_lock);
        spin_lock_init(&export->exp_rpc_lock);
        INIT_HLIST_NODE(&export->exp_uuid_hash);
@@ -892,8 +891,6 @@ struct obd_export *class_new_export(struct obd_device *obd,
 
        class_incref(obd, "export", export);
        list_add(&export->exp_obd_chain, &export->exp_obd->obd_exports);
-       list_add_tail(&export->exp_obd_chain_timed,
-                         &export->exp_obd->obd_exports_timed);
        export->exp_obd->obd_num_exports++;
        spin_unlock(&obd->obd_dev_lock);
        cfs_hash_putref(hash);
@@ -924,7 +921,6 @@ void class_unlink_export(struct obd_export *exp)
                             &exp->exp_uuid_hash);
 
        list_move(&exp->exp_obd_chain, &exp->exp_obd->obd_unlinked_exports);
-       list_del_init(&exp->exp_obd_chain_timed);
        exp->exp_obd->obd_num_exports--;
        spin_unlock(&exp->exp_obd->obd_dev_lock);
        class_export_put(exp);
index a96d2f3a00e0056aed6bafbf6a6df6053dcd69b8..d19cbf67a60bacc02a3d5c3f2ab662757d6fddc1 100644 (file)
@@ -381,7 +381,6 @@ int class_attach(struct lustre_cfg *lcfg)
        INIT_LIST_HEAD(&obd->obd_exports);
        INIT_LIST_HEAD(&obd->obd_unlinked_exports);
        INIT_LIST_HEAD(&obd->obd_delayed_exports);
-       INIT_LIST_HEAD(&obd->obd_exports_timed);
        spin_lock_init(&obd->obd_nid_lock);
        spin_lock_init(&obd->obd_dev_lock);
        mutex_init(&obd->obd_dev_mutex);
@@ -518,7 +517,6 @@ int class_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
        }
 
        obd->obd_self_export = exp;
-       list_del_init(&exp->exp_obd_chain_timed);
        class_export_put(exp);
 
        err = obd_setup(obd, lcfg);
index 81304e456dbdca75f86f8ecde98f886c7368b70c..4feca2c42775979bce68e9e18d4a5b37b0c9d9d6 100644 (file)
@@ -2065,12 +2065,6 @@ static int echo_client_setup(const struct lu_env *env,
        ocd->ocd_group = FID_SEQ_ECHO;
 
        rc = obd_connect(env, &ec->ec_exp, tgt, &echo_uuid, ocd, NULL);
-       if (rc == 0) {
-               /* Turn off pinger because it connects to tgt obd directly. */
-               spin_lock(&tgt->obd_dev_lock);
-               list_del_init(&ec->ec_exp->exp_obd_chain_timed);
-               spin_unlock(&tgt->obd_dev_lock);
-       }
 
        kfree(ocd);
 
index 6483642b771c5f920c70dbf05058054ca4addb53..326f89e0ccc7432481e4f896df942f5cb7a50833 100644 (file)
@@ -1028,51 +1028,6 @@ static void ptlrpc_server_finish_active_request(
        ptlrpc_server_finish_request(svcpt, req);
 }
 
-/**
- * This function makes sure dead exports are evicted in a timely manner.
- * This function is only called when some export receives a message (i.e.,
- * the network is up.)
- */
-static void ptlrpc_update_export_timer(struct obd_export *exp, long extra_delay)
-{
-       struct obd_export *oldest_exp;
-       time_t oldest_time, new_time;
-
-       LASSERT(exp);
-
-       /* Compensate for slow machines, etc, by faking our request time
-          into the future.  Although this can break the strict time-ordering
-          of the list, we can be really lazy here - we don't have to evict
-          at the exact right moment.  Eventually, all silent exports
-          will make it to the top of the list. */
-
-       /* Do not pay attention on 1sec or smaller renewals. */
-       new_time = get_seconds() + extra_delay;
-       if (exp->exp_last_request_time + 1 /*second */ >= new_time)
-               return;
-
-       exp->exp_last_request_time = new_time;
-
-       /* exports may get disconnected from the chain even though the
-          export has references, so we must keep the spin lock while
-          manipulating the lists */
-       spin_lock(&exp->exp_obd->obd_dev_lock);
-
-       if (list_empty(&exp->exp_obd_chain_timed)) {
-               /* this one is not timed */
-               spin_unlock(&exp->exp_obd->obd_dev_lock);
-               return;
-       }
-
-       list_move_tail(&exp->exp_obd_chain_timed,
-                          &exp->exp_obd->obd_exports_timed);
-
-       oldest_exp = list_entry(exp->exp_obd->obd_exports_timed.next,
-                                   struct obd_export, exp_obd_chain_timed);
-       oldest_time = oldest_exp->exp_last_request_time;
-       spin_unlock(&exp->exp_obd->obd_dev_lock);
-}
-
 /**
  * Sanity check request \a req.
  * Return 0 if all is ok, error code otherwise.
@@ -1801,7 +1756,6 @@ ptlrpc_server_handle_req_in(struct ptlrpc_service_part *svcpt,
 
                if (rc)
                        goto err_req;
-               ptlrpc_update_export_timer(req->rq_export, 0);
        }
 
        /* req_in handling should/must be fast */
@@ -1910,8 +1864,6 @@ ptlrpc_server_handle_request(struct ptlrpc_service_part *svcpt,
        if (likely(request->rq_export)) {
                if (unlikely(ptlrpc_check_req(request)))
                        goto put_conn;
-               ptlrpc_update_export_timer(request->rq_export,
-                                          timediff_usecs >> 19);
        }
 
        /* Discard requests queued for longer than the deadline.