mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
rxrpc: Add RCU destruction for connections and calls
Add RCU destruction for connections and calls as the RCU lookup from the transport socket data_ready handler is going to come along shortly. Whilst we're at it, move the cleanup workqueue flushing and RCU barrierage into the destruction code for the objects that need it (locals and connections) and add the extra RCU barrier required for connection cleanup. Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
parent
e653cfe49c
commit
dee46364ce
6 changed files with 60 additions and 36 deletions
|
@ -374,14 +374,17 @@ void __exit rxrpc_destroy_all_locals(void)
|
|||
|
||||
_enter("");
|
||||
|
||||
if (list_empty(&rxrpc_local_endpoints))
|
||||
return;
|
||||
flush_workqueue(rxrpc_workqueue);
|
||||
|
||||
mutex_lock(&rxrpc_local_mutex);
|
||||
list_for_each_entry(local, &rxrpc_local_endpoints, link) {
|
||||
pr_err("AF_RXRPC: Leaked local %p {%d}\n",
|
||||
local, atomic_read(&local->usage));
|
||||
if (!list_empty(&rxrpc_local_endpoints)) {
|
||||
mutex_lock(&rxrpc_local_mutex);
|
||||
list_for_each_entry(local, &rxrpc_local_endpoints, link) {
|
||||
pr_err("AF_RXRPC: Leaked local %p {%d}\n",
|
||||
local, atomic_read(&local->usage));
|
||||
}
|
||||
mutex_unlock(&rxrpc_local_mutex);
|
||||
BUG();
|
||||
}
|
||||
mutex_unlock(&rxrpc_local_mutex);
|
||||
BUG();
|
||||
|
||||
rcu_barrier();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue