Commit 4f54dff
pppoe: drop sock reference counting on fast path
Now that PPPoE sockets are freed via RCU (SOCK_RCU_FREE), it is no longer
necessary to take a reference count when looking up sockets on the receive
path. Readers are protected by RCU, so the socket memory remains valid
until after a grace period.
Convert fast-path lookups to avoid refcounting:
- Replace get_item() and sk_receive_skb() in pppoe_rcv() with
__get_item() and __sk_receive_skb().
- Rework get_item_by_addr() into __get_item_by_addr() (no refcount and
move RCU lock into pppoe_ioctl)
- Remove unnecessary sock_put() calls.
This avoids cacheline bouncing from atomic reference counting and improves
performance on the receive fast path.
Signed-off-by: Qingfang Deng <[email protected]>
Reviewed-by: Eric Dumazet <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>1 parent 72cdc67 commit 4f54dff
1 file changed
+13
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | | - | |
241 | | - | |
| 240 | + | |
| 241 | + | |
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
250 | 249 | | |
251 | 250 | | |
252 | 251 | | |
253 | 252 | | |
254 | | - | |
255 | | - | |
| 253 | + | |
| 254 | + | |
256 | 255 | | |
257 | | - | |
258 | 256 | | |
259 | 257 | | |
260 | 258 | | |
| |||
381 | 379 | | |
382 | 380 | | |
383 | 381 | | |
384 | | - | |
385 | | - | |
| 382 | + | |
| 383 | + | |
386 | 384 | | |
387 | 385 | | |
388 | 386 | | |
389 | 387 | | |
390 | | - | |
| 388 | + | |
391 | 389 | | |
392 | 390 | | |
393 | | - | |
394 | | - | |
395 | | - | |
| 391 | + | |
396 | 392 | | |
397 | 393 | | |
398 | 394 | | |
399 | 395 | | |
400 | 396 | | |
401 | 397 | | |
402 | 398 | | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | 399 | | |
407 | 400 | | |
408 | 401 | | |
| |||
447 | 440 | | |
448 | 441 | | |
449 | 442 | | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
| 443 | + | |
454 | 444 | | |
455 | 445 | | |
456 | 446 | | |
457 | | - | |
| 447 | + | |
458 | 448 | | |
459 | 449 | | |
460 | 450 | | |
| |||
820 | 810 | | |
821 | 811 | | |
822 | 812 | | |
823 | | - | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
824 | 816 | | |
825 | 817 | | |
826 | 818 | | |
827 | | - | |
828 | 819 | | |
829 | 820 | | |
830 | 821 | | |
| |||
0 commit comments