Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging/lustre/libcfs: remove cfs_pause

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Peng Tao and committed by
Greg Kroah-Hartman
d3caf4d5 18fd5baa

+38 -32
-5
drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h
··· 41 41 #define __LIBCFS_PRIM_H__ 42 42 43 43 /* 44 - * Schedule 45 - */ 46 - void cfs_pause(cfs_duration_t ticks); 47 - 48 - /* 49 44 * Timer 50 45 */ 51 46 typedef void (cfs_timer_func_t)(ulong_ptr_t);
+4 -2
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
··· 2774 2774 CDEBUG(((i & (-i)) == i) ? D_WARNING : D_NET, /* power of 2? */ 2775 2775 "Waiting for %d threads to terminate\n", 2776 2776 atomic_read(&kiblnd_data.kib_nthreads)); 2777 - cfs_pause(cfs_time_seconds(1)); 2777 + set_current_state(TASK_UNINTERRUPTIBLE); 2778 + schedule_timeout(cfs_time_seconds(1)); 2778 2779 } 2779 2780 2780 2781 /* fall through */ ··· 2836 2835 "%s: waiting for %d peers to disconnect\n", 2837 2836 libcfs_nid2str(ni->ni_nid), 2838 2837 atomic_read(&net->ibn_npeers)); 2839 - cfs_pause(cfs_time_seconds(1)); 2838 + set_current_state(TASK_UNINTERRUPTIBLE); 2839 + schedule_timeout(cfs_time_seconds(1)); 2840 2840 } 2841 2841 2842 2842 kiblnd_net_fini_pools(net);
+4 -2
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
··· 2336 2336 "waiting for %d threads to terminate\n", 2337 2337 ksocknal_data.ksnd_nthreads); 2338 2338 read_unlock(&ksocknal_data.ksnd_global_lock); 2339 - cfs_pause(cfs_time_seconds(1)); 2339 + set_current_state(TASK_UNINTERRUPTIBLE); 2340 + schedule_timeout(cfs_time_seconds(1)); 2340 2341 read_lock(&ksocknal_data.ksnd_global_lock); 2341 2342 } 2342 2343 read_unlock(&ksocknal_data.ksnd_global_lock); ··· 2585 2584 CDEBUG(((i & (-i)) == i) ? D_WARNING : D_NET, /* power of 2? */ 2586 2585 "waiting for %d peers to disconnect\n", 2587 2586 net->ksnn_npeers); 2588 - cfs_pause(cfs_time_seconds(1)); 2587 + set_current_state(TASK_UNINTERRUPTIBLE); 2588 + schedule_timeout(cfs_time_seconds(1)); 2589 2589 2590 2590 ksocknal_debug_peerhash(ni); 2591 2591
+4 -2
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
··· 189 189 int bufnob; 190 190 191 191 if (ksocknal_data.ksnd_stall_tx != 0) { 192 - cfs_pause(cfs_time_seconds(ksocknal_data.ksnd_stall_tx)); 192 + set_current_state(TASK_UNINTERRUPTIBLE); 193 + schedule_timeout(cfs_time_seconds(ksocknal_data.ksnd_stall_tx)); 193 194 } 194 195 195 196 LASSERT (tx->tx_resid != 0); ··· 346 345 int rc; 347 346 348 347 if (ksocknal_data.ksnd_stall_rx != 0) { 349 - cfs_pause(cfs_time_seconds (ksocknal_data.ksnd_stall_rx)); 348 + set_current_state(TASK_UNINTERRUPTIBLE); 349 + schedule_timeout(cfs_time_seconds(ksocknal_data.ksnd_stall_rx)); 350 350 } 351 351 352 352 rc = ksocknal_connsock_addref(conn);
+2 -1
drivers/staging/lustre/lnet/lnet/acceptor.c
··· 371 371 if (rc != 0) { 372 372 if (rc != -EAGAIN) { 373 373 CWARN("Accept error %d: pausing...\n", rc); 374 - cfs_pause(cfs_time_seconds(1)); 374 + set_current_state(TASK_UNINTERRUPTIBLE); 375 + schedule_timeout(cfs_time_seconds(1)); 375 376 } 376 377 continue; 377 378 }
+2 -1
drivers/staging/lustre/lnet/lnet/api-ni.c
··· 994 994 "Waiting for zombie LNI %s\n", 995 995 libcfs_nid2str(ni->ni_nid)); 996 996 } 997 - cfs_pause(cfs_time_seconds(1)); 997 + set_current_state(TASK_UNINTERRUPTIBLE); 998 + schedule_timeout(cfs_time_seconds(1)); 998 999 lnet_net_lock(LNET_LOCK_EX); 999 1000 continue; 1000 1001 }
+2 -1
drivers/staging/lustre/lnet/lnet/peer.c
··· 145 145 "Waiting for %d peers on peer table\n", 146 146 ptable->pt_number); 147 147 } 148 - cfs_pause(cfs_time_seconds(1) / 2); 148 + set_current_state(TASK_UNINTERRUPTIBLE); 149 + schedule_timeout(cfs_time_seconds(1) / 2); 149 150 lnet_net_lock(i); 150 151 } 151 152 list_splice_init(&ptable->pt_deathrow, &deathrow);
+5 -3
drivers/staging/lustre/lnet/lnet/router.c
··· 779 779 if (all_known) 780 780 return; 781 781 782 - cfs_pause(cfs_time_seconds(1)); 782 + set_current_state(TASK_UNINTERRUPTIBLE); 783 + schedule_timeout(cfs_time_seconds(1)); 783 784 } 784 785 } 785 786 ··· 1148 1147 i++; 1149 1148 CDEBUG(((i & (-i)) == i) ? D_WARNING : D_NET, 1150 1149 "Waiting for rc buffers to unlink\n"); 1151 - cfs_pause(cfs_time_seconds(1) / 4); 1150 + set_current_state(TASK_UNINTERRUPTIBLE); 1151 + schedule_timeout(cfs_time_seconds(1) / 4); 1152 1152 1153 1153 lnet_net_lock(LNET_LOCK_EX); 1154 1154 } ··· 1208 1206 1209 1207 lnet_prune_rc_data(0); /* don't wait for UNLINK */ 1210 1208 1211 - /* Call cfs_pause() here always adds 1 to load average 1209 + /* Call schedule_timeout() here always adds 1 to load average 1212 1210 * because kernel counts # active tasks as nr_running 1213 1211 * + nr_uninterruptible. */ 1214 1212 set_current_state(TASK_INTERRUPTIBLE);
+2 -1
drivers/staging/lustre/lnet/selftest/conrpc.c
··· 1346 1346 mutex_unlock(&console_session.ses_mutex); 1347 1347 1348 1348 CWARN("Session is shutting down, waiting for termination of transactions\n"); 1349 - cfs_pause(cfs_time_seconds(1)); 1349 + set_current_state(TASK_UNINTERRUPTIBLE); 1350 + schedule_timeout(cfs_time_seconds(1)); 1350 1351 1351 1352 mutex_lock(&console_session.ses_mutex); 1352 1353 }
+2 -1
drivers/staging/lustre/lnet/selftest/rpc.c
··· 1585 1585 spin_lock_init(&srpc_data.rpc_glock); 1586 1586 1587 1587 /* 1 second pause to avoid timestamp reuse */ 1588 - cfs_pause(cfs_time_seconds(1)); 1588 + set_current_state(TASK_UNINTERRUPTIBLE); 1589 + schedule_timeout(cfs_time_seconds(1)); 1589 1590 srpc_data.rpc_matchbits = ((__u64) cfs_time_current_sec()) << 48; 1590 1591 1591 1592 srpc_data.rpc_state = SRPC_STATE_NONE;
+5 -1
drivers/staging/lustre/lnet/selftest/selftest.h
··· 572 572 #undef STATE2STR 573 573 } 574 574 575 - #define selftest_wait_events() cfs_pause(cfs_time_seconds(1) / 10) 575 + #define selftest_wait_events() \ 576 + do { \ 577 + set_current_state(TASK_UNINTERRUPTIBLE); \ 578 + schedule_timeout(cfs_time_seconds(1) / 10); \ 579 + } while (0) 576 580 577 581 578 582 #define lst_wait_until(cond, lock, fmt, ...) \
+2 -1
drivers/staging/lustre/lustre/include/linux/obd.h
··· 96 96 LCONSOLE_WARN("====== for current process =====\n"); 97 97 dump_stack(); 98 98 LCONSOLE_WARN("====== end =======\n"); 99 - cfs_pause(1000 * HZ); 99 + set_current_state(TASK_UNINTERRUPTIBLE); 100 + schedule_timeout(1000 * HZ); 100 101 } 101 102 cpu_relax(); 102 103 }
-9
drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c
··· 70 70 } 71 71 EXPORT_SYMBOL(add_wait_queue_exclusive_head); 72 72 73 - /* deschedule for a bit... */ 74 - void 75 - cfs_pause(cfs_duration_t ticks) 76 - { 77 - set_current_state(TASK_UNINTERRUPTIBLE); 78 - schedule_timeout(ticks); 79 - } 80 - EXPORT_SYMBOL(cfs_pause); 81 - 82 73 void cfs_init_timer(struct timer_list *t) 83 74 { 84 75 init_timer(t);
+4 -2
drivers/staging/lustre/lustre/libcfs/workitem.c
··· 334 334 sched->ws_nthreads, sched->ws_name); 335 335 336 336 spin_unlock(&cfs_wi_data.wi_glock); 337 - cfs_pause(cfs_time_seconds(1) / 20); 337 + set_current_state(TASK_UNINTERRUPTIBLE); 338 + schedule_timeout(cfs_time_seconds(1) / 20); 338 339 spin_lock(&cfs_wi_data.wi_glock); 339 340 } 340 341 ··· 460 459 461 460 while (sched->ws_nthreads != 0) { 462 461 spin_unlock(&cfs_wi_data.wi_glock); 463 - cfs_pause(cfs_time_seconds(1) / 20); 462 + set_current_state(TASK_UNINTERRUPTIBLE); 463 + schedule_timeout(cfs_time_seconds(1) / 20); 464 464 spin_lock(&cfs_wi_data.wi_glock); 465 465 } 466 466 spin_unlock(&cfs_wi_data.wi_glock);