rxrpc: Remove skb_count from struct rxrpc_call
Remove the sk_buff count from the rxrpc_call struct as it's less useful once we stop queueing sk_buffs. Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
Родитель
de8d6c7401
Коммит
2ab27215ea
|
@ -18,16 +18,14 @@
|
||||||
|
|
||||||
TRACE_EVENT(rxrpc_call,
|
TRACE_EVENT(rxrpc_call,
|
||||||
TP_PROTO(struct rxrpc_call *call, enum rxrpc_call_trace op,
|
TP_PROTO(struct rxrpc_call *call, enum rxrpc_call_trace op,
|
||||||
int usage, int nskb,
|
int usage, const void *where, const void *aux),
|
||||||
const void *where, const void *aux),
|
|
||||||
|
|
||||||
TP_ARGS(call, op, usage, nskb, where, aux),
|
TP_ARGS(call, op, usage, where, aux),
|
||||||
|
|
||||||
TP_STRUCT__entry(
|
TP_STRUCT__entry(
|
||||||
__field(struct rxrpc_call *, call )
|
__field(struct rxrpc_call *, call )
|
||||||
__field(int, op )
|
__field(int, op )
|
||||||
__field(int, usage )
|
__field(int, usage )
|
||||||
__field(int, nskb )
|
|
||||||
__field(const void *, where )
|
__field(const void *, where )
|
||||||
__field(const void *, aux )
|
__field(const void *, aux )
|
||||||
),
|
),
|
||||||
|
@ -36,16 +34,14 @@ TRACE_EVENT(rxrpc_call,
|
||||||
__entry->call = call;
|
__entry->call = call;
|
||||||
__entry->op = op;
|
__entry->op = op;
|
||||||
__entry->usage = usage;
|
__entry->usage = usage;
|
||||||
__entry->nskb = nskb;
|
|
||||||
__entry->where = where;
|
__entry->where = where;
|
||||||
__entry->aux = aux;
|
__entry->aux = aux;
|
||||||
),
|
),
|
||||||
|
|
||||||
TP_printk("c=%p %s u=%d s=%d p=%pSR a=%p",
|
TP_printk("c=%p %s u=%d sp=%pSR a=%p",
|
||||||
__entry->call,
|
__entry->call,
|
||||||
rxrpc_call_traces[__entry->op],
|
rxrpc_call_traces[__entry->op],
|
||||||
__entry->usage,
|
__entry->usage,
|
||||||
__entry->nskb,
|
|
||||||
__entry->where,
|
__entry->where,
|
||||||
__entry->aux)
|
__entry->aux)
|
||||||
);
|
);
|
||||||
|
|
|
@ -467,7 +467,6 @@ struct rxrpc_call {
|
||||||
enum rxrpc_call_state state; /* current state of call */
|
enum rxrpc_call_state state; /* current state of call */
|
||||||
enum rxrpc_call_completion completion; /* Call completion condition */
|
enum rxrpc_call_completion completion; /* Call completion condition */
|
||||||
atomic_t usage;
|
atomic_t usage;
|
||||||
atomic_t skb_count; /* Outstanding packets on this call */
|
|
||||||
atomic_t sequence; /* Tx data packet sequence counter */
|
atomic_t sequence; /* Tx data packet sequence counter */
|
||||||
u16 service_id; /* service ID */
|
u16 service_id; /* service ID */
|
||||||
u8 security_ix; /* Security type */
|
u8 security_ix; /* Security type */
|
||||||
|
|
|
@ -232,9 +232,8 @@ struct rxrpc_call *rxrpc_new_client_call(struct rxrpc_sock *rx,
|
||||||
return call;
|
return call;
|
||||||
}
|
}
|
||||||
|
|
||||||
trace_rxrpc_call(call, rxrpc_call_new_client,
|
trace_rxrpc_call(call, 0, atomic_read(&call->usage), here,
|
||||||
atomic_read(&call->usage), 0,
|
(const void *)user_call_ID);
|
||||||
here, (const void *)user_call_ID);
|
|
||||||
|
|
||||||
/* Publish the call, even though it is incompletely set up as yet */
|
/* Publish the call, even though it is incompletely set up as yet */
|
||||||
call->user_call_ID = user_call_ID;
|
call->user_call_ID = user_call_ID;
|
||||||
|
@ -325,7 +324,7 @@ struct rxrpc_call *rxrpc_incoming_call(struct rxrpc_sock *rx,
|
||||||
return ERR_PTR(-EBUSY);
|
return ERR_PTR(-EBUSY);
|
||||||
|
|
||||||
trace_rxrpc_call(candidate, rxrpc_call_new_service,
|
trace_rxrpc_call(candidate, rxrpc_call_new_service,
|
||||||
atomic_read(&candidate->usage), 0, here, NULL);
|
atomic_read(&candidate->usage), here, NULL);
|
||||||
|
|
||||||
chan = sp->hdr.cid & RXRPC_CHANNELMASK;
|
chan = sp->hdr.cid & RXRPC_CHANNELMASK;
|
||||||
candidate->conn = conn;
|
candidate->conn = conn;
|
||||||
|
@ -446,11 +445,10 @@ bool rxrpc_queue_call(struct rxrpc_call *call)
|
||||||
{
|
{
|
||||||
const void *here = __builtin_return_address(0);
|
const void *here = __builtin_return_address(0);
|
||||||
int n = __atomic_add_unless(&call->usage, 1, 0);
|
int n = __atomic_add_unless(&call->usage, 1, 0);
|
||||||
int m = atomic_read(&call->skb_count);
|
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
return false;
|
return false;
|
||||||
if (rxrpc_queue_work(&call->processor))
|
if (rxrpc_queue_work(&call->processor))
|
||||||
trace_rxrpc_call(call, rxrpc_call_queued, n + 1, m, here, NULL);
|
trace_rxrpc_call(call, rxrpc_call_queued, n + 1, here, NULL);
|
||||||
else
|
else
|
||||||
rxrpc_put_call(call, rxrpc_call_put_noqueue);
|
rxrpc_put_call(call, rxrpc_call_put_noqueue);
|
||||||
return true;
|
return true;
|
||||||
|
@ -463,10 +461,9 @@ bool __rxrpc_queue_call(struct rxrpc_call *call)
|
||||||
{
|
{
|
||||||
const void *here = __builtin_return_address(0);
|
const void *here = __builtin_return_address(0);
|
||||||
int n = atomic_read(&call->usage);
|
int n = atomic_read(&call->usage);
|
||||||
int m = atomic_read(&call->skb_count);
|
|
||||||
ASSERTCMP(n, >=, 1);
|
ASSERTCMP(n, >=, 1);
|
||||||
if (rxrpc_queue_work(&call->processor))
|
if (rxrpc_queue_work(&call->processor))
|
||||||
trace_rxrpc_call(call, rxrpc_call_queued_ref, n, m, here, NULL);
|
trace_rxrpc_call(call, rxrpc_call_queued_ref, n, here, NULL);
|
||||||
else
|
else
|
||||||
rxrpc_put_call(call, rxrpc_call_put_noqueue);
|
rxrpc_put_call(call, rxrpc_call_put_noqueue);
|
||||||
return true;
|
return true;
|
||||||
|
@ -480,9 +477,8 @@ void rxrpc_see_call(struct rxrpc_call *call)
|
||||||
const void *here = __builtin_return_address(0);
|
const void *here = __builtin_return_address(0);
|
||||||
if (call) {
|
if (call) {
|
||||||
int n = atomic_read(&call->usage);
|
int n = atomic_read(&call->usage);
|
||||||
int m = atomic_read(&call->skb_count);
|
|
||||||
|
|
||||||
trace_rxrpc_call(call, rxrpc_call_seen, n, m, here, NULL);
|
trace_rxrpc_call(call, rxrpc_call_seen, n, here, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -493,9 +489,8 @@ void rxrpc_get_call(struct rxrpc_call *call, enum rxrpc_call_trace op)
|
||||||
{
|
{
|
||||||
const void *here = __builtin_return_address(0);
|
const void *here = __builtin_return_address(0);
|
||||||
int n = atomic_inc_return(&call->usage);
|
int n = atomic_inc_return(&call->usage);
|
||||||
int m = atomic_read(&call->skb_count);
|
|
||||||
|
|
||||||
trace_rxrpc_call(call, op, n, m, here, NULL);
|
trace_rxrpc_call(call, op, n, here, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -505,9 +500,8 @@ void rxrpc_get_call_for_skb(struct rxrpc_call *call, struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
const void *here = __builtin_return_address(0);
|
const void *here = __builtin_return_address(0);
|
||||||
int n = atomic_inc_return(&call->usage);
|
int n = atomic_inc_return(&call->usage);
|
||||||
int m = atomic_inc_return(&call->skb_count);
|
|
||||||
|
|
||||||
trace_rxrpc_call(call, rxrpc_call_got_skb, n, m, here, skb);
|
trace_rxrpc_call(call, rxrpc_call_got_skb, n, here, skb);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -642,17 +636,15 @@ void rxrpc_release_calls_on_socket(struct rxrpc_sock *rx)
|
||||||
void rxrpc_put_call(struct rxrpc_call *call, enum rxrpc_call_trace op)
|
void rxrpc_put_call(struct rxrpc_call *call, enum rxrpc_call_trace op)
|
||||||
{
|
{
|
||||||
const void *here = __builtin_return_address(0);
|
const void *here = __builtin_return_address(0);
|
||||||
int n, m;
|
int n;
|
||||||
|
|
||||||
ASSERT(call != NULL);
|
ASSERT(call != NULL);
|
||||||
|
|
||||||
n = atomic_dec_return(&call->usage);
|
n = atomic_dec_return(&call->usage);
|
||||||
m = atomic_read(&call->skb_count);
|
trace_rxrpc_call(call, op, n, here, NULL);
|
||||||
trace_rxrpc_call(call, op, n, m, here, NULL);
|
|
||||||
ASSERTCMP(n, >=, 0);
|
ASSERTCMP(n, >=, 0);
|
||||||
if (n == 0) {
|
if (n == 0) {
|
||||||
_debug("call %d dead", call->debug_id);
|
_debug("call %d dead", call->debug_id);
|
||||||
WARN_ON(m != 0);
|
|
||||||
rxrpc_cleanup_call(call);
|
rxrpc_cleanup_call(call);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -663,15 +655,13 @@ void rxrpc_put_call(struct rxrpc_call *call, enum rxrpc_call_trace op)
|
||||||
void rxrpc_put_call_for_skb(struct rxrpc_call *call, struct sk_buff *skb)
|
void rxrpc_put_call_for_skb(struct rxrpc_call *call, struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
const void *here = __builtin_return_address(0);
|
const void *here = __builtin_return_address(0);
|
||||||
int n, m;
|
int n;
|
||||||
|
|
||||||
n = atomic_dec_return(&call->usage);
|
n = atomic_dec_return(&call->usage);
|
||||||
m = atomic_dec_return(&call->skb_count);
|
trace_rxrpc_call(call, rxrpc_call_put_skb, n, here, skb);
|
||||||
trace_rxrpc_call(call, rxrpc_call_put_skb, n, m, here, skb);
|
|
||||||
ASSERTCMP(n, >=, 0);
|
ASSERTCMP(n, >=, 0);
|
||||||
if (n == 0) {
|
if (n == 0) {
|
||||||
_debug("call %d dead", call->debug_id);
|
_debug("call %d dead", call->debug_id);
|
||||||
WARN_ON(m != 0);
|
|
||||||
rxrpc_cleanup_call(call);
|
rxrpc_cleanup_call(call);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче