Commit d4e71df
committed
Add io_direct setting (developer-only).
Provide a way to ask the kernel to use O_DIRECT (or local equivalent)
where available for data and WAL files, to avoid or minimize kernel
caching. This hurts performance currently and is not intended for end
users yet. Later proposed work would introduce our own I/O clustering,
read-ahead, etc to replace the facilities the kernel disables with this
option.
The only user-visible change, if the developer-only GUC is not used, is
that this commit also removes the obscure logic that would activate
O_DIRECT for the WAL when wal_sync_method=open_[data]sync and
wal_level=minimal (which also requires max_wal_senders=0). Those are
non-default and unlikely settings, and this behavior wasn't (correctly)
documented. The same effect can be achieved with io_direct=wal.
Author: Thomas Munro <thomas.munro@gmail.com>
Author: Andres Freund <andres@anarazel.de>
Author: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Reviewed-by: Justin Pryzby <pryzby@telsasoft.com>
Reviewed-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Discussion: https://postgr.es/m/CA%2BhUKGK1X532hYqJ_MzFWt0n1zt8trz980D79WbjwnT-yYLZpg%40mail.gmail.com1 parent faeedbc commit d4e71df
File tree
14 files changed
+263
-35
lines changed- doc/src/sgml
- src
- backend
- access/transam
- storage
- buffer
- file
- smgr
- utils/misc
- include
- storage
- utils
- test/modules/test_misc
- t
14 files changed
+263
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3172 | 3172 | | |
3173 | 3173 | | |
3174 | 3174 | | |
3175 | | - | |
3176 | 3175 | | |
3177 | 3176 | | |
3178 | 3177 | | |
| |||
11256 | 11255 | | |
11257 | 11256 | | |
11258 | 11257 | | |
| 11258 | + | |
| 11259 | + | |
| 11260 | + | |
| 11261 | + | |
| 11262 | + | |
| 11263 | + | |
| 11264 | + | |
| 11265 | + | |
| 11266 | + | |
| 11267 | + | |
| 11268 | + | |
| 11269 | + | |
| 11270 | + | |
| 11271 | + | |
| 11272 | + | |
| 11273 | + | |
| 11274 | + | |
| 11275 | + | |
| 11276 | + | |
| 11277 | + | |
| 11278 | + | |
| 11279 | + | |
| 11280 | + | |
| 11281 | + | |
| 11282 | + | |
| 11283 | + | |
| 11284 | + | |
| 11285 | + | |
| 11286 | + | |
| 11287 | + | |
| 11288 | + | |
| 11289 | + | |
11259 | 11290 | | |
11260 | 11291 | | |
11261 | 11292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2926 | 2926 | | |
2927 | 2927 | | |
2928 | 2928 | | |
| 2929 | + | |
2929 | 2930 | | |
2930 | 2931 | | |
2931 | 2932 | | |
| |||
2959 | 2960 | | |
2960 | 2961 | | |
2961 | 2962 | | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
2962 | 2966 | | |
2963 | | - | |
| 2967 | + | |
2964 | 2968 | | |
2965 | 2969 | | |
2966 | 2970 | | |
| |||
3354 | 3358 | | |
3355 | 3359 | | |
3356 | 3360 | | |
3357 | | - | |
| 3361 | + | |
3358 | 3362 | | |
3359 | 3363 | | |
3360 | 3364 | | |
| |||
4445 | 4449 | | |
4446 | 4450 | | |
4447 | 4451 | | |
4448 | | - | |
4449 | 4452 | | |
4450 | 4453 | | |
4451 | 4454 | | |
| |||
8029 | 8032 | | |
8030 | 8033 | | |
8031 | 8034 | | |
8032 | | - | |
8033 | | - | |
| 8035 | + | |
| 8036 | + | |
8034 | 8037 | | |
8035 | 8038 | | |
8036 | 8039 | | |
8037 | 8040 | | |
8038 | 8041 | | |
8039 | 8042 | | |
8040 | | - | |
8041 | | - | |
8042 | | - | |
8043 | | - | |
8044 | 8043 | | |
8045 | | - | |
8046 | | - | |
8047 | | - | |
8048 | | - | |
8049 | | - | |
8050 | | - | |
8051 | | - | |
8052 | | - | |
8053 | | - | |
| 8044 | + | |
8054 | 8045 | | |
8055 | | - | |
| 8046 | + | |
8056 | 8047 | | |
8057 | 8048 | | |
8058 | | - | |
| 8049 | + | |
8059 | 8050 | | |
8060 | 8051 | | |
| 8052 | + | |
| 8053 | + | |
| 8054 | + | |
| 8055 | + | |
8061 | 8056 | | |
8062 | 8057 | | |
8063 | 8058 | | |
| |||
8069 | 8064 | | |
8070 | 8065 | | |
8071 | 8066 | | |
8072 | | - | |
| 8067 | + | |
8073 | 8068 | | |
8074 | 8069 | | |
8075 | 8070 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
785 | 785 | | |
786 | 786 | | |
787 | 787 | | |
788 | | - | |
| 788 | + | |
789 | 789 | | |
790 | 790 | | |
791 | 791 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
541 | 541 | | |
542 | 542 | | |
543 | 543 | | |
544 | | - | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
545 | 547 | | |
| 548 | + | |
546 | 549 | | |
547 | 550 | | |
548 | 551 | | |
| |||
588 | 591 | | |
589 | 592 | | |
590 | 593 | | |
591 | | - | |
| 594 | + | |
592 | 595 | | |
593 | | - | |
594 | | - | |
595 | | - | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
596 | 599 | | |
597 | 600 | | |
598 | 601 | | |
| |||
5440 | 5443 | | |
5441 | 5444 | | |
5442 | 5445 | | |
| 5446 | + | |
| 5447 | + | |
| 5448 | + | |
5443 | 5449 | | |
5444 | 5450 | | |
5445 | 5451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
97 | 100 | | |
98 | 101 | | |
99 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
101 | 102 | | |
| 103 | + | |
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
| |||
162 | 164 | | |
163 | 165 | | |
164 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
165 | 170 | | |
166 | 171 | | |
167 | 172 | | |
| |||
2022 | 2027 | | |
2023 | 2028 | | |
2024 | 2029 | | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
2025 | 2033 | | |
2026 | 2034 | | |
2027 | 2035 | | |
| |||
3826 | 3834 | | |
3827 | 3835 | | |
3828 | 3836 | | |
| 3837 | + | |
| 3838 | + | |
| 3839 | + | |
| 3840 | + | |
| 3841 | + | |
| 3842 | + | |
| 3843 | + | |
| 3844 | + | |
| 3845 | + | |
| 3846 | + | |
| 3847 | + | |
| 3848 | + | |
| 3849 | + | |
| 3850 | + | |
| 3851 | + | |
| 3852 | + | |
| 3853 | + | |
| 3854 | + | |
| 3855 | + | |
| 3856 | + | |
| 3857 | + | |
| 3858 | + | |
| 3859 | + | |
| 3860 | + | |
| 3861 | + | |
| 3862 | + | |
| 3863 | + | |
| 3864 | + | |
| 3865 | + | |
| 3866 | + | |
| 3867 | + | |
| 3868 | + | |
| 3869 | + | |
| 3870 | + | |
| 3871 | + | |
| 3872 | + | |
| 3873 | + | |
| 3874 | + | |
| 3875 | + | |
| 3876 | + | |
| 3877 | + | |
| 3878 | + | |
| 3879 | + | |
| 3880 | + | |
| 3881 | + | |
| 3882 | + | |
| 3883 | + | |
| 3884 | + | |
| 3885 | + | |
| 3886 | + | |
| 3887 | + | |
| 3888 | + | |
| 3889 | + | |
| 3890 | + | |
| 3891 | + | |
| 3892 | + | |
| 3893 | + | |
| 3894 | + | |
| 3895 | + | |
| 3896 | + | |
| 3897 | + | |
| 3898 | + | |
| 3899 | + | |
| 3900 | + | |
| 3901 | + | |
| 3902 | + | |
| 3903 | + | |
| 3904 | + | |
| 3905 | + | |
| 3906 | + | |
| 3907 | + | |
| 3908 | + | |
| 3909 | + | |
| 3910 | + | |
| 3911 | + | |
| 3912 | + | |
| 3913 | + | |
| 3914 | + | |
| 3915 | + | |
| 3916 | + | |
| 3917 | + | |
| 3918 | + | |
| 3919 | + | |
| 3920 | + | |
| 3921 | + | |
| 3922 | + | |
| 3923 | + | |
| 3924 | + | |
| 3925 | + | |
| 3926 | + | |
0 commit comments