call_object.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. /* RxRPC individual remote procedure call handling
  2. *
  3. * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  12. #include <linux/slab.h>
  13. #include <linux/module.h>
  14. #include <linux/circ_buf.h>
  15. #include <linux/spinlock_types.h>
  16. #include <net/sock.h>
  17. #include <net/af_rxrpc.h>
  18. #include "ar-internal.h"
  19. const char *const rxrpc_call_states[NR__RXRPC_CALL_STATES] = {
  20. [RXRPC_CALL_UNINITIALISED] = "Uninit ",
  21. [RXRPC_CALL_CLIENT_AWAIT_CONN] = "ClWtConn",
  22. [RXRPC_CALL_CLIENT_SEND_REQUEST] = "ClSndReq",
  23. [RXRPC_CALL_CLIENT_AWAIT_REPLY] = "ClAwtRpl",
  24. [RXRPC_CALL_CLIENT_RECV_REPLY] = "ClRcvRpl",
  25. [RXRPC_CALL_SERVER_PREALLOC] = "SvPrealc",
  26. [RXRPC_CALL_SERVER_SECURING] = "SvSecure",
  27. [RXRPC_CALL_SERVER_ACCEPTING] = "SvAccept",
  28. [RXRPC_CALL_SERVER_RECV_REQUEST] = "SvRcvReq",
  29. [RXRPC_CALL_SERVER_ACK_REQUEST] = "SvAckReq",
  30. [RXRPC_CALL_SERVER_SEND_REPLY] = "SvSndRpl",
  31. [RXRPC_CALL_SERVER_AWAIT_ACK] = "SvAwtACK",
  32. [RXRPC_CALL_COMPLETE] = "Complete",
  33. };
  34. const char *const rxrpc_call_completions[NR__RXRPC_CALL_COMPLETIONS] = {
  35. [RXRPC_CALL_SUCCEEDED] = "Complete",
  36. [RXRPC_CALL_REMOTELY_ABORTED] = "RmtAbort",
  37. [RXRPC_CALL_LOCALLY_ABORTED] = "LocAbort",
  38. [RXRPC_CALL_LOCAL_ERROR] = "LocError",
  39. [RXRPC_CALL_NETWORK_ERROR] = "NetError",
  40. };
  41. const char rxrpc_call_traces[rxrpc_call__nr_trace][4] = {
  42. [rxrpc_call_new_client] = "NWc",
  43. [rxrpc_call_new_service] = "NWs",
  44. [rxrpc_call_queued] = "QUE",
  45. [rxrpc_call_queued_ref] = "QUR",
  46. [rxrpc_call_connected] = "CON",
  47. [rxrpc_call_release] = "RLS",
  48. [rxrpc_call_seen] = "SEE",
  49. [rxrpc_call_got] = "GOT",
  50. [rxrpc_call_got_userid] = "Gus",
  51. [rxrpc_call_got_kernel] = "Gke",
  52. [rxrpc_call_put] = "PUT",
  53. [rxrpc_call_put_userid] = "Pus",
  54. [rxrpc_call_put_kernel] = "Pke",
  55. [rxrpc_call_put_noqueue] = "PNQ",
  56. [rxrpc_call_error] = "*E*",
  57. };
  58. struct kmem_cache *rxrpc_call_jar;
  59. LIST_HEAD(rxrpc_calls);
  60. DEFINE_RWLOCK(rxrpc_call_lock);
  61. static void rxrpc_call_timer_expired(unsigned long _call)
  62. {
  63. struct rxrpc_call *call = (struct rxrpc_call *)_call;
  64. _enter("%d", call->debug_id);
  65. if (call->state < RXRPC_CALL_COMPLETE)
  66. rxrpc_set_timer(call, rxrpc_timer_expired, ktime_get_real());
  67. }
  68. /*
  69. * find an extant server call
  70. * - called in process context with IRQs enabled
  71. */
  72. struct rxrpc_call *rxrpc_find_call_by_user_ID(struct rxrpc_sock *rx,
  73. unsigned long user_call_ID)
  74. {
  75. struct rxrpc_call *call;
  76. struct rb_node *p;
  77. _enter("%p,%lx", rx, user_call_ID);
  78. read_lock(&rx->call_lock);
  79. p = rx->calls.rb_node;
  80. while (p) {
  81. call = rb_entry(p, struct rxrpc_call, sock_node);
  82. if (user_call_ID < call->user_call_ID)
  83. p = p->rb_left;
  84. else if (user_call_ID > call->user_call_ID)
  85. p = p->rb_right;
  86. else
  87. goto found_extant_call;
  88. }
  89. read_unlock(&rx->call_lock);
  90. _leave(" = NULL");
  91. return NULL;
  92. found_extant_call:
  93. rxrpc_get_call(call, rxrpc_call_got);
  94. read_unlock(&rx->call_lock);
  95. _leave(" = %p [%d]", call, atomic_read(&call->usage));
  96. return call;
  97. }
  98. /*
  99. * allocate a new call
  100. */
  101. struct rxrpc_call *rxrpc_alloc_call(gfp_t gfp)
  102. {
  103. struct rxrpc_call *call;
  104. call = kmem_cache_zalloc(rxrpc_call_jar, gfp);
  105. if (!call)
  106. return NULL;
  107. call->rxtx_buffer = kcalloc(RXRPC_RXTX_BUFF_SIZE,
  108. sizeof(struct sk_buff *),
  109. gfp);
  110. if (!call->rxtx_buffer)
  111. goto nomem;
  112. call->rxtx_annotations = kcalloc(RXRPC_RXTX_BUFF_SIZE, sizeof(u8), gfp);
  113. if (!call->rxtx_annotations)
  114. goto nomem_2;
  115. setup_timer(&call->timer, rxrpc_call_timer_expired,
  116. (unsigned long)call);
  117. INIT_WORK(&call->processor, &rxrpc_process_call);
  118. INIT_LIST_HEAD(&call->link);
  119. INIT_LIST_HEAD(&call->chan_wait_link);
  120. INIT_LIST_HEAD(&call->accept_link);
  121. INIT_LIST_HEAD(&call->recvmsg_link);
  122. INIT_LIST_HEAD(&call->sock_link);
  123. init_waitqueue_head(&call->waitq);
  124. spin_lock_init(&call->lock);
  125. rwlock_init(&call->state_lock);
  126. atomic_set(&call->usage, 1);
  127. call->debug_id = atomic_inc_return(&rxrpc_debug_id);
  128. memset(&call->sock_node, 0xed, sizeof(call->sock_node));
  129. /* Leave space in the ring to handle a maxed-out jumbo packet */
  130. call->rx_winsize = rxrpc_rx_window_size;
  131. call->tx_winsize = 16;
  132. call->rx_expect_next = 1;
  133. if (RXRPC_TX_SMSS > 2190)
  134. call->cong_cwnd = 2;
  135. else if (RXRPC_TX_SMSS > 1095)
  136. call->cong_cwnd = 3;
  137. else
  138. call->cong_cwnd = 4;
  139. call->cong_ssthresh = RXRPC_RXTX_BUFF_SIZE - 1;
  140. return call;
  141. nomem_2:
  142. kfree(call->rxtx_buffer);
  143. nomem:
  144. kmem_cache_free(rxrpc_call_jar, call);
  145. return NULL;
  146. }
  147. /*
  148. * Allocate a new client call.
  149. */
  150. static struct rxrpc_call *rxrpc_alloc_client_call(struct sockaddr_rxrpc *srx,
  151. gfp_t gfp)
  152. {
  153. struct rxrpc_call *call;
  154. ktime_t now;
  155. _enter("");
  156. call = rxrpc_alloc_call(gfp);
  157. if (!call)
  158. return ERR_PTR(-ENOMEM);
  159. call->state = RXRPC_CALL_CLIENT_AWAIT_CONN;
  160. call->service_id = srx->srx_service;
  161. call->tx_phase = true;
  162. now = ktime_get_real();
  163. call->acks_latest_ts = now;
  164. call->cong_tstamp = now;
  165. _leave(" = %p", call);
  166. return call;
  167. }
  168. /*
  169. * Initiate the call ack/resend/expiry timer.
  170. */
  171. static void rxrpc_start_call_timer(struct rxrpc_call *call)
  172. {
  173. ktime_t now = ktime_get_real(), expire_at;
  174. expire_at = ktime_add_ms(now, rxrpc_max_call_lifetime);
  175. call->expire_at = expire_at;
  176. call->ack_at = expire_at;
  177. call->ping_at = expire_at;
  178. call->resend_at = expire_at;
  179. call->timer.expires = jiffies + LONG_MAX / 2;
  180. rxrpc_set_timer(call, rxrpc_timer_begin, now);
  181. }
  182. /*
  183. * set up a call for the given data
  184. * - called in process context with IRQs enabled
  185. */
  186. struct rxrpc_call *rxrpc_new_client_call(struct rxrpc_sock *rx,
  187. struct rxrpc_conn_parameters *cp,
  188. struct sockaddr_rxrpc *srx,
  189. unsigned long user_call_ID,
  190. gfp_t gfp)
  191. {
  192. struct rxrpc_call *call, *xcall;
  193. struct rb_node *parent, **pp;
  194. const void *here = __builtin_return_address(0);
  195. int ret;
  196. _enter("%p,%lx", rx, user_call_ID);
  197. call = rxrpc_alloc_client_call(srx, gfp);
  198. if (IS_ERR(call)) {
  199. _leave(" = %ld", PTR_ERR(call));
  200. return call;
  201. }
  202. trace_rxrpc_call(call, rxrpc_call_new_client, atomic_read(&call->usage),
  203. here, (const void *)user_call_ID);
  204. /* Publish the call, even though it is incompletely set up as yet */
  205. write_lock(&rx->call_lock);
  206. pp = &rx->calls.rb_node;
  207. parent = NULL;
  208. while (*pp) {
  209. parent = *pp;
  210. xcall = rb_entry(parent, struct rxrpc_call, sock_node);
  211. if (user_call_ID < xcall->user_call_ID)
  212. pp = &(*pp)->rb_left;
  213. else if (user_call_ID > xcall->user_call_ID)
  214. pp = &(*pp)->rb_right;
  215. else
  216. goto error_dup_user_ID;
  217. }
  218. rcu_assign_pointer(call->socket, rx);
  219. call->user_call_ID = user_call_ID;
  220. __set_bit(RXRPC_CALL_HAS_USERID, &call->flags);
  221. rxrpc_get_call(call, rxrpc_call_got_userid);
  222. rb_link_node(&call->sock_node, parent, pp);
  223. rb_insert_color(&call->sock_node, &rx->calls);
  224. list_add(&call->sock_link, &rx->sock_calls);
  225. write_unlock(&rx->call_lock);
  226. write_lock(&rxrpc_call_lock);
  227. list_add_tail(&call->link, &rxrpc_calls);
  228. write_unlock(&rxrpc_call_lock);
  229. /* Set up or get a connection record and set the protocol parameters,
  230. * including channel number and call ID.
  231. */
  232. ret = rxrpc_connect_call(call, cp, srx, gfp);
  233. if (ret < 0)
  234. goto error;
  235. trace_rxrpc_call(call, rxrpc_call_connected, atomic_read(&call->usage),
  236. here, NULL);
  237. spin_lock_bh(&call->conn->params.peer->lock);
  238. hlist_add_head(&call->error_link,
  239. &call->conn->params.peer->error_targets);
  240. spin_unlock_bh(&call->conn->params.peer->lock);
  241. rxrpc_start_call_timer(call);
  242. _net("CALL new %d on CONN %d", call->debug_id, call->conn->debug_id);
  243. _leave(" = %p [new]", call);
  244. return call;
  245. /* We unexpectedly found the user ID in the list after taking
  246. * the call_lock. This shouldn't happen unless the user races
  247. * with itself and tries to add the same user ID twice at the
  248. * same time in different threads.
  249. */
  250. error_dup_user_ID:
  251. write_unlock(&rx->call_lock);
  252. ret = -EEXIST;
  253. error:
  254. __rxrpc_set_call_completion(call, RXRPC_CALL_LOCAL_ERROR,
  255. RX_CALL_DEAD, ret);
  256. trace_rxrpc_call(call, rxrpc_call_error, atomic_read(&call->usage),
  257. here, ERR_PTR(ret));
  258. rxrpc_release_call(rx, call);
  259. rxrpc_put_call(call, rxrpc_call_put);
  260. _leave(" = %d", ret);
  261. return ERR_PTR(ret);
  262. }
  263. /*
  264. * Set up an incoming call. call->conn points to the connection.
  265. * This is called in BH context and isn't allowed to fail.
  266. */
  267. void rxrpc_incoming_call(struct rxrpc_sock *rx,
  268. struct rxrpc_call *call,
  269. struct sk_buff *skb)
  270. {
  271. struct rxrpc_connection *conn = call->conn;
  272. struct rxrpc_skb_priv *sp = rxrpc_skb(skb);
  273. u32 chan;
  274. _enter(",%d", call->conn->debug_id);
  275. rcu_assign_pointer(call->socket, rx);
  276. call->call_id = sp->hdr.callNumber;
  277. call->service_id = sp->hdr.serviceId;
  278. call->cid = sp->hdr.cid;
  279. call->state = RXRPC_CALL_SERVER_ACCEPTING;
  280. if (sp->hdr.securityIndex > 0)
  281. call->state = RXRPC_CALL_SERVER_SECURING;
  282. call->cong_tstamp = skb->tstamp;
  283. /* Set the channel for this call. We don't get channel_lock as we're
  284. * only defending against the data_ready handler (which we're called
  285. * from) and the RESPONSE packet parser (which is only really
  286. * interested in call_counter and can cope with a disagreement with the
  287. * call pointer).
  288. */
  289. chan = sp->hdr.cid & RXRPC_CHANNELMASK;
  290. conn->channels[chan].call_counter = call->call_id;
  291. conn->channels[chan].call_id = call->call_id;
  292. rcu_assign_pointer(conn->channels[chan].call, call);
  293. spin_lock(&conn->params.peer->lock);
  294. hlist_add_head(&call->error_link, &conn->params.peer->error_targets);
  295. spin_unlock(&conn->params.peer->lock);
  296. _net("CALL incoming %d on CONN %d", call->debug_id, call->conn->debug_id);
  297. rxrpc_start_call_timer(call);
  298. _leave("");
  299. }
  300. /*
  301. * Queue a call's work processor, getting a ref to pass to the work queue.
  302. */
  303. bool rxrpc_queue_call(struct rxrpc_call *call)
  304. {
  305. const void *here = __builtin_return_address(0);
  306. int n = __atomic_add_unless(&call->usage, 1, 0);
  307. if (n == 0)
  308. return false;
  309. if (rxrpc_queue_work(&call->processor))
  310. trace_rxrpc_call(call, rxrpc_call_queued, n + 1, here, NULL);
  311. else
  312. rxrpc_put_call(call, rxrpc_call_put_noqueue);
  313. return true;
  314. }
  315. /*
  316. * Queue a call's work processor, passing the callers ref to the work queue.
  317. */
  318. bool __rxrpc_queue_call(struct rxrpc_call *call)
  319. {
  320. const void *here = __builtin_return_address(0);
  321. int n = atomic_read(&call->usage);
  322. ASSERTCMP(n, >=, 1);
  323. if (rxrpc_queue_work(&call->processor))
  324. trace_rxrpc_call(call, rxrpc_call_queued_ref, n, here, NULL);
  325. else
  326. rxrpc_put_call(call, rxrpc_call_put_noqueue);
  327. return true;
  328. }
  329. /*
  330. * Note the re-emergence of a call.
  331. */
  332. void rxrpc_see_call(struct rxrpc_call *call)
  333. {
  334. const void *here = __builtin_return_address(0);
  335. if (call) {
  336. int n = atomic_read(&call->usage);
  337. trace_rxrpc_call(call, rxrpc_call_seen, n, here, NULL);
  338. }
  339. }
  340. /*
  341. * Note the addition of a ref on a call.
  342. */
  343. void rxrpc_get_call(struct rxrpc_call *call, enum rxrpc_call_trace op)
  344. {
  345. const void *here = __builtin_return_address(0);
  346. int n = atomic_inc_return(&call->usage);
  347. trace_rxrpc_call(call, op, n, here, NULL);
  348. }
  349. /*
  350. * Detach a call from its owning socket.
  351. */
  352. void rxrpc_release_call(struct rxrpc_sock *rx, struct rxrpc_call *call)
  353. {
  354. const void *here = __builtin_return_address(0);
  355. struct rxrpc_connection *conn = call->conn;
  356. bool put = false;
  357. int i;
  358. _enter("{%d,%d}", call->debug_id, atomic_read(&call->usage));
  359. trace_rxrpc_call(call, rxrpc_call_release, atomic_read(&call->usage),
  360. here, (const void *)call->flags);
  361. ASSERTCMP(call->state, ==, RXRPC_CALL_COMPLETE);
  362. spin_lock_bh(&call->lock);
  363. if (test_and_set_bit(RXRPC_CALL_RELEASED, &call->flags))
  364. BUG();
  365. spin_unlock_bh(&call->lock);
  366. del_timer_sync(&call->timer);
  367. /* Make sure we don't get any more notifications */
  368. write_lock_bh(&rx->recvmsg_lock);
  369. if (!list_empty(&call->recvmsg_link)) {
  370. _debug("unlinking once-pending call %p { e=%lx f=%lx }",
  371. call, call->events, call->flags);
  372. list_del(&call->recvmsg_link);
  373. put = true;
  374. }
  375. /* list_empty() must return false in rxrpc_notify_socket() */
  376. call->recvmsg_link.next = NULL;
  377. call->recvmsg_link.prev = NULL;
  378. write_unlock_bh(&rx->recvmsg_lock);
  379. if (put)
  380. rxrpc_put_call(call, rxrpc_call_put);
  381. write_lock(&rx->call_lock);
  382. if (test_and_clear_bit(RXRPC_CALL_HAS_USERID, &call->flags)) {
  383. rb_erase(&call->sock_node, &rx->calls);
  384. memset(&call->sock_node, 0xdd, sizeof(call->sock_node));
  385. rxrpc_put_call(call, rxrpc_call_put_userid);
  386. }
  387. list_del(&call->sock_link);
  388. write_unlock(&rx->call_lock);
  389. _debug("RELEASE CALL %p (%d CONN %p)", call, call->debug_id, conn);
  390. if (conn)
  391. rxrpc_disconnect_call(call);
  392. for (i = 0; i < RXRPC_RXTX_BUFF_SIZE; i++) {
  393. rxrpc_free_skb(call->rxtx_buffer[i],
  394. (call->tx_phase ? rxrpc_skb_tx_cleaned :
  395. rxrpc_skb_rx_cleaned));
  396. call->rxtx_buffer[i] = NULL;
  397. }
  398. _leave("");
  399. }
  400. /*
  401. * release all the calls associated with a socket
  402. */
  403. void rxrpc_release_calls_on_socket(struct rxrpc_sock *rx)
  404. {
  405. struct rxrpc_call *call;
  406. _enter("%p", rx);
  407. while (!list_empty(&rx->to_be_accepted)) {
  408. call = list_entry(rx->to_be_accepted.next,
  409. struct rxrpc_call, accept_link);
  410. list_del(&call->accept_link);
  411. rxrpc_abort_call("SKR", call, 0, RX_CALL_DEAD, ECONNRESET);
  412. rxrpc_put_call(call, rxrpc_call_put);
  413. }
  414. while (!list_empty(&rx->sock_calls)) {
  415. call = list_entry(rx->sock_calls.next,
  416. struct rxrpc_call, sock_link);
  417. rxrpc_get_call(call, rxrpc_call_got);
  418. rxrpc_abort_call("SKT", call, 0, RX_CALL_DEAD, ECONNRESET);
  419. rxrpc_send_abort_packet(call);
  420. rxrpc_release_call(rx, call);
  421. rxrpc_put_call(call, rxrpc_call_put);
  422. }
  423. _leave("");
  424. }
  425. /*
  426. * release a call
  427. */
  428. void rxrpc_put_call(struct rxrpc_call *call, enum rxrpc_call_trace op)
  429. {
  430. const void *here = __builtin_return_address(0);
  431. int n;
  432. ASSERT(call != NULL);
  433. n = atomic_dec_return(&call->usage);
  434. trace_rxrpc_call(call, op, n, here, NULL);
  435. ASSERTCMP(n, >=, 0);
  436. if (n == 0) {
  437. _debug("call %d dead", call->debug_id);
  438. ASSERTCMP(call->state, ==, RXRPC_CALL_COMPLETE);
  439. write_lock(&rxrpc_call_lock);
  440. list_del_init(&call->link);
  441. write_unlock(&rxrpc_call_lock);
  442. rxrpc_cleanup_call(call);
  443. }
  444. }
  445. /*
  446. * Final call destruction under RCU.
  447. */
  448. static void rxrpc_rcu_destroy_call(struct rcu_head *rcu)
  449. {
  450. struct rxrpc_call *call = container_of(rcu, struct rxrpc_call, rcu);
  451. rxrpc_put_peer(call->peer);
  452. kfree(call->rxtx_buffer);
  453. kfree(call->rxtx_annotations);
  454. kmem_cache_free(rxrpc_call_jar, call);
  455. }
  456. /*
  457. * clean up a call
  458. */
  459. void rxrpc_cleanup_call(struct rxrpc_call *call)
  460. {
  461. int i;
  462. _net("DESTROY CALL %d", call->debug_id);
  463. memset(&call->sock_node, 0xcd, sizeof(call->sock_node));
  464. del_timer_sync(&call->timer);
  465. ASSERTCMP(call->state, ==, RXRPC_CALL_COMPLETE);
  466. ASSERT(test_bit(RXRPC_CALL_RELEASED, &call->flags));
  467. ASSERTCMP(call->conn, ==, NULL);
  468. /* Clean up the Rx/Tx buffer */
  469. for (i = 0; i < RXRPC_RXTX_BUFF_SIZE; i++)
  470. rxrpc_free_skb(call->rxtx_buffer[i],
  471. (call->tx_phase ? rxrpc_skb_tx_cleaned :
  472. rxrpc_skb_rx_cleaned));
  473. rxrpc_free_skb(call->tx_pending, rxrpc_skb_tx_cleaned);
  474. call_rcu(&call->rcu, rxrpc_rcu_destroy_call);
  475. }
  476. /*
  477. * Make sure that all calls are gone.
  478. */
  479. void __exit rxrpc_destroy_all_calls(void)
  480. {
  481. struct rxrpc_call *call;
  482. _enter("");
  483. if (list_empty(&rxrpc_calls))
  484. return;
  485. write_lock(&rxrpc_call_lock);
  486. while (!list_empty(&rxrpc_calls)) {
  487. call = list_entry(rxrpc_calls.next, struct rxrpc_call, link);
  488. _debug("Zapping call %p", call);
  489. rxrpc_see_call(call);
  490. list_del_init(&call->link);
  491. pr_err("Call %p still in use (%d,%s,%lx,%lx)!\n",
  492. call, atomic_read(&call->usage),
  493. rxrpc_call_states[call->state],
  494. call->flags, call->events);
  495. write_unlock(&rxrpc_call_lock);
  496. cond_resched();
  497. write_lock(&rxrpc_call_lock);
  498. }
  499. write_unlock(&rxrpc_call_lock);
  500. }