Repository navigation
Commit 605c0ac
sctp: count both sk and asoc sndbuf with skb truesize and sctp_chunk size
Now it's confusing that asoc sndbuf_used is doing memory accounting with
SCTP_DATA_SNDSIZE(chunk) + sizeof(sk_buff) + sizeof(sctp_chunk) while sk
sk_wmem_alloc is doing that with skb->truesize + sizeof(sctp_chunk).
It also causes sctp_prsctp_prune to count with a wrong freed memory when
sndbuf_policy is not set.
To make this right and also keep consistent between asoc sndbuf_used, sk
sk_wmem_alloc and sk_wmem_queued, use skb->truesize + sizeof(sctp_chunk)
for them.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent 2d0f0ca commit 605c0ac
3 files changed
Lines changed: 8 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | 151 | | |
157 | 152 | | |
158 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
388 | | - | |
389 | | - | |
390 | | - | |
| 388 | + | |
391 | 389 | | |
392 | 390 | | |
393 | 391 | | |
| |||
421 | 419 | | |
422 | 420 | | |
423 | 421 | | |
424 | | - | |
425 | | - | |
426 | | - | |
| 422 | + | |
427 | 423 | | |
428 | 424 | | |
429 | 425 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | 169 | | |
174 | | - | |
| 170 | + | |
| 171 | + | |
175 | 172 | | |
176 | 173 | | |
177 | 174 | | |
| |||
8460 | 8457 | | |
8461 | 8458 | | |
8462 | 8459 | | |
8463 | | - | |
8464 | | - | |
8465 | | - | |
8466 | | - | |
8467 | | - | |
8468 | | - | |
8469 | | - | |
8470 | | - | |
8471 | | - | |
8472 | | - | |
8473 | 8460 | | |
| 8461 | + | |
| 8462 | + | |
| 8463 | + | |
| 8464 | + | |
8474 | 8465 | | |
8475 | 8466 | | |
8476 | 8467 | | |
| |||
0 commit comments