Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2ded1f1

Browse files
committed
Adjust DSM and DSA slot usage constants (back-patch).
1. Previously, a DSA area would create up to four segments at each size before doubling the size. After this commit, it will create only two at each size, so it ramps up faster and therefore needs fewer slots. 2. Previously, the total limit on DSM slots allowed for 2 per connection. Switch to 5 per connection. This back-patches commit d061ea2 from release 13 into 10-12 based on a field complaint. Discussion: https://postgr.es/m/CAO03teA%2BjE1qt5iWDWzHqaufqBsF6EoOgZphnazps_tr_jDPZA%40mail.gmail.com Discussion: https://postgr.es/m/CA%2BhUKGL6H2BpGbiF7Lj6QiTjTGyTLW_vLR%3DSn2tEBeTcYXiMKw%40mail.gmail.com
1 parent 87ab464 commit 2ded1f1

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/backend/storage/ipc/dsm.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,8 @@
4545

4646
#define PG_DYNSHMEM_CONTROL_MAGIC 0x9a503d32
4747

48-
/*
49-
* There's no point in getting too cheap here, because the minimum allocation
50-
* is one OS page, which is probably at least 4KB and could easily be as high
51-
* as 64KB. Each currently sizeof(dsm_control_item), currently 8 bytes.
52-
*/
5348
#define PG_DYNSHMEM_FIXED_SLOTS 64
54-
#define PG_DYNSHMEM_SLOTS_PER_BACKEND 2
49+
#define PG_DYNSHMEM_SLOTS_PER_BACKEND 5
5550

5651
#define INVALID_CONTROL_SLOT ((uint32) -1)
5752

src/backend/utils/mmgr/dsa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
* dsm.c's limits on total number of segments), or limiting the total size
7575
* an area can manage when using small pointers.
7676
*/
77-
#define DSA_NUM_SEGMENTS_AT_EACH_SIZE 4
77+
#define DSA_NUM_SEGMENTS_AT_EACH_SIZE 2
7878

7979
/*
8080
* The number of bits used to represent the offset part of a dsa_pointer.

0 commit comments

Comments
 (0)