Commit 95fa788
inet_diag: avoid cache line misses in inet_diag_bc_sk()
inet_diag_bc_sk() pulls five cache lines per socket,
while most filters only need the two first ones.
Add three booleans to struct inet_diag_dump_data,
that are selectively set if a filter needs specific socket fields.
- mark_needed /* INET_DIAG_BC_MARK_COND present. */
- cgroup_needed /* INET_DIAG_BC_CGROUP_COND present. */
- userlocks_needed /* INET_DIAG_BC_AUTO present. */
This removes millions of cache lines misses per ss invocation
when simple filters are specified on busy servers.
offsetof(struct sock, sk_userlocks) = 0xf3
offsetof(struct sock, sk_mark) = 0x20c
offsetof(struct sock, sk_cgrp_data) = 0x298
Signed-off-by: Eric Dumazet <[email protected]>
Reviewed-by: Kuniyuki Iwashima <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>1 parent 9529320 commit 95fa788
2 files changed
+36
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
617 | 620 | | |
618 | | - | |
619 | | - | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
620 | 624 | | |
621 | 625 | | |
622 | 626 | | |
| |||
716 | 720 | | |
717 | 721 | | |
718 | 722 | | |
719 | | - | |
| 723 | + | |
720 | 724 | | |
721 | 725 | | |
722 | | - | |
| 726 | + | |
723 | 727 | | |
724 | 728 | | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
725 | 733 | | |
726 | | - | |
| 734 | + | |
727 | 735 | | |
728 | 736 | | |
| 737 | + | |
729 | 738 | | |
730 | 739 | | |
731 | 740 | | |
| |||
757 | 766 | | |
758 | 767 | | |
759 | 768 | | |
| 769 | + | |
760 | 770 | | |
761 | 771 | | |
762 | 772 | | |
763 | 773 | | |
764 | 774 | | |
| 775 | + | |
765 | 776 | | |
766 | 777 | | |
767 | 778 | | |
| 779 | + | |
| 780 | + | |
768 | 781 | | |
769 | 782 | | |
770 | 783 | | |
| |||
841 | 854 | | |
842 | 855 | | |
843 | 856 | | |
844 | | - | |
845 | | - | |
846 | | - | |
847 | | - | |
848 | | - | |
849 | | - | |
850 | | - | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
851 | 861 | | |
852 | 862 | | |
853 | 863 | | |
| |||
0 commit comments