public inbox for [email protected]
help / color / mirror / Atom feedFrom: Srirama Kucherlapati <[email protected]>
To: Heikki Linnakangas <[email protected]>
To: [email protected] <[email protected]>
Cc: Robert Haas <[email protected]>
Cc: Bruce Momjian <[email protected]>
Cc: Peter Eisentraut <[email protected]>
Cc: Alvaro Herrera <[email protected]>
Cc: Laurenz Albe <[email protected]>
Cc: Noah Misch <[email protected]>
Cc: Michael Paquier <[email protected]>
Cc: Andres Freund <[email protected]>
Cc: Thomas Munro <[email protected]>
Cc: [email protected] <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Tristan Partin <[email protected]>
Cc: wenhui qiu <[email protected]>
Cc: [email protected] <[email protected]>
Subject: RE: AIX support
Date: Tue, 15 Apr 2025 16:20:41 +0000
Message-ID: <CY8PR15MB5602FE7D86B5C56CBF3E0268DBB22@CY8PR15MB5602.namprd15.prod.outlook.com> (raw)
In-Reply-To: <CY8PR15MB5602357AD26C9BD7C612A9E8DBB12@CY8PR15MB5602.namprd15.prod.outlook.com>
References: <CY5PR11MB639218D04CFAED0FC09ED9DFFDED2@CY5PR11MB6392.namprd11.prod.outlook.com>
<CY8PR15MB56026092DF51E9D300557B5ADB022@CY8PR15MB5602.namprd15.prod.outlook.com>
<[email protected]>
<CY8PR15MB56027303B385970CEBF22107DBF12@CY8PR15MB5602.namprd15.prod.outlook.com>
<CY8PR15MB5602D669251C0A50BA018C96DBD52@CY8PR15MB5602.namprd15.prod.outlook.com>
<CA+TgmoZf2nGA5QJFreLFmeWngvZdbCcZR7aw00vxnwr0mCiK4A@mail.gmail.com>
<DS0PR15MB56239360EB759C70AC514845DBDF2@DS0PR15MB5623.namprd15.prod.outlook.com>
<CAGjGUAJxeYgZR1JLs3o3Lc6wsmDiHK5s3OAq8obJnk+9c9nE0g@mail.gmail.com>
<CY8PR15MB560263740FABD624904C4923DBAE2@CY8PR15MB5602.namprd15.prod.outlook.com>
<[email protected]>
<CY8PR15MB56020EB4076E7AACBE4A78A7DBA92@CY8PR15MB5602.namprd15.prod.outlook.com>
<[email protected]>
<CY8PR15MB5602EADE20375FB66090B61BDBA82@CY8PR15MB5602.namprd15.prod.outlook.com>
<[email protected]>
<CY8PR15MB5602357AD26C9BD7C612A9E8DBB12@CY8PR15MB5602.namprd15.prod.outlook.com>
Hi Team, Please find the attached diff with the latest changes.
The diff file changes that were done for memset and spinlock, are modified
on top of the previous patch.
New changes for review: 0001-AIX-support.tas.memset.diffs
Previous patch: 0001-AIX-support.v8.patch
>> diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
>
We have replaced the asm code with the gcc specific routines __sync_lock_test_and_set ()
and ran the pgbench. On AIX both have the similar performance, On PPcle we see a slight
variation in the performance. It seems the asm code is performing better on PPCle. Please
let us know, would it be better to continue to use the PPC assemble code over gcc routines.
Attached are the complete stats. (spinlock.stats.log)
Below is the summary…
AIX With asm AIX With __sync PPCle With asm PPCle With __sync
number of transactions "226554/ "230810/ "356945/ "364346/
above the 10.0 ms 556329 567936 918647 863937
latency limit (40.723%)" (40.640%)" (38.856%)" (42.173%)"
latency average 16.160 ms 15.821 ms 9.796 ms 10.416 ms
initial connection time 230.786 ms 249.668 ms 19.606 ms 20.090 ms
tps 3086.209412 3158.14915 5103.024267 4799.621896
> diff --git a/src/makefiles/Makefile.aix b/src/makefiles/Makefile.aix
>
> At least it needs to be updated to match what MemSet() looks like
> nowadays. The changes may be just cosmetic, but better check. Should
> also check the effect on MemSetAligned(). That might matter more for
> performance in practice.
As per the stats in the previous mail wrt to memset, both the loop and the native
memset are performing similar after optimization “-O2”. So for now we removed the
native memset changes.
We will setup the memset performance on different platforms and will post the
details in a different thread.
>>> +# -blibpath must contain ALL directories where we should look for libraries
>>> +libpath := $(shell echo $(subst -L,:,$(filter -L/%,$(LDFLAGS))) | sed -e's/ //g'):/usr/lib:/lib
>
Added additional details about the -blibpath usage. These details are available in the below link
https://download.boulder.ibm.com/ibmdl/pub/software/dw/aix/es-aix_ll.pdf
> 21 -- test overflow/underflow handling
>
> 22 SELECT gamma(float8 '-infinity');
>
> 23 ERROR: value out of range: overflow
This testcase is resolved from AIX libm side. Below is the result.
postgres=#
SELECT x, gamma(x),lgamma(x)
FROM (VALUES (0.5), (1), (2), (3), (4), (5),
(float8 'infinity'), (float8 'nan')) AS t(x);
0.5 | 1.772453850905516 | 0.5723649429247001
1 | 1 | 0
2 | 1 | 0
3 | 2 | 0.6931471805599453
4 | 6 | 1.791759469228055
5 | 24 | 3.1780538303479458
Infinity | Infinity | Infinity
NaN | NaN | NaN
Kindly let us know your feedback on the diffs.
I will commit the diffs to the patch(0001-AIX-support.v8.patch) once you are fine.
Warm regards,
Sriram.
------------------------------------------
AIX with asm spin lock
>> pgbench -c 50 -p 5678 -d postgres -T 180 -r -P 10 -L 10 -j 20
pgbench (18devel)
starting vacuum...end.
progress: 10.0 s, 3181.5 tps, lat 15.331 ms stddev 17.867, 0 failed
progress: 20.0 s, 3277.2 tps, lat 14.730 ms stddev 18.792, 0 failed
progress: 30.0 s, 2642.9 tps, lat 19.556 ms stddev 106.940, 0 failed
progress: 40.0 s, 3614.3 tps, lat 13.830 ms stddev 14.673, 0 failed
progress: 50.0 s, 2355.4 tps, lat 21.208 ms stddev 132.907, 0 failed
progress: 60.0 s, 3046.8 tps, lat 16.407 ms stddev 53.507, 0 failed
progress: 70.0 s, 3640.1 tps, lat 13.734 ms stddev 14.549, 0 failed
progress: 80.0 s, 2435.2 tps, lat 20.518 ms stddev 125.603, 0 failed
progress: 90.0 s, 3576.3 tps, lat 13.977 ms stddev 14.341, 0 failed
progress: 100.0 s, 3653.9 tps, lat 13.681 ms stddev 14.554, 0 failed
progress: 110.0 s, 2414.6 tps, lat 20.684 ms stddev 134.585, 0 failed
progress: 120.0 s, 3051.6 tps, lat 16.383 ms stddev 63.253, 0 failed
progress: 130.0 s, 3657.2 tps, lat 13.667 ms stddev 14.375, 0 failed
progress: 140.0 s, 3159.0 tps, lat 14.259 ms stddev 18.915, 0 failed
progress: 150.0 s, 2889.8 tps, lat 19.006 ms stddev 121.852, 0 failed
progress: 160.0 s, 3649.0 tps, lat 13.693 ms stddev 14.288, 0 failed
progress: 170.0 s, 2799.8 tps, lat 14.552 ms stddev 17.307, 0 failed
progress: 180.0 s, 2582.9 tps, lat 22.914 ms stddev 121.785, 0 failed
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: simple
number of clients: 50
number of threads: 20
maximum number of tries: 1
duration: 180 s
number of transactions actually processed: 556329
number of failed transactions: 0 (0.000%)
number of transactions above the 10.0 ms latency limit: 226554/556329 (40.723%)
latency average = 16.160 ms
latency stddev = 69.085 ms
initial connection time = 230.786 ms
tps = 3086.209412 (without initial connection time)
statement latencies in milliseconds and failures:
0.002 0 \set aid random(1, 100000 * :scale)
0.001 0 \set bid random(1, 1 * :scale)
0.001 0 \set tid random(1, 10 * :scale)
0.001 0 \set delta random(-5000, 5000)
1.084 0 BEGIN;
2.997 0 UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid;
1.400 0 SELECT abalance FROM pgbench_accounts WHERE aid = :aid;
2.014 0 UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid;
4.094 0 UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid;
1.217 0 INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
3.346 0 END;
------------------------------------------
AIX with __sync_lock_test_and_set
pgdev@roxxpg2:~/pgdb/postgres/install]
>> pgbench -c 50 -p 5678 -d postgres -T 180 -r -P 10 -L 10 -j 20
pgbench (18devel)
starting vacuum...end.
progress: 10.0 s, 3391.8 tps, lat 14.339 ms stddev 13.922, 0 failed
progress: 20.0 s, 2724.0 tps, lat 18.350 ms stddev 96.241, 0 failed
progress: 30.0 s, 3571.4 tps, lat 14.001 ms stddev 14.957, 0 failed
progress: 40.0 s, 2630.9 tps, lat 18.993 ms stddev 115.583, 0 failed
progress: 50.0 s, 3574.5 tps, lat 13.984 ms stddev 14.838, 0 failed
progress: 60.0 s, 3577.0 tps, lat 13.973 ms stddev 15.055, 0 failed
progress: 70.0 s, 2401.7 tps, lat 20.810 ms stddev 149.104, 0 failed
progress: 80.0 s, 2891.0 tps, lat 17.291 ms stddev 73.637, 0 failed
progress: 90.0 s, 3529.0 tps, lat 14.160 ms stddev 15.212, 0 failed
progress: 100.0 s, 2637.2 tps, lat 18.951 ms stddev 111.379, 0 failed
progress: 110.0 s, 3593.1 tps, lat 13.903 ms stddev 14.604, 0 failed
progress: 120.0 s, 3560.3 tps, lat 14.048 ms stddev 14.926, 0 failed
progress: 130.0 s, 3230.5 tps, lat 13.796 ms stddev 15.330, 0 failed
progress: 140.0 s, 2293.2 tps, lat 24.154 ms stddev 163.908, 0 failed
progress: 150.0 s, 3511.8 tps, lat 14.219 ms stddev 15.367, 0 failed
progress: 160.0 s, 3612.9 tps, lat 13.836 ms stddev 14.839, 0 failed
progress: 170.0 s, 2523.9 tps, lat 19.811 ms stddev 129.520, 0 failed
progress: 180.0 s, 3533.7 tps, lat 14.136 ms stddev 14.988, 0 failed
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: simple
number of clients: 50
number of threads: 20
maximum number of tries: 1
duration: 180 s
number of transactions actually processed: 567936
number of failed transactions: 0 (0.000%)
number of transactions above the 10.0 ms latency limit: 230810/567936 (40.640%)
latency average = 15.821 ms
latency stddev = 69.610 ms
initial connection time = 249.668 ms
tps = 3158.149150 (without initial connection time)
statement latencies in milliseconds and failures:
0.002 0 \set aid random(1, 100000 * :scale)
0.001 0 \set bid random(1, 1 * :scale)
0.001 0 \set tid random(1, 10 * :scale)
0.001 0 \set delta random(-5000, 5000)
1.092 0 BEGIN;
2.794 0 UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid;
1.472 0 SELECT abalance FROM pgbench_accounts WHERE aid = :aid;
2.040 0 UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid;
4.062 0 UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid;
1.225 0 INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
3.117 0 END;
------------------------------------------
PPCle with asm code
Pple - with asm
[pgdev@roxxpg3 install]$ pgbench -c 50 -p 5678 -d postgres -T 180 -r -P 10 -L 10 -j 20
pgbench (18devel)
starting vacuum...end.
progress: 10.0 s, 4932.9 tps, lat 10.110 ms stddev 7.215, 0 failed
progress: 20.0 s, 5041.2 tps, lat 9.916 ms stddev 6.794, 0 failed
progress: 30.0 s, 5135.3 tps, lat 9.737 ms stddev 6.572, 0 failed
progress: 40.0 s, 5085.2 tps, lat 9.830 ms stddev 6.556, 0 failed
progress: 50.0 s, 5199.0 tps, lat 9.616 ms stddev 6.579, 0 failed
progress: 60.0 s, 5173.5 tps, lat 9.663 ms stddev 6.536, 0 failed
progress: 70.0 s, 5184.9 tps, lat 9.643 ms stddev 6.796, 0 failed
progress: 80.0 s, 5205.1 tps, lat 9.605 ms stddev 6.639, 0 failed
progress: 90.0 s, 5209.5 tps, lat 9.598 ms stddev 6.636, 0 failed
progress: 100.0 s, 5141.9 tps, lat 9.723 ms stddev 6.631, 0 failed
progress: 110.0 s, 5204.0 tps, lat 9.607 ms stddev 6.494, 0 failed
progress: 120.0 s, 5187.3 tps, lat 9.638 ms stddev 6.683, 0 failed
progress: 130.0 s, 5046.7 tps, lat 9.904 ms stddev 6.820, 0 failed
progress: 140.0 s, 4643.9 tps, lat 10.768 ms stddev 7.380, 0 failed
progress: 150.0 s, 5080.3 tps, lat 9.840 ms stddev 6.681, 0 failed
progress: 160.0 s, 5152.3 tps, lat 9.705 ms stddev 6.669, 0 failed
progress: 170.0 s, 5106.7 tps, lat 9.790 ms stddev 6.518, 0 failed
progress: 180.0 s, 5130.0 tps, lat 9.743 ms stddev 6.651, 0 failed
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: simple
number of clients: 50
number of threads: 20
maximum number of tries: 1
duration: 180 s
number of transactions actually processed: 918647
number of failed transactions: 0 (0.000%)
number of transactions above the 10.0 ms latency limit: 356945/918647 (38.856%)
latency average = 9.796 ms
latency stddev = 6.718 ms
initial connection time = 19.606 ms
tps = 5103.024267 (without initial connection time)
statement latencies in milliseconds and failures:
0.001 0 \set aid random(1, 100000 * :scale)
0.001 0 \set bid random(1, 1 * :scale)
0.001 0 \set tid random(1, 10 * :scale)
0.001 0 \set delta random(-5000, 5000)
0.578 0 BEGIN;
1.764 0 UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid;
0.595 0 SELECT abalance FROM pgbench_accounts WHERE aid = :aid;
0.922 0 UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid;
2.504 0 UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid;
0.499 0 INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
2.956 0 END;
------------------------------------------
PPCle with __sync_lock_test_and_set
PPCle - with __sync
[pgdev@roxxpg3 install]$ pgbench -c 50 -p 5678 -d postgres -T 180 -r -P 10 -L 10 -j 20
pgbench (18devel)
starting vacuum...end.
progress: 10.0 s, 4817.2 tps, lat 10.353 ms stddev 7.367, 0 failed
progress: 20.0 s, 4737.2 tps, lat 10.552 ms stddev 7.232, 0 failed
progress: 30.0 s, 4774.7 tps, lat 10.470 ms stddev 7.186, 0 failed
progress: 40.0 s, 4892.3 tps, lat 10.219 ms stddev 7.072, 0 failed
progress: 50.0 s, 4811.5 tps, lat 10.391 ms stddev 7.123, 0 failed
progress: 60.0 s, 4883.1 tps, lat 10.242 ms stddev 6.962, 0 failed
progress: 70.0 s, 4867.8 tps, lat 10.269 ms stddev 7.049, 0 failed
progress: 80.0 s, 4886.6 tps, lat 10.228 ms stddev 7.037, 0 failed
progress: 90.0 s, 4765.9 tps, lat 10.494 ms stddev 7.149, 0 failed
progress: 100.0 s, 4902.0 tps, lat 10.198 ms stddev 7.030, 0 failed
progress: 110.0 s, 4815.3 tps, lat 10.381 ms stddev 7.208, 0 failed
progress: 120.0 s, 4807.1 tps, lat 10.400 ms stddev 7.059, 0 failed
progress: 130.0 s, 4932.0 tps, lat 10.137 ms stddev 6.973, 0 failed
progress: 140.0 s, 4880.6 tps, lat 10.244 ms stddev 7.009, 0 failed
progress: 150.0 s, 4613.2 tps, lat 10.837 ms stddev 7.594, 0 failed
progress: 160.0 s, 4335.8 tps, lat 11.533 ms stddev 7.776, 0 failed
progress: 170.0 s, 4904.0 tps, lat 10.194 ms stddev 6.935, 0 failed
progress: 180.0 s, 4762.6 tps, lat 10.501 ms stddev 7.194, 0 failed
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: simple
number of clients: 50
number of threads: 20
maximum number of tries: 1
duration: 180 s
number of transactions actually processed: 863937
number of failed transactions: 0 (0.000%)
number of transactions above the 10.0 ms latency limit: 364346/863937 (42.173%)
latency average = 10.416 ms
latency stddev = 7.168 ms
initial connection time = 20.090 ms
tps = 4799.621896 (without initial connection time)
statement latencies in milliseconds and failures:
0.001 0 \set aid random(1, 100000 * :scale)
0.001 0 \set bid random(1, 1 * :scale)
0.001 0 \set tid random(1, 10 * :scale)
0.001 0 \set delta random(-5000, 5000)
0.628 0 BEGIN;
1.793 0 UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid;
0.627 0 SELECT abalance FROM pgbench_accounts WHERE aid = :aid;
0.977 0 UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid;
2.694 0 UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid;
0.525 0 INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
3.194 0 END;
------------------------------------------
Attachments:
[application/octet-stream] 0001-AIX-support.tas.memset.diffs (3.2K, 3-0001-AIX-support.tas.memset.diffs)
download
[text/plain] spinlock.stats.log (11.0K, 4-spinlock.stats.log)
download | inline:
------------------------------------------
AIX with asm spin lock
>> pgbench -c 50 -p 5678 -d postgres -T 180 -r -P 10 -L 10 -j 20
pgbench (18devel)
starting vacuum...end.
progress: 10.0 s, 3181.5 tps, lat 15.331 ms stddev 17.867, 0 failed
progress: 20.0 s, 3277.2 tps, lat 14.730 ms stddev 18.792, 0 failed
progress: 30.0 s, 2642.9 tps, lat 19.556 ms stddev 106.940, 0 failed
progress: 40.0 s, 3614.3 tps, lat 13.830 ms stddev 14.673, 0 failed
progress: 50.0 s, 2355.4 tps, lat 21.208 ms stddev 132.907, 0 failed
progress: 60.0 s, 3046.8 tps, lat 16.407 ms stddev 53.507, 0 failed
progress: 70.0 s, 3640.1 tps, lat 13.734 ms stddev 14.549, 0 failed
progress: 80.0 s, 2435.2 tps, lat 20.518 ms stddev 125.603, 0 failed
progress: 90.0 s, 3576.3 tps, lat 13.977 ms stddev 14.341, 0 failed
progress: 100.0 s, 3653.9 tps, lat 13.681 ms stddev 14.554, 0 failed
progress: 110.0 s, 2414.6 tps, lat 20.684 ms stddev 134.585, 0 failed
progress: 120.0 s, 3051.6 tps, lat 16.383 ms stddev 63.253, 0 failed
progress: 130.0 s, 3657.2 tps, lat 13.667 ms stddev 14.375, 0 failed
progress: 140.0 s, 3159.0 tps, lat 14.259 ms stddev 18.915, 0 failed
progress: 150.0 s, 2889.8 tps, lat 19.006 ms stddev 121.852, 0 failed
progress: 160.0 s, 3649.0 tps, lat 13.693 ms stddev 14.288, 0 failed
progress: 170.0 s, 2799.8 tps, lat 14.552 ms stddev 17.307, 0 failed
progress: 180.0 s, 2582.9 tps, lat 22.914 ms stddev 121.785, 0 failed
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: simple
number of clients: 50
number of threads: 20
maximum number of tries: 1
duration: 180 s
number of transactions actually processed: 556329
number of failed transactions: 0 (0.000%)
number of transactions above the 10.0 ms latency limit: 226554/556329 (40.723%)
latency average = 16.160 ms
latency stddev = 69.085 ms
initial connection time = 230.786 ms
tps = 3086.209412 (without initial connection time)
statement latencies in milliseconds and failures:
0.002 0 \set aid random(1, 100000 * :scale)
0.001 0 \set bid random(1, 1 * :scale)
0.001 0 \set tid random(1, 10 * :scale)
0.001 0 \set delta random(-5000, 5000)
1.084 0 BEGIN;
2.997 0 UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid;
1.400 0 SELECT abalance FROM pgbench_accounts WHERE aid = :aid;
2.014 0 UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid;
4.094 0 UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid;
1.217 0 INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
3.346 0 END;
------------------------------------------
AIX with __sync_lock_test_and_set
pgdev@roxxpg2:~/pgdb/postgres/install]
>> pgbench -c 50 -p 5678 -d postgres -T 180 -r -P 10 -L 10 -j 20
pgbench (18devel)
starting vacuum...end.
progress: 10.0 s, 3391.8 tps, lat 14.339 ms stddev 13.922, 0 failed
progress: 20.0 s, 2724.0 tps, lat 18.350 ms stddev 96.241, 0 failed
progress: 30.0 s, 3571.4 tps, lat 14.001 ms stddev 14.957, 0 failed
progress: 40.0 s, 2630.9 tps, lat 18.993 ms stddev 115.583, 0 failed
progress: 50.0 s, 3574.5 tps, lat 13.984 ms stddev 14.838, 0 failed
progress: 60.0 s, 3577.0 tps, lat 13.973 ms stddev 15.055, 0 failed
progress: 70.0 s, 2401.7 tps, lat 20.810 ms stddev 149.104, 0 failed
progress: 80.0 s, 2891.0 tps, lat 17.291 ms stddev 73.637, 0 failed
progress: 90.0 s, 3529.0 tps, lat 14.160 ms stddev 15.212, 0 failed
progress: 100.0 s, 2637.2 tps, lat 18.951 ms stddev 111.379, 0 failed
progress: 110.0 s, 3593.1 tps, lat 13.903 ms stddev 14.604, 0 failed
progress: 120.0 s, 3560.3 tps, lat 14.048 ms stddev 14.926, 0 failed
progress: 130.0 s, 3230.5 tps, lat 13.796 ms stddev 15.330, 0 failed
progress: 140.0 s, 2293.2 tps, lat 24.154 ms stddev 163.908, 0 failed
progress: 150.0 s, 3511.8 tps, lat 14.219 ms stddev 15.367, 0 failed
progress: 160.0 s, 3612.9 tps, lat 13.836 ms stddev 14.839, 0 failed
progress: 170.0 s, 2523.9 tps, lat 19.811 ms stddev 129.520, 0 failed
progress: 180.0 s, 3533.7 tps, lat 14.136 ms stddev 14.988, 0 failed
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: simple
number of clients: 50
number of threads: 20
maximum number of tries: 1
duration: 180 s
number of transactions actually processed: 567936
number of failed transactions: 0 (0.000%)
number of transactions above the 10.0 ms latency limit: 230810/567936 (40.640%)
latency average = 15.821 ms
latency stddev = 69.610 ms
initial connection time = 249.668 ms
tps = 3158.149150 (without initial connection time)
statement latencies in milliseconds and failures:
0.002 0 \set aid random(1, 100000 * :scale)
0.001 0 \set bid random(1, 1 * :scale)
0.001 0 \set tid random(1, 10 * :scale)
0.001 0 \set delta random(-5000, 5000)
1.092 0 BEGIN;
2.794 0 UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid;
1.472 0 SELECT abalance FROM pgbench_accounts WHERE aid = :aid;
2.040 0 UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid;
4.062 0 UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid;
1.225 0 INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
3.117 0 END;
------------------------------------------
PPCle with asm code
Pple - with asm
[pgdev@roxxpg3 install]$ pgbench -c 50 -p 5678 -d postgres -T 180 -r -P 10 -L 10 -j 20
pgbench (18devel)
starting vacuum...end.
progress: 10.0 s, 4932.9 tps, lat 10.110 ms stddev 7.215, 0 failed
progress: 20.0 s, 5041.2 tps, lat 9.916 ms stddev 6.794, 0 failed
progress: 30.0 s, 5135.3 tps, lat 9.737 ms stddev 6.572, 0 failed
progress: 40.0 s, 5085.2 tps, lat 9.830 ms stddev 6.556, 0 failed
progress: 50.0 s, 5199.0 tps, lat 9.616 ms stddev 6.579, 0 failed
progress: 60.0 s, 5173.5 tps, lat 9.663 ms stddev 6.536, 0 failed
progress: 70.0 s, 5184.9 tps, lat 9.643 ms stddev 6.796, 0 failed
progress: 80.0 s, 5205.1 tps, lat 9.605 ms stddev 6.639, 0 failed
progress: 90.0 s, 5209.5 tps, lat 9.598 ms stddev 6.636, 0 failed
progress: 100.0 s, 5141.9 tps, lat 9.723 ms stddev 6.631, 0 failed
progress: 110.0 s, 5204.0 tps, lat 9.607 ms stddev 6.494, 0 failed
progress: 120.0 s, 5187.3 tps, lat 9.638 ms stddev 6.683, 0 failed
progress: 130.0 s, 5046.7 tps, lat 9.904 ms stddev 6.820, 0 failed
progress: 140.0 s, 4643.9 tps, lat 10.768 ms stddev 7.380, 0 failed
progress: 150.0 s, 5080.3 tps, lat 9.840 ms stddev 6.681, 0 failed
progress: 160.0 s, 5152.3 tps, lat 9.705 ms stddev 6.669, 0 failed
progress: 170.0 s, 5106.7 tps, lat 9.790 ms stddev 6.518, 0 failed
progress: 180.0 s, 5130.0 tps, lat 9.743 ms stddev 6.651, 0 failed
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: simple
number of clients: 50
number of threads: 20
maximum number of tries: 1
duration: 180 s
number of transactions actually processed: 918647
number of failed transactions: 0 (0.000%)
number of transactions above the 10.0 ms latency limit: 356945/918647 (38.856%)
latency average = 9.796 ms
latency stddev = 6.718 ms
initial connection time = 19.606 ms
tps = 5103.024267 (without initial connection time)
statement latencies in milliseconds and failures:
0.001 0 \set aid random(1, 100000 * :scale)
0.001 0 \set bid random(1, 1 * :scale)
0.001 0 \set tid random(1, 10 * :scale)
0.001 0 \set delta random(-5000, 5000)
0.578 0 BEGIN;
1.764 0 UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid;
0.595 0 SELECT abalance FROM pgbench_accounts WHERE aid = :aid;
0.922 0 UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid;
2.504 0 UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid;
0.499 0 INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
2.956 0 END;
------------------------------------------
PPCle with __sync_lock_test_and_set
PPCle - with __sync
[pgdev@roxxpg3 install]$ pgbench -c 50 -p 5678 -d postgres -T 180 -r -P 10 -L 10 -j 20
pgbench (18devel)
starting vacuum...end.
progress: 10.0 s, 4817.2 tps, lat 10.353 ms stddev 7.367, 0 failed
progress: 20.0 s, 4737.2 tps, lat 10.552 ms stddev 7.232, 0 failed
progress: 30.0 s, 4774.7 tps, lat 10.470 ms stddev 7.186, 0 failed
progress: 40.0 s, 4892.3 tps, lat 10.219 ms stddev 7.072, 0 failed
progress: 50.0 s, 4811.5 tps, lat 10.391 ms stddev 7.123, 0 failed
progress: 60.0 s, 4883.1 tps, lat 10.242 ms stddev 6.962, 0 failed
progress: 70.0 s, 4867.8 tps, lat 10.269 ms stddev 7.049, 0 failed
progress: 80.0 s, 4886.6 tps, lat 10.228 ms stddev 7.037, 0 failed
progress: 90.0 s, 4765.9 tps, lat 10.494 ms stddev 7.149, 0 failed
progress: 100.0 s, 4902.0 tps, lat 10.198 ms stddev 7.030, 0 failed
progress: 110.0 s, 4815.3 tps, lat 10.381 ms stddev 7.208, 0 failed
progress: 120.0 s, 4807.1 tps, lat 10.400 ms stddev 7.059, 0 failed
progress: 130.0 s, 4932.0 tps, lat 10.137 ms stddev 6.973, 0 failed
progress: 140.0 s, 4880.6 tps, lat 10.244 ms stddev 7.009, 0 failed
progress: 150.0 s, 4613.2 tps, lat 10.837 ms stddev 7.594, 0 failed
progress: 160.0 s, 4335.8 tps, lat 11.533 ms stddev 7.776, 0 failed
progress: 170.0 s, 4904.0 tps, lat 10.194 ms stddev 6.935, 0 failed
progress: 180.0 s, 4762.6 tps, lat 10.501 ms stddev 7.194, 0 failed
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 50
query mode: simple
number of clients: 50
number of threads: 20
maximum number of tries: 1
duration: 180 s
number of transactions actually processed: 863937
number of failed transactions: 0 (0.000%)
number of transactions above the 10.0 ms latency limit: 364346/863937 (42.173%)
latency average = 10.416 ms
latency stddev = 7.168 ms
initial connection time = 20.090 ms
tps = 4799.621896 (without initial connection time)
statement latencies in milliseconds and failures:
0.001 0 \set aid random(1, 100000 * :scale)
0.001 0 \set bid random(1, 1 * :scale)
0.001 0 \set tid random(1, 10 * :scale)
0.001 0 \set delta random(-5000, 5000)
0.628 0 BEGIN;
1.793 0 UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid;
0.627 0 SELECT abalance FROM pgbench_accounts WHERE aid = :aid;
0.977 0 UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid;
2.694 0 UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid;
0.525 0 INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
3.194 0 END;
------------------------------------------
[application/octet-stream] 0001-AIX-support.v8.patch (14.1K, 5-0001-AIX-support.v8.patch)
download | inline diff:
From c854025252ca3dfff9f7f1c4d4aed21cf0cf5346 Mon Sep 17 00:00:00 2001
From: Sriram RK <[email protected]>
Date: Fri, 4 Apr 2025 13:16:21 -0500
Subject: [PATCH] AIX support.
---
Makefile | 2 -
configure | 34 ++++++++++++++---
configure.ac | 34 ++++++++++++++---
src/Makefile.shlib | 29 ++++++++++++++
src/backend/Makefile | 20 ++++++++++
src/backend/port/aix/mkldexport.sh | 61 ++++++++++++++++++++++++++++++
src/backend/utils/error/elog.c | 2 +
src/include/port/aix.h | 4 ++
src/include/storage/s_lock.h | 10 ++---
src/makefiles/Makefile.aix | 29 ++++++++++++++
src/port/strerror.c | 2 +
src/template/aix | 7 ++++
12 files changed, 214 insertions(+), 20 deletions(-)
create mode 100755 src/backend/port/aix/mkldexport.sh
create mode 100644 src/include/port/aix.h
create mode 100644 src/makefiles/Makefile.aix
create mode 100644 src/template/aix
diff --git a/Makefile b/Makefile
index 8a2ec9396b6..9bc1a4ec17b 100644
--- a/Makefile
+++ b/Makefile
@@ -13,8 +13,6 @@
# AIX make defaults to building *every* target of the first rule. Start with
# a single-target, empty rule to make the other targets non-default.
-# (We don't support AIX anymore, but if someone tries to build on AIX anyway,
-# at least they'll get the instructions to run 'configure' first.)
all:
all check install installdirs installcheck installcheck-parallel uninstall clean distclean maintainer-clean dist distcheck world check-world install-world installcheck-world:
diff --git a/configure b/configure
index 11615d1122d..6088fa26679 100755
--- a/configure
+++ b/configure
@@ -3008,6 +3008,7 @@ else
# --with-template not given
case $host_os in
+ aix*) template=aix ;;
cygwin*|msys*) template=cygwin ;;
darwin*) template=darwin ;;
dragonfly*) template=netbsd ;;
@@ -16953,13 +16954,34 @@ _ACEOF
# wider than 64 bits, as allowing MAXIMUM_ALIGNOF to exceed 8 would be too
# much of a penalty for disk and memory space.
-MAX_ALIGNOF=$ac_cv_alignof_double
+if test "$PORTNAME" != "aix"; then
+ MAX_ALIGNOF=$ac_cv_alignof_double
+
+ if test $ac_cv_alignof_long -gt $MAX_ALIGNOF ; then
+ as_fn_error $? "alignment of 'long' is greater than the alignment of 'double'" "$LINENO" 5
+ fi
+ if test $ac_cv_alignof_int64_t -gt $MAX_ALIGNOF ; then
+ as_fn_error $? "alignment of 'long long int' is greater than the alignment of 'double'" "$LINENO" 5
+ fi
+else
+# The AIX 'power' alignment rules apply the natural alignment of the "first
+# member" if it is of a floating-point data type (or is an aggregate whose
+# recursively "first" member or element is such a type). The alignment
+# associated with these types for subsequent members use an alignment value
+# where the floating-point data type is considered to have 4-byte alignment.
+# More info
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99557
+#
+# The double is aligned to 4-bytes on AIX in aggregates. But to maintain
+# alignement across platforms the max alignment of long should be considered.
+ MAX_ALIGNOF=$ac_cv_alignof_long
+ if test $MAX_ALIGNOF -lt $ac_cv_alignof_double ; then
+ MAX_ALIGNOF=$ac_cv_alignof_double
+ fi
+ if test $MAX_ALIGNOF -lt $ac_cv_alignof_int64_t; then
+ MAX_ALIGNOF="$ac_cv_alignof_int64_t"
+ fi
-if test $ac_cv_alignof_long -gt $MAX_ALIGNOF ; then
- as_fn_error $? "alignment of 'long' is greater than the alignment of 'double'" "$LINENO" 5
-fi
-if test $ac_cv_alignof_int64_t -gt $MAX_ALIGNOF ; then
- as_fn_error $? "alignment of 'int64_t' is greater than the alignment of 'double'" "$LINENO" 5
fi
cat >>confdefs.h <<_ACEOF
diff --git a/configure.ac b/configure.ac
index debdf165044..c21aaa52064 100644
--- a/configure.ac
+++ b/configure.ac
@@ -62,6 +62,7 @@ PGAC_ARG_REQ(with, template, [NAME], [override operating system template],
# --with-template not given
case $host_os in
+ aix*) template=aix ;;
cygwin*|msys*) template=cygwin ;;
darwin*) template=darwin ;;
dragonfly*) template=netbsd ;;
@@ -1987,13 +1988,34 @@ AC_CHECK_ALIGNOF(double)
# wider than 64 bits, as allowing MAXIMUM_ALIGNOF to exceed 8 would be too
# much of a penalty for disk and memory space.
-MAX_ALIGNOF=$ac_cv_alignof_double
+if test "$PORTNAME" != "aix"; then
+ MAX_ALIGNOF=$ac_cv_alignof_double
+
+ if test $ac_cv_alignof_long -gt $MAX_ALIGNOF ; then
+ as_fn_error $? "alignment of 'long' is greater than the alignment of 'double'" "$LINENO" 5
+ fi
+ if test $ac_cv_alignof_int64_t -gt $MAX_ALIGNOF; then
+ as_fn_error $? "alignment of 'long long int' is greater than the alignment of 'double'" "$LINENO" 5
+ fi
+else
+# The AIX 'power' alignment rules apply the natural alignment of the "first
+# member" if it is of a floating-point data type (or is an aggregate whose
+# recursively "first" member or element is such a type). The alignment
+# associated with these types for subsequent members use an alignment value
+# where the floating-point data type is considered to have 4-byte alignment.
+# More info
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99557
+#
+# The double is aligned to 4-bytes on AIX in aggregates. But to maintain
+# alignement across platforms the max alignment of long should be considered.
+ MAX_ALIGNOF=$ac_cv_alignof_long
+ if test $MAX_ALIGNOF -lt $ac_cv_alignof_double ; then
+ MAX_ALIGNOF=$ac_cv_alignof_double
+ fi
+ if test $MAX_ALIGNOF -lt $ac_cv_alignof_int64_t ; then
+ MAX_ALIGNOF="$ac_cv_alignof_int64_t"
+ fi
-if test $ac_cv_alignof_long -gt $MAX_ALIGNOF ; then
- AC_MSG_ERROR([alignment of 'long' is greater than the alignment of 'double'])
-fi
-if test $ac_cv_alignof_int64_t -gt $MAX_ALIGNOF ; then
- AC_MSG_ERROR([alignment of 'int64_t' is greater than the alignment of 'double'])
fi
AC_DEFINE_UNQUOTED(MAXIMUM_ALIGNOF, $MAX_ALIGNOF, [Define as the maximum alignment requirement of any C data type.])
diff --git a/src/Makefile.shlib b/src/Makefile.shlib
index fa81f6ffdd6..13ea84ac185 100644
--- a/src/Makefile.shlib
+++ b/src/Makefile.shlib
@@ -106,6 +106,20 @@ ifdef SO_MAJOR_VERSION
override CPPFLAGS += -DSO_MAJOR_VERSION=$(SO_MAJOR_VERSION)
endif
+ifeq ($(PORTNAME), aix)
+ LINK.shared = $(COMPILER)
+ ifdef SO_MAJOR_VERSION
+ shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
+ endif
+ haslibarule = yes
+ # $(exports_file) is also usable as an import file
+ exports_file = lib$(NAME).exp
+ BUILD.exports = ( echo '\#! $(shlib)'; $(AWK) '/^[^\#]/ {printf "%s\n",$$1}' $< ) > $@
+ ifneq (,$(SHLIB_EXPORTS))
+ LINK.shared += -Wl,-bE:$(exports_file)
+ endif
+endif
+
ifeq ($(PORTNAME), darwin)
ifdef soname
# linkable library
@@ -254,6 +268,14 @@ $(stlib): $(OBJS) | $(SHLIB_PREREQS)
touch $@
endif #haslibarule
+# AIX wraps both shared libraries and static library, which can be used both
+# for static and shared linking
+ifeq ($(PORTNAME), aix)
+$(stlib): $(shlib)
+ rm -f $(stlib)
+ $(AR) $(AROPT) $(stlib) $(shlib)
+endif # aix
+
ifeq (,$(filter cygwin win32,$(PORTNAME)))
# Normal case
@@ -267,8 +289,11 @@ ifneq ($(shlib), $(shlib_major))
endif
# Make sure we have a link to a name without any version numbers
ifneq ($(shlib), $(shlib_bare))
+# except on AIX, where that's not a thing
+ifneq ($(PORTNAME), aix)
rm -f $(shlib_bare)
$(LN_S) $(shlib) $(shlib_bare)
+endif # aix
endif # shlib_bare
endif # shlib_major
@@ -376,6 +401,9 @@ install-lib-static: $(stlib) installdirs-lib
install-lib-shared: $(shlib) installdirs-lib
ifdef soname
+# we don't install $(shlib) on AIX
+# (see http://archives.postgresql.org/message-id/52EF20B2E3209443BC37736D00C3C1380A6E79FE@EXADV1.host.magwien.gv.at)
+ifneq ($(PORTNAME), aix)
$(INSTALL_SHLIB) $< '$(DESTDIR)$(libdir)/$(shlib)'
ifneq ($(PORTNAME), cygwin)
ifneq ($(PORTNAME), win32)
@@ -391,6 +419,7 @@ ifneq ($(shlib), $(shlib_bare))
endif
endif # not win32
endif # not cygwin
+endif # not aix
ifneq (,$(findstring $(PORTNAME),win32 cygwin))
$(INSTALL_SHLIB) $< '$(DESTDIR)$(bindir)/$(shlib)'
endif
diff --git a/src/backend/Makefile b/src/backend/Makefile
index 7344c8c7f5c..572f5430a60 100644
--- a/src/backend/Makefile
+++ b/src/backend/Makefile
@@ -63,12 +63,14 @@ all: submake-libpgport submake-catalog-headers submake-utils-headers postgres $(
ifneq ($(PORTNAME), cygwin)
ifneq ($(PORTNAME), win32)
+ifneq ($(PORTNAME), aix)
postgres: $(OBJS)
$(CC) $(CFLAGS) $(call expand_subsys,$^) $(LDFLAGS) $(LIBS) -o $@
endif
endif
+endif
ifeq ($(PORTNAME), cygwin)
@@ -95,6 +97,24 @@ libpostgres.a: postgres
endif # win32
+ifeq ($(PORTNAME), aix)
+
+postgres: $(POSTGRES_IMP)
+ $(CC) $(CFLAGS) $(call expand_subsys,$(OBJS)) $(LDFLAGS) -Wl,-bE:$(top_builddir)/src/backend/$(POSTGRES_IMP) $(LIBS) -Wl,-brtllib -o $@
+
+# Linking to a single .o with -r is a lot faster than building a .a or passing
+# all objects to MKLDEXPORT.
+#
+# It looks alluring to use $(CC) -r instead of ld -r, but that doesn't
+# trivially work with gcc, due to gcc specific static libraries linked in with
+# -r.
+$(POSTGRES_IMP): $(OBJS)
+ ld -r -o SUBSYS.o $(call expand_subsys,$^)
+ $(MKLDEXPORT) SUBSYS.o . > $@
+ @rm -f SUBSYS.o
+
+endif # aix
+
$(top_builddir)/src/port/libpgport_srv.a: | submake-libpgport
diff --git a/src/backend/port/aix/mkldexport.sh b/src/backend/port/aix/mkldexport.sh
new file mode 100755
index 00000000000..adf3793e868
--- /dev/null
+++ b/src/backend/port/aix/mkldexport.sh
@@ -0,0 +1,61 @@
+#!/bin/sh
+#
+# mkldexport
+# create an AIX exports file from an object file
+#
+# src/backend/port/aix/mkldexport.sh
+#
+# Usage:
+# mkldexport objectfile [location]
+# where
+# objectfile is the current location of the object file.
+# location is the eventual (installed) location of the
+# object file (if different from the current
+# working directory).
+#
+# [This file comes from the Postgres 4.2 distribution. - ay 7/95]
+#
+# Header: /usr/local/devel/postgres/src/tools/mkldexport/RCS/mkldexport.sh,v 1.2 1994/03/13 04:59:12 aoki Exp
+#
+
+# setting this to nm -B might be better
+# ... due to changes in AIX 4.x ...
+# ... let us search in different directories - Gerhard Reithofer
+if [ -x /usr/ucb/nm ]
+then NM=/usr/ucb/nm
+elif [ -x /usr/bin/nm ]
+then NM=/usr/bin/nm
+elif [ -x /usr/ccs/bin/nm ]
+then NM=/usr/ccs/bin/nm
+elif [ -x /usr/usg/bin/nm ]
+then NM=/usr/usg/bin/nm
+else echo "Fatal error: cannot find `nm' ... please check your installation."
+ exit 1
+fi
+
+CMDNAME=`basename $0`
+if [ -z "$1" ]; then
+ echo "Usage: $CMDNAME object [location]"
+ exit 1
+fi
+OBJNAME=`basename $1`
+if [ "`basename $OBJNAME`" != "`basename $OBJNAME .o`" ]; then
+ OBJNAME=`basename $OBJNAME .o`.so
+fi
+if [ -z "$2" ]; then
+ echo '#!'
+else
+ if [ "$2" = "." ]; then
+ # for the base executable (AIX 4.2 and up)
+ echo '#! .'
+ else
+ echo '#!' $2
+ fi
+fi
+$NM -BCg $1 | \
+ egrep ' [TDB] ' | \
+ sed -e 's/.* //' | \
+ egrep -v '\$' | \
+ sed -e 's/^[.]//' | \
+ sort | \
+ uniq
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index 8a6b6905079..3a8e9dc30b0 100644
--- a/src/backend/utils/error/elog.c
+++ b/src/backend/utils/error/elog.c
@@ -904,7 +904,9 @@ errcode_for_file_access(void)
/* Wrong object type or state */
case ENOTDIR: /* Not a directory */
case EISDIR: /* Is a directory */
+#if defined(ENOTEMPTY) && (ENOTEMPTY != EEXIST) /* same code on AIX */
case ENOTEMPTY: /* Directory not empty */
+#endif
edata->sqlerrcode = ERRCODE_WRONG_OBJECT_TYPE;
break;
diff --git a/src/include/port/aix.h b/src/include/port/aix.h
new file mode 100644
index 00000000000..7d08480c8c0
--- /dev/null
+++ b/src/include/port/aix.h
@@ -0,0 +1,4 @@
+/*
+ * src/include/port/aix.h
+ */
+
diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
index 2f73f9fcf57..5da9b3acda4 100644
--- a/src/include/storage/s_lock.h
+++ b/src/include/storage/s_lock.h
@@ -421,17 +421,15 @@ tas(volatile slock_t *lock)
__asm__ __volatile__(
" lwarx %0,0,%3,1 \n"
" cmpwi %0,0 \n"
-" bne 1f \n"
+" bne $+16 \n" /* branch to li %1,1 */
" addi %0,%0,1 \n"
" stwcx. %0,0,%3 \n"
-" beq 2f \n"
-"1: \n"
+" beq $+12 \n" /* branch to lwsync */
" li %1,1 \n"
-" b 3f \n"
-"2: \n"
+" b $+12 \n" /* branch to end of asm sequence */
" lwsync \n"
" li %1,0 \n"
-"3: \n"
+
: "=&b"(_t), "=r"(_res), "+m"(*lock)
: "r"(lock)
: "memory", "cc");
diff --git a/src/makefiles/Makefile.aix b/src/makefiles/Makefile.aix
new file mode 100644
index 00000000000..ab6581533d8
--- /dev/null
+++ b/src/makefiles/Makefile.aix
@@ -0,0 +1,29 @@
+# -blibpath must contain ALL directories where we should look for libraries
+libpath := $(shell echo $(subst -L,:,$(filter -L/%,$(LDFLAGS))) | sed -e's/ //g'):/usr/lib:/lib
+
+# AIX uses a stricter, more explicit approach. The runtime linker expects
+# to tell it exactly where to look using -blibpath.
+rpath = -Wl,-blibpath:'$(rpathdir)$(libpath)'
+
+# gcc needs to know it's building a shared lib, otherwise it'll not emit
+# correct code / link to the right support libraries
+ifeq ($(GCC), yes)
+LDFLAGS_SL += -shared
+endif
+
+# env var name to use in place of LD_LIBRARY_PATH
+ld_library_path_var = LIBPATH
+
+POSTGRES_IMP= postgres.imp
+
+ifdef PGXS
+BE_DLLLIBS= -Wl,-bI:$(pkglibdir)/$(POSTGRES_IMP)
+else
+BE_DLLLIBS= -Wl,-bI:$(top_builddir)/src/backend/$(POSTGRES_IMP)
+endif
+
+MKLDEXPORT_DIR=src/backend/port/aix
+MKLDEXPORT=$(top_srcdir)/$(MKLDEXPORT_DIR)/mkldexport.sh
+
+%$(DLSUFFIX): %.o
+ $(CC) $(CFLAGS) $*.o $(LDFLAGS) $(LDFLAGS_SL) -o $@ $(BE_DLLLIBS)
diff --git a/src/port/strerror.c b/src/port/strerror.c
index f0746517770..c46b9dc91fc 100644
--- a/src/port/strerror.c
+++ b/src/port/strerror.c
@@ -214,8 +214,10 @@ get_errno_symbol(int errnum)
return "ENOTCONN";
case ENOTDIR:
return "ENOTDIR";
+#if defined(ENOTEMPTY) && (ENOTEMPTY != EEXIST) /* same code on AIX */
case ENOTEMPTY:
return "ENOTEMPTY";
+#endif
case ENOTSOCK:
return "ENOTSOCK";
#ifdef ENOTSUP
diff --git a/src/template/aix b/src/template/aix
new file mode 100644
index 00000000000..48a3ce55cf7
--- /dev/null
+++ b/src/template/aix
@@ -0,0 +1,7 @@
+# src/template/aix
+
+# Extra CFLAGS for code that will go into a shared library
+CFLAGS_SL=""
+
+# Native memset() is faster.
+MEMSET_LOOP_LIMIT=0
--
2.41.0
view thread (47+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: RE: AIX support
In-Reply-To: <CY8PR15MB5602FE7D86B5C56CBF3E0268DBB22@CY8PR15MB5602.namprd15.prod.outlook.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox