- Notifications
You must be signed in to change notification settings - Fork5
Commit38628db
committed
Add memory barriers for PgBackendStatus.st_changecount protocol.
st_changecount protocol needs the memory barriers to ensure thatthe apparent order of execution is as it desires. Otherwise,for example, the CPU might rearrange the code so that st_changecountis incremented twice before the modification on a machine withweak memory ordering. This surprising result can lead to bugs.This commit introduces the macros to load and store st_changecountwith the memory barriers. These are called before and afterPgBackendStatus entries are modified or copied into private memory,in order to prevent CPU from reordering PgBackendStatus access.Per discussion on pgsql-hackers, we decided not to back-patch thisto 9.4 or before until we get an actual bug report about this.Patch by me. Review by Robert Haas.1 parent19e065c commit38628db
2 files changed
+71
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2563 | 2563 | | |
2564 | 2564 | | |
2565 | 2565 | | |
2566 | | - | |
| 2566 | + | |
2567 | 2567 | | |
2568 | 2568 | | |
2569 | 2569 | | |
| |||
2588 | 2588 | | |
2589 | 2589 | | |
2590 | 2590 | | |
2591 | | - | |
2592 | | - | |
| 2591 | + | |
2593 | 2592 | | |
2594 | 2593 | | |
2595 | 2594 | | |
| |||
2624 | 2623 | | |
2625 | 2624 | | |
2626 | 2625 | | |
2627 | | - | |
| 2626 | + | |
2628 | 2627 | | |
2629 | 2628 | | |
2630 | 2629 | | |
2631 | | - | |
2632 | | - | |
| 2630 | + | |
2633 | 2631 | | |
2634 | 2632 | | |
2635 | 2633 | | |
| |||
2666 | 2664 | | |
2667 | 2665 | | |
2668 | 2666 | | |
2669 | | - | |
| 2667 | + | |
2670 | 2668 | | |
2671 | 2669 | | |
2672 | 2670 | | |
2673 | 2671 | | |
2674 | 2672 | | |
2675 | 2673 | | |
2676 | 2674 | | |
2677 | | - | |
2678 | | - | |
| 2675 | + | |
2679 | 2676 | | |
2680 | 2677 | | |
2681 | 2678 | | |
| |||
2695 | 2692 | | |
2696 | 2693 | | |
2697 | 2694 | | |
2698 | | - | |
| 2695 | + | |
2699 | 2696 | | |
2700 | 2697 | | |
2701 | 2698 | | |
| |||
2707 | 2704 | | |
2708 | 2705 | | |
2709 | 2706 | | |
2710 | | - | |
2711 | | - | |
| 2707 | + | |
2712 | 2708 | | |
2713 | 2709 | | |
2714 | 2710 | | |
| |||
2734 | 2730 | | |
2735 | 2731 | | |
2736 | 2732 | | |
2737 | | - | |
| 2733 | + | |
2738 | 2734 | | |
2739 | 2735 | | |
2740 | 2736 | | |
2741 | 2737 | | |
2742 | | - | |
2743 | | - | |
| 2738 | + | |
2744 | 2739 | | |
2745 | 2740 | | |
2746 | 2741 | | |
| |||
2760 | 2755 | | |
2761 | 2756 | | |
2762 | 2757 | | |
2763 | | - | |
| 2758 | + | |
2764 | 2759 | | |
2765 | | - | |
2766 | | - | |
| 2760 | + | |
2767 | 2761 | | |
2768 | 2762 | | |
2769 | 2763 | | |
| |||
2839 | 2833 | | |
2840 | 2834 | | |
2841 | 2835 | | |
2842 | | - | |
| 2836 | + | |
| 2837 | + | |
| 2838 | + | |
| 2839 | + | |
2843 | 2840 | | |
2844 | 2841 | | |
2845 | 2842 | | |
| |||
2856 | 2853 | | |
2857 | 2854 | | |
2858 | 2855 | | |
2859 | | - | |
2860 | | - | |
| 2856 | + | |
| 2857 | + | |
| 2858 | + | |
2861 | 2859 | | |
2862 | 2860 | | |
2863 | 2861 | | |
| |||
2927 | 2925 | | |
2928 | 2926 | | |
2929 | 2927 | | |
2930 | | - | |
| 2928 | + | |
| 2929 | + | |
| 2930 | + | |
| 2931 | + | |
2931 | 2932 | | |
2932 | 2933 | | |
2933 | 2934 | | |
2934 | | - | |
2935 | | - | |
| 2935 | + | |
| 2936 | + | |
| 2937 | + | |
| 2938 | + | |
2936 | 2939 | | |
2937 | 2940 | | |
2938 | 2941 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
714 | 715 | | |
715 | 716 | | |
716 | 717 | | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
717 | 724 | | |
718 | 725 | | |
719 | 726 | | |
| |||
745 | 752 | | |
746 | 753 | | |
747 | 754 | | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
748 | 792 | | |
749 | 793 | | |
750 | 794 | | |
| |||
0 commit comments
Comments
(0)