Whamcloud - gitweb
LU-11128 ptlrpc: add debugging for idle connections
[fs/lustre-release.git] / lustre / ptlrpc / pinger.c
1 /*
2  * GPL HEADER START
3  *
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 only,
8  * as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License version 2 for more details (a copy is included
14  * in the LICENSE file that accompanied this code).
15  *
16  * You should have received a copy of the GNU General Public License
17  * version 2 along with this program; If not, see
18  * http://www.gnu.org/licenses/gpl-2.0.html
19  *
20  * GPL HEADER END
21  */
22 /*
23  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
24  * Use is subject to license terms.
25  *
26  * Copyright (c) 2011, 2015, Intel Corporation.
27  */
28 /*
29  * This file is part of Lustre, http://www.lustre.org/
30  * Lustre is a trademark of Sun Microsystems, Inc.
31  *
32  * lustre/ptlrpc/pinger.c
33  *
34  * Portal-RPC reconnection and replay operations, for use in recovery.
35  */
36
37 #define DEBUG_SUBSYSTEM S_RPC
38
39 #include <linux/kthread.h>
40 #include <linux/workqueue.h>
41 #include <obd_support.h>
42 #include <obd_class.h>
43 #include "ptlrpc_internal.h"
44
45 static int suppress_pings;
46 module_param(suppress_pings, int, 0644);
47 MODULE_PARM_DESC(suppress_pings, "Suppress pings");
48
49 struct mutex pinger_mutex;
50 static struct list_head pinger_imports =
51                 LIST_HEAD_INIT(pinger_imports);
52 static struct list_head timeout_list =
53                 LIST_HEAD_INIT(timeout_list);
54
55 int ptlrpc_pinger_suppress_pings()
56 {
57         return suppress_pings;
58 }
59 EXPORT_SYMBOL(ptlrpc_pinger_suppress_pings);
60
61 struct ptlrpc_request *
62 ptlrpc_prep_ping(struct obd_import *imp)
63 {
64         struct ptlrpc_request *req;
65
66         req = ptlrpc_request_alloc_pack(imp, &RQF_OBD_PING,
67                                         LUSTRE_OBD_VERSION, OBD_PING);
68         if (req) {
69                 ptlrpc_request_set_replen(req);
70                 req->rq_no_resend = req->rq_no_delay = 1;
71         }
72         return req;
73 }
74
75 int ptlrpc_obd_ping(struct obd_device *obd)
76 {
77         int rc;
78         struct ptlrpc_request *req;
79         ENTRY;
80
81         req = ptlrpc_prep_ping(obd->u.cli.cl_import);
82         if (req == NULL)
83                 RETURN(-ENOMEM);
84
85         req->rq_send_state = LUSTRE_IMP_FULL;
86
87         rc = ptlrpc_queue_wait(req);
88
89         ptlrpc_req_finished(req);
90
91         RETURN(rc);
92 }
93 EXPORT_SYMBOL(ptlrpc_obd_ping);
94
95 static bool ptlrpc_check_import_is_idle(struct obd_import *imp)
96 {
97         struct ldlm_namespace *ns = imp->imp_obd->obd_namespace;
98         time64_t now;
99
100         if (!imp->imp_idle_timeout)
101                 return false;
102
103         /* 4 comes from:
104          *  - client_obd_setup() - hashed import
105          *  - ptlrpcd_alloc_work()
106          *  - ptlrpcd_alloc_work()
107          *  - ptlrpc_pinger_add_import
108          */
109         if (atomic_read(&imp->imp_refcount) > 4)
110                 return false;
111
112         /* any lock increases ns_bref being a resource holder */
113         if (ns && atomic_read(&ns->ns_bref) > 0)
114                 return false;
115
116         now = ktime_get_real_seconds();
117         if (now - imp->imp_last_reply_time < imp->imp_idle_timeout)
118                 return false;
119
120         return true;
121 }
122
123 static int ptlrpc_ping(struct obd_import *imp)
124 {
125         struct ptlrpc_request   *req;
126         ENTRY;
127
128         if (ptlrpc_check_import_is_idle(imp))
129                 RETURN(ptlrpc_disconnect_and_idle_import(imp));
130
131         req = ptlrpc_prep_ping(imp);
132         if (req == NULL) {
133                 CERROR("OOM trying to ping %s->%s\n",
134                        imp->imp_obd->obd_uuid.uuid,
135                        obd2cli_tgt(imp->imp_obd));
136                 RETURN(-ENOMEM);
137         }
138
139         DEBUG_REQ(D_INFO, req, "pinging %s->%s",
140                   imp->imp_obd->obd_uuid.uuid, obd2cli_tgt(imp->imp_obd));
141         ptlrpcd_add_req(req);
142
143         RETURN(0);
144 }
145
146 static void ptlrpc_update_next_ping(struct obd_import *imp, int soon)
147 {
148 #ifdef ENABLE_PINGER
149         time64_t time = soon ? PING_INTERVAL_SHORT : PING_INTERVAL;
150
151         if (imp->imp_state == LUSTRE_IMP_DISCON) {
152                 time64_t dtime = max_t(time64_t, CONNECTION_SWITCH_MIN,
153                                        AT_OFF ? 0 :
154                                        at_get(&imp->imp_at.iat_net_latency));
155                 time = min(time, dtime);
156         }
157         imp->imp_next_ping = ktime_get_seconds() + time;
158 #endif /* ENABLE_PINGER */
159 }
160
161 void ptlrpc_ping_import_soon(struct obd_import *imp)
162 {
163         imp->imp_next_ping = ktime_get_seconds();
164 }
165
166 static inline int imp_is_deactive(struct obd_import *imp)
167 {
168         return (imp->imp_deactive ||
169                 OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_IMP_DEACTIVE));
170 }
171
172 static inline time64_t ptlrpc_next_reconnect(struct obd_import *imp)
173 {
174         if (imp->imp_server_timeout)
175                 return ktime_get_seconds() + (obd_timeout >> 1);
176         else
177                 return ktime_get_seconds() + obd_timeout;
178 }
179
180 static time64_t pinger_check_timeout(time64_t time)
181 {
182         struct timeout_item *item;
183         time64_t timeout = PING_INTERVAL;
184
185         /* This list is sorted in increasing timeout order */
186         mutex_lock(&pinger_mutex);
187         list_for_each_entry(item, &timeout_list, ti_chain) {
188                 time64_t ti_timeout = item->ti_timeout;
189
190                 if (timeout > ti_timeout)
191                         timeout = ti_timeout;
192                 break;
193         }
194         mutex_unlock(&pinger_mutex);
195
196         return time + timeout - ktime_get_seconds();
197 }
198
199 static bool ir_up;
200
201 void ptlrpc_pinger_ir_up(void)
202 {
203         CDEBUG(D_HA, "IR up\n");
204         ir_up = true;
205 }
206 EXPORT_SYMBOL(ptlrpc_pinger_ir_up);
207
208 void ptlrpc_pinger_ir_down(void)
209 {
210         CDEBUG(D_HA, "IR down\n");
211         ir_up = false;
212 }
213 EXPORT_SYMBOL(ptlrpc_pinger_ir_down);
214
215 static void ptlrpc_pinger_process_import(struct obd_import *imp,
216                                          time64_t this_ping)
217 {
218         int level;
219         int force;
220         int force_next;
221         int suppress;
222
223         spin_lock(&imp->imp_lock);
224
225         level = imp->imp_state;
226         force = imp->imp_force_verify;
227         force_next = imp->imp_force_next_verify;
228         /*
229          * This will be used below only if the import is "FULL".
230          */
231         suppress = ir_up && OCD_HAS_FLAG(&imp->imp_connect_data, PINGLESS);
232
233         imp->imp_force_verify = 0;
234
235         if (imp->imp_next_ping - 5 >= this_ping && !force) {
236                 spin_unlock(&imp->imp_lock);
237                 return;
238         }
239
240         imp->imp_force_next_verify = 0;
241
242         spin_unlock(&imp->imp_lock);
243
244         CDEBUG(level == LUSTRE_IMP_FULL ? D_INFO : D_HA, "%s->%s: level %s/%u "
245                "force %u force_next %u deactive %u pingable %u suppress %u\n",
246                imp->imp_obd->obd_uuid.uuid, obd2cli_tgt(imp->imp_obd),
247                ptlrpc_import_state_name(level), level, force, force_next,
248                imp->imp_deactive, imp->imp_pingable, suppress);
249
250         if (level == LUSTRE_IMP_DISCON && !imp_is_deactive(imp)) {
251                 /* wait for a while before trying recovery again */
252                 imp->imp_next_ping = ptlrpc_next_reconnect(imp);
253                 if (!imp->imp_no_pinger_recover)
254                         ptlrpc_initiate_recovery(imp);
255         } else if (level != LUSTRE_IMP_FULL ||
256                    imp->imp_obd->obd_no_recov ||
257                    imp_is_deactive(imp)) {
258                 CDEBUG(D_HA, "%s->%s: not pinging (in recovery "
259                        "or recovery disabled: %s)\n",
260                        imp->imp_obd->obd_uuid.uuid, obd2cli_tgt(imp->imp_obd),
261                        ptlrpc_import_state_name(level));
262                 if (force) {
263                         spin_lock(&imp->imp_lock);
264                         imp->imp_force_verify = 1;
265                         spin_unlock(&imp->imp_lock);
266                 }
267         } else if ((imp->imp_pingable && !suppress) || force_next || force) {
268                 ptlrpc_ping(imp);
269         }
270 }
271
272 static struct workqueue_struct *pinger_wq;
273 static void ptlrpc_pinger_main(struct work_struct *ws);
274 static DECLARE_DELAYED_WORK(ping_work, ptlrpc_pinger_main);
275
276 static void ptlrpc_pinger_main(struct work_struct *ws)
277 {
278         time64_t this_ping = ktime_get_seconds();
279         time64_t time_to_next_wake;
280         struct timeout_item *item;
281         struct obd_import *imp;
282         struct list_head *iter;
283
284         do {
285                 mutex_lock(&pinger_mutex);
286                 list_for_each_entry(item, &timeout_list, ti_chain)
287                         item->ti_cb(item, item->ti_cb_data);
288
289                 list_for_each(iter, &pinger_imports) {
290                         imp = list_entry(iter, struct obd_import,
291                                          imp_pinger_chain);
292
293                         ptlrpc_pinger_process_import(imp, this_ping);
294                         /* obd_timeout might have changed */
295                         if (imp->imp_pingable && imp->imp_next_ping &&
296                             imp->imp_next_ping > this_ping + PING_INTERVAL)
297                                 ptlrpc_update_next_ping(imp, 0);
298                 }
299                 mutex_unlock(&pinger_mutex);
300                 /* update memory usage info */
301                 obd_update_maxusage();
302
303                 /* Wait until the next ping time, or until we're stopped. */
304                 time_to_next_wake = pinger_check_timeout(this_ping);
305                 /* The ping sent by ptlrpc_send_rpc may get sent out
306                  * say .01 second after this.
307                  * ptlrpc_pinger_sending_on_import will then set the
308                  * next ping time to next_ping + .01 sec, which means
309                  * we will SKIP the next ping at next_ping, and the
310                  * ping will get sent 2 timeouts from now!  Beware. */
311                 CDEBUG(D_INFO, "next wakeup in %lld (%lld)\n",
312                        time_to_next_wake, this_ping + PING_INTERVAL);
313         } while (time_to_next_wake <= 0);
314
315         queue_delayed_work(pinger_wq, &ping_work,
316                            cfs_time_seconds(max(time_to_next_wake, 1LL)));
317 }
318
319 int ptlrpc_start_pinger(void)
320 {
321 #ifdef ENABLE_PINGER
322         if (pinger_wq)
323                 return -EALREADY;
324
325         pinger_wq = alloc_workqueue("ptlrpc_pinger", 0, 1);
326         if (!pinger_wq) {
327                 CERROR("cannot start pinger workqueue\n");
328                 return -ENOMEM;
329         }
330
331         queue_delayed_work(pinger_wq, &ping_work, 0);
332
333         if (suppress_pings)
334                 CWARN("Pings will be suppressed at the request of the "
335                       "administrator.  The configuration shall meet the "
336                       "additional requirements described in the manual.  "
337                       "(Search for the \"suppress_pings\" kernel module "
338                       "parameter.)\n");
339 #endif
340         return 0;
341 }
342
343 int ptlrpc_pinger_remove_timeouts(void);
344
345 int ptlrpc_stop_pinger(void)
346 {
347 #ifdef ENABLE_PINGER
348         if (!pinger_wq)
349                 return -EALREADY;
350
351         ptlrpc_pinger_remove_timeouts();
352
353         cancel_delayed_work_sync(&ping_work);
354         destroy_workqueue(pinger_wq);
355         pinger_wq = NULL;
356 #endif
357         return 0;
358 }
359
360 void ptlrpc_pinger_sending_on_import(struct obd_import *imp)
361 {
362         ptlrpc_update_next_ping(imp, 0);
363 }
364
365 void ptlrpc_pinger_commit_expected(struct obd_import *imp)
366 {
367         ptlrpc_update_next_ping(imp, 1);
368         assert_spin_locked(&imp->imp_lock);
369         /*
370          * Avoid reading stale imp_connect_data.  When not sure if pings are
371          * expected or not on next connection, we assume they are not and force
372          * one anyway to guarantee the chance of updating
373          * imp_peer_committed_transno.
374          */
375         if (imp->imp_state != LUSTRE_IMP_FULL ||
376             OCD_HAS_FLAG(&imp->imp_connect_data, PINGLESS))
377                 imp->imp_force_next_verify = 1;
378 }
379
380 int ptlrpc_pinger_add_import(struct obd_import *imp)
381 {
382         ENTRY;
383         if (!list_empty(&imp->imp_pinger_chain))
384                 RETURN(-EALREADY);
385
386         mutex_lock(&pinger_mutex);
387         CDEBUG(D_HA, "adding pingable import %s->%s\n",
388                imp->imp_obd->obd_uuid.uuid, obd2cli_tgt(imp->imp_obd));
389         /* if we add to pinger we want recovery on this import */
390         imp->imp_obd->obd_no_recov = 0;
391         ptlrpc_update_next_ping(imp, 0);
392         /* XXX sort, blah blah */
393         list_add_tail(&imp->imp_pinger_chain, &pinger_imports);
394         class_import_get(imp);
395
396         ptlrpc_pinger_wake_up();
397         mutex_unlock(&pinger_mutex);
398
399         RETURN(0);
400 }
401 EXPORT_SYMBOL(ptlrpc_pinger_add_import);
402
403 int ptlrpc_pinger_del_import(struct obd_import *imp)
404 {
405         ENTRY;
406
407         if (list_empty(&imp->imp_pinger_chain))
408                 RETURN(-ENOENT);
409
410         mutex_lock(&pinger_mutex);
411         list_del_init(&imp->imp_pinger_chain);
412         CDEBUG(D_HA, "removing pingable import %s->%s\n",
413                imp->imp_obd->obd_uuid.uuid, obd2cli_tgt(imp->imp_obd));
414         /* if we remove from pinger we don't want recovery on this import */
415         imp->imp_obd->obd_no_recov = 1;
416         class_import_put(imp);
417         mutex_unlock(&pinger_mutex);
418         RETURN(0);
419 }
420 EXPORT_SYMBOL(ptlrpc_pinger_del_import);
421
422 /**
423  * Register a timeout callback to the pinger list, and the callback will
424  * be called when timeout happens.
425  */
426 static struct timeout_item *ptlrpc_new_timeout(time64_t time,
427                                                enum timeout_event event,
428                                                timeout_cb_t cb, void *data)
429 {
430         struct timeout_item *ti;
431
432         OBD_ALLOC_PTR(ti);
433         if (!ti)
434                 return(NULL);
435
436         INIT_LIST_HEAD(&ti->ti_obd_list);
437         INIT_LIST_HEAD(&ti->ti_chain);
438         ti->ti_timeout = time;
439         ti->ti_event = event;
440         ti->ti_cb = cb;
441         ti->ti_cb_data = data;
442
443         return ti;
444 }
445
446 /**
447  * Register timeout event on the the pinger thread.
448  * Note: the timeout list is an sorted list with increased timeout value.
449  */
450 static struct timeout_item*
451 ptlrpc_pinger_register_timeout(time64_t time, enum timeout_event event,
452                                timeout_cb_t cb, void *data)
453 {
454         struct timeout_item *item, *tmp;
455
456         LASSERT(mutex_is_locked(&pinger_mutex));
457
458         list_for_each_entry(item, &timeout_list, ti_chain)
459                 if (item->ti_event == event)
460                         goto out;
461
462         item = ptlrpc_new_timeout(time, event, cb, data);
463         if (item) {
464                 list_for_each_entry_reverse(tmp, &timeout_list, ti_chain) {
465                         if (tmp->ti_timeout < time) {
466                                 list_add(&item->ti_chain, &tmp->ti_chain);
467                                 goto out;
468                         }
469                 }
470                 list_add(&item->ti_chain, &timeout_list);
471         }
472 out:
473         return item;
474 }
475
476 /* Add a client_obd to the timeout event list, when timeout(@time)
477  * happens, the callback(@cb) will be called.
478  */
479 int ptlrpc_add_timeout_client(time64_t time, enum timeout_event event,
480                               timeout_cb_t cb, void *data,
481                               struct list_head *obd_list)
482 {
483         struct timeout_item *ti;
484
485         mutex_lock(&pinger_mutex);
486         ti = ptlrpc_pinger_register_timeout(time, event, cb, data);
487         if (!ti) {
488                 mutex_unlock(&pinger_mutex);
489                 return (-EINVAL);
490         }
491         list_add(obd_list, &ti->ti_obd_list);
492         mutex_unlock(&pinger_mutex);
493         return 0;
494 }
495 EXPORT_SYMBOL(ptlrpc_add_timeout_client);
496
497 int ptlrpc_del_timeout_client(struct list_head *obd_list,
498                               enum timeout_event event)
499 {
500         struct timeout_item *ti = NULL, *item;
501
502         if (list_empty(obd_list))
503                 return 0;
504         mutex_lock(&pinger_mutex);
505         list_del_init(obd_list);
506         /**
507          * If there are no obd attached to the timeout event
508          * list, remove this timeout event from the pinger
509          */
510         list_for_each_entry(item, &timeout_list, ti_chain) {
511                 if (item->ti_event == event) {
512                         ti = item;
513                         break;
514                 }
515         }
516         LASSERTF(ti != NULL, "ti is NULL !\n");
517         if (list_empty(&ti->ti_obd_list)) {
518                 list_del(&ti->ti_chain);
519                 OBD_FREE_PTR(ti);
520         }
521         mutex_unlock(&pinger_mutex);
522         return 0;
523 }
524 EXPORT_SYMBOL(ptlrpc_del_timeout_client);
525
526 int ptlrpc_pinger_remove_timeouts(void)
527 {
528         struct timeout_item *item, *tmp;
529
530         mutex_lock(&pinger_mutex);
531         list_for_each_entry_safe(item, tmp, &timeout_list, ti_chain) {
532                 LASSERT(list_empty(&item->ti_obd_list));
533                 list_del(&item->ti_chain);
534                 OBD_FREE_PTR(item);
535         }
536         mutex_unlock(&pinger_mutex);
537         return 0;
538 }
539
540 void ptlrpc_pinger_wake_up()
541 {
542 #ifdef ENABLE_PINGER
543         mod_delayed_work(pinger_wq, &ping_work, 0);
544 #endif
545 }
546
547 /* Ping evictor thread */
548 #define PET_READY     1
549 #define PET_TERMINATE 2
550
551 static int               pet_refcount = 0;
552 static int               pet_state;
553 static wait_queue_head_t pet_waitq;
554 static struct list_head  pet_list;
555 static DEFINE_SPINLOCK(pet_lock);
556
557 int ping_evictor_wake(struct obd_export *exp)
558 {
559         struct obd_device *obd;
560
561         spin_lock(&pet_lock);
562         if (pet_state != PET_READY) {
563                 /* eventually the new obd will call here again. */
564                 spin_unlock(&pet_lock);
565                 return 1;
566         }
567
568         obd = class_exp2obd(exp);
569         if (list_empty(&obd->obd_evict_list)) {
570                 class_incref(obd, "evictor", obd);
571                 list_add(&obd->obd_evict_list, &pet_list);
572         }
573         spin_unlock(&pet_lock);
574
575         wake_up(&pet_waitq);
576         return 0;
577 }
578
579 static int ping_evictor_main(void *arg)
580 {
581         struct obd_device *obd;
582         struct obd_export *exp;
583         struct l_wait_info lwi = { 0 };
584         time64_t expire_time;
585
586         ENTRY;
587         unshare_fs_struct();
588
589         CDEBUG(D_HA, "Starting Ping Evictor\n");
590         pet_state = PET_READY;
591         while (1) {
592                 l_wait_event(pet_waitq, (!list_empty(&pet_list)) ||
593                             (pet_state == PET_TERMINATE), &lwi);
594
595                 /* loop until all obd's will be removed */
596                 if ((pet_state == PET_TERMINATE) && list_empty(&pet_list))
597                         break;
598
599                 /* we only get here if pet_exp != NULL, and the end of this
600                  * loop is the only place which sets it NULL again, so lock
601                  * is not strictly necessary. */
602                 spin_lock(&pet_lock);
603                 obd = list_entry(pet_list.next, struct obd_device,
604                                  obd_evict_list);
605                 spin_unlock(&pet_lock);
606
607                 expire_time = ktime_get_real_seconds() - PING_EVICT_TIMEOUT;
608
609                 CDEBUG(D_HA, "evicting all exports of obd %s older than %lld\n",
610                        obd->obd_name, expire_time);
611
612                 /* Exports can't be deleted out of the list while we hold
613                  * the obd lock (class_unlink_export), which means we can't
614                  * lose the last ref on the export.  If they've already been
615                  * removed from the list, we won't find them here. */
616                 spin_lock(&obd->obd_dev_lock);
617                 while (!list_empty(&obd->obd_exports_timed)) {
618                         exp = list_entry(obd->obd_exports_timed.next,
619                                          struct obd_export,
620                                          exp_obd_chain_timed);
621                         if (expire_time > exp->exp_last_request_time) {
622                                 class_export_get(exp);
623                                 spin_unlock(&obd->obd_dev_lock);
624                                 LCONSOLE_WARN("%s: haven't heard from client %s"
625                                               " (at %s) in %lld seconds. I think"
626                                               " it's dead, and I am evicting"
627                                               " it. exp %p, cur %lld expire %lld"
628                                               " last %lld\n",
629                                               obd->obd_name,
630                                               obd_uuid2str(&exp->exp_client_uuid),
631                                               obd_export_nid2str(exp),
632                                               ktime_get_real_seconds() -
633                                               exp->exp_last_request_time,
634                                               exp, ktime_get_real_seconds(),
635                                               expire_time,
636                                               exp->exp_last_request_time);
637                                 CDEBUG(D_HA, "Last request was at %lld\n",
638                                        exp->exp_last_request_time);
639                                 class_fail_export(exp);
640                                 class_export_put(exp);
641                                 spin_lock(&obd->obd_dev_lock);
642                         } else {
643                                 /* List is sorted, so everyone below is ok */
644                                 break;
645                         }
646                 }
647                 spin_unlock(&obd->obd_dev_lock);
648
649                 spin_lock(&pet_lock);
650                 list_del_init(&obd->obd_evict_list);
651                 spin_unlock(&pet_lock);
652
653                 class_decref(obd, "evictor", obd);
654         }
655         CDEBUG(D_HA, "Exiting Ping Evictor\n");
656
657         RETURN(0);
658 }
659
660 void ping_evictor_start(void)
661 {
662         struct task_struct *task;
663
664         if (++pet_refcount > 1)
665                 return;
666
667         INIT_LIST_HEAD(&pet_list);
668         init_waitqueue_head(&pet_waitq);
669
670         task = kthread_run(ping_evictor_main, NULL, "ll_evictor");
671         if (IS_ERR(task)) {
672                 pet_refcount--;
673                 CERROR("Cannot start ping evictor thread: %ld\n",
674                         PTR_ERR(task));
675         }
676 }
677 EXPORT_SYMBOL(ping_evictor_start);
678
679 void ping_evictor_stop(void)
680 {
681         if (--pet_refcount > 0)
682                 return;
683
684         pet_state = PET_TERMINATE;
685         wake_up(&pet_waitq);
686 }
687 EXPORT_SYMBOL(ping_evictor_stop);