pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Avoid SIGBUS on Linux when a DSM memory request overruns tmpfs. 5+ messages / 1 participants [nested] [flat]
* pgsql: Avoid SIGBUS on Linux when a DSM memory request overruns tmpfs. @ 2017-09-25 20:09 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2017-09-25 20:09 UTC (permalink / raw) To: pgsql-committers Avoid SIGBUS on Linux when a DSM memory request overruns tmpfs. On Linux, shared memory segments created with shm_open() are backed by swap files created in tmpfs. If the swap file needs to be extended, but there's no tmpfs space left, you get a very unfriendly SIGBUS trap. To avoid this, force allocation of the full request size when we create the segment. This adds a few cycles, but none that we wouldn't expend later anyway, assuming the request isn't hugely bigger than the actual need. Make this code #ifdef __linux__, because (a) there's not currently a reason to think the same problem exists on other platforms, and (b) applying posix_fallocate() to an FD created by shm_open() isn't very portable anyway. Back-patch to 9.4 where the DSM code came in. Thomas Munro, per a bug report from Amul Sul Discussion: https://postgr.es/m/1002664500.12301802.1471008223422.JavaMail.yahoo@mail.yahoo.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/899bd785c0edf376077d3f5d65c316f92c1b64b5 Modified Files -------------- configure | 2 +- configure.in | 2 +- src/backend/storage/ipc/dsm_impl.c | 54 ++++++++++++++++++++++++++++++++++++-- src/include/pg_config.h.in | 3 +++ src/include/pg_config.h.win32 | 3 +++ 5 files changed, 60 insertions(+), 4 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Avoid SIGBUS on Linux when a DSM memory request overruns tmpfs. @ 2017-09-25 20:09 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2017-09-25 20:09 UTC (permalink / raw) To: pgsql-committers Avoid SIGBUS on Linux when a DSM memory request overruns tmpfs. On Linux, shared memory segments created with shm_open() are backed by swap files created in tmpfs. If the swap file needs to be extended, but there's no tmpfs space left, you get a very unfriendly SIGBUS trap. To avoid this, force allocation of the full request size when we create the segment. This adds a few cycles, but none that we wouldn't expend later anyway, assuming the request isn't hugely bigger than the actual need. Make this code #ifdef __linux__, because (a) there's not currently a reason to think the same problem exists on other platforms, and (b) applying posix_fallocate() to an FD created by shm_open() isn't very portable anyway. Back-patch to 9.4 where the DSM code came in. Thomas Munro, per a bug report from Amul Sul Discussion: https://postgr.es/m/1002664500.12301802.1471008223422.JavaMail.yahoo@mail.yahoo.com Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/4621c7f7a432fbb24b69c5cf0c877c17832c26ac Modified Files -------------- configure | 2 +- configure.in | 2 +- src/backend/storage/ipc/dsm_impl.c | 54 ++++++++++++++++++++++++++++++++++++-- src/include/pg_config.h.in | 3 +++ src/include/pg_config.h.win32 | 3 +++ 5 files changed, 60 insertions(+), 4 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Avoid SIGBUS on Linux when a DSM memory request overruns tmpfs. @ 2017-09-25 20:09 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2017-09-25 20:09 UTC (permalink / raw) To: pgsql-committers Avoid SIGBUS on Linux when a DSM memory request overruns tmpfs. On Linux, shared memory segments created with shm_open() are backed by swap files created in tmpfs. If the swap file needs to be extended, but there's no tmpfs space left, you get a very unfriendly SIGBUS trap. To avoid this, force allocation of the full request size when we create the segment. This adds a few cycles, but none that we wouldn't expend later anyway, assuming the request isn't hugely bigger than the actual need. Make this code #ifdef __linux__, because (a) there's not currently a reason to think the same problem exists on other platforms, and (b) applying posix_fallocate() to an FD created by shm_open() isn't very portable anyway. Back-patch to 9.4 where the DSM code came in. Thomas Munro, per a bug report from Amul Sul Discussion: https://postgr.es/m/1002664500.12301802.1471008223422.JavaMail.yahoo@mail.yahoo.com Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/1750612224704043218fac81e29c05d866e866ce Modified Files -------------- configure | 2 +- configure.in | 2 +- src/backend/storage/ipc/dsm_impl.c | 54 ++++++++++++++++++++++++++++++++++++-- src/include/pg_config.h.in | 3 +++ src/include/pg_config.h.win32 | 3 +++ 5 files changed, 60 insertions(+), 4 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Avoid SIGBUS on Linux when a DSM memory request overruns tmpfs. @ 2017-09-25 20:09 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2017-09-25 20:09 UTC (permalink / raw) To: pgsql-committers Avoid SIGBUS on Linux when a DSM memory request overruns tmpfs. On Linux, shared memory segments created with shm_open() are backed by swap files created in tmpfs. If the swap file needs to be extended, but there's no tmpfs space left, you get a very unfriendly SIGBUS trap. To avoid this, force allocation of the full request size when we create the segment. This adds a few cycles, but none that we wouldn't expend later anyway, assuming the request isn't hugely bigger than the actual need. Make this code #ifdef __linux__, because (a) there's not currently a reason to think the same problem exists on other platforms, and (b) applying posix_fallocate() to an FD created by shm_open() isn't very portable anyway. Back-patch to 9.4 where the DSM code came in. Thomas Munro, per a bug report from Amul Sul Discussion: https://postgr.es/m/1002664500.12301802.1471008223422.JavaMail.yahoo@mail.yahoo.com Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/05297416f362b50985b3cd3473778fbb0842295d Modified Files -------------- configure | 2 +- configure.in | 2 +- src/backend/storage/ipc/dsm_impl.c | 54 ++++++++++++++++++++++++++++++++++++-- src/include/pg_config.h.in | 3 +++ src/include/pg_config.h.win32 | 3 +++ 5 files changed, 60 insertions(+), 4 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Avoid SIGBUS on Linux when a DSM memory request overruns tmpfs. @ 2017-09-25 20:09 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2017-09-25 20:09 UTC (permalink / raw) To: pgsql-committers Avoid SIGBUS on Linux when a DSM memory request overruns tmpfs. On Linux, shared memory segments created with shm_open() are backed by swap files created in tmpfs. If the swap file needs to be extended, but there's no tmpfs space left, you get a very unfriendly SIGBUS trap. To avoid this, force allocation of the full request size when we create the segment. This adds a few cycles, but none that we wouldn't expend later anyway, assuming the request isn't hugely bigger than the actual need. Make this code #ifdef __linux__, because (a) there's not currently a reason to think the same problem exists on other platforms, and (b) applying posix_fallocate() to an FD created by shm_open() isn't very portable anyway. Back-patch to 9.4 where the DSM code came in. Thomas Munro, per a bug report from Amul Sul Discussion: https://postgr.es/m/1002664500.12301802.1471008223422.JavaMail.yahoo@mail.yahoo.com Branch ------ REL9_4_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/3a07a6f3e8d204e2141f09c20de4caecd998fa3f Modified Files -------------- configure | 2 +- configure.in | 2 +- src/backend/storage/ipc/dsm_impl.c | 54 ++++++++++++++++++++++++++++++++++++-- src/include/pg_config.h.in | 3 +++ src/include/pg_config.h.win32 | 3 +++ 5 files changed, 60 insertions(+), 4 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2017-09-25 20:09 UTC | newest] Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2017-09-25 20:09 pgsql: Avoid SIGBUS on Linux when a DSM memory request overruns tmpfs. Tom Lane <tgl@sss.pgh.pa.us> 2017-09-25 20:09 pgsql: Avoid SIGBUS on Linux when a DSM memory request overruns tmpfs. Tom Lane <tgl@sss.pgh.pa.us> 2017-09-25 20:09 pgsql: Avoid SIGBUS on Linux when a DSM memory request overruns tmpfs. Tom Lane <tgl@sss.pgh.pa.us> 2017-09-25 20:09 pgsql: Avoid SIGBUS on Linux when a DSM memory request overruns tmpfs. Tom Lane <tgl@sss.pgh.pa.us> 2017-09-25 20:09 pgsql: Avoid SIGBUS on Linux when a DSM memory request overruns tmpfs. Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox