Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit98c6c96

Browse files
committed
Update AIX FAQ:
At any rate, here's a revision to CVS HEAD to reflect some changes bymyself and by Seneca Cunningham for the AIX FAQ. It touches on thefollowing issues:1. memcpy pointer patch for dynahash.c2. AIX memory management, which can, for 32 bit cases, bite people quite unexpectedly...Chris Browne
1 parent9204980 commit98c6c96

File tree

1 file changed

+181
-1
lines changed

1 file changed

+181
-1
lines changed

‎doc/FAQ_AIX

Lines changed: 181 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
From: Zeugswetter Andreas <ZeugswetterA@spardat.at>
2-
$Date: 2006/04/05 22:55:05 $
2+
$Date: 2006/04/13 11:41:02 $
33

44
On AIX 4.3.2 PostgreSQL compiled with the native IBM compiler xlc
55
(vac.C 5.0.1) passes all regression tests. Other versions of OS and
@@ -113,6 +113,68 @@ libraries, the following URLs may help you...
113113
http://www.faqs.org/faqs/aix-faq/part4/section-22.html
114114

115115
http://www.han.de/~jum/aix/ldd.c
116+
117+
---
118+
From: Christopher Browne <cbbrowne@ca.afilias.info>
119+
Date: 2005-11-02
120+
121+
On AIX 5.3 ML3 (e.g. maintenance level 5300-03), there is some problem
122+
with the handling of the pointer to memcpy. It is speculated that
123+
this relates to some linker bug that may have been introduced between
124+
5300-02 and 5300-03, but we have so far been unable to track down the
125+
cause.
126+
127+
At any rate, the following patch, which "unwraps" the function
128+
reference, has been observed to allow PG 8.1 pre-releases to pass
129+
regression tests.
130+
131+
The same behaviour (albeit with varying underlying functions to
132+
"blame") has been observed when compiling with either GCC 4.0 or IBM
133+
XLC.
134+
135+
------------ per Seneca Cunningham -------------------
136+
137+
The following patch works on the AIX 5.3 ML3 box here and didn't cause
138+
any problems with postgres on the x86 desktop. It's just a cleaner
139+
version of what I tried earlier.
140+
141+
*** dynahash.c.orig Tue Nov 1 19:41:42 2005
142+
--- dynahash.c Tue Nov 1 20:30:33 2005
143+
***************
144+
*** 670,676 ****
145+
146+
147+
/* copy key into record */
148+
currBucket->hashvalue = hashvalue;
149+
! hashp->keycopy(ELEMENTKEY(currBucket), keyPtr, keysize);
150+
151+
152+
/* caller is expected to fill the data field on return */
153+
154+
155+
--- 670,687 ----
156+
157+
158+
/* copy key into record */
159+
currBucket->hashvalue = hashvalue;
160+
! if (hashp->keycopy == memcpy)
161+
! {
162+
! memcpy(ELEMENTKEY(currBucket), keyPtr, keysize);
163+
! }
164+
! else if (hashp->keycopy == strncpy)
165+
! {
166+
! strncpy(ELEMENTKEY(currBucket), keyPtr, keysize);
167+
! }
168+
! else
169+
! {
170+
! hashp->keycopy(ELEMENTKEY(currBucket), keyPtr, keysize);
171+
! }
172+
173+
174+
/* caller is expected to fill the data field on return */
175+
176+
------------ per Seneca Cunningham -------------------
177+
116178
---
117179

118180
AIX, readline, and postgres 8.1.x:
@@ -185,3 +247,121 @@ References
185247
IBM Redbook
186248
http://www.redbooks.ibm.com/redbooks/pdfs/sg245674.pdf
187249
http://www.redbooks.ibm.com/abstracts/sg245674.html?Open
250+
251+
-----
252+
253+
AIX Memory Management: An Overview
254+
==================================
255+
256+
by Seneca Cunningham...
257+
258+
AIX can be somewhat peculiar with regards to the way it does memory
259+
management. You can have a server with many multiples of gigabytes of
260+
RAM free, but still get out of memory or address space errors when
261+
running applications.
262+
263+
Two examples of AIX-specific memory problems
264+
--------------------------------------------
265+
Both examples were from systems with gigabytes of free RAM.
266+
267+
a) createlang failing with unusual errors
268+
Running as the owner of the postgres install:
269+
-bash-3.00$ createlang plpgsql template1
270+
createlang: language installation failed: ERROR: could not load library
271+
"/opt/dbs/pgsql748/lib/plpgsql.so": A memory address is not in the
272+
address space for the process.
273+
274+
Running as a non-owner in the group posessing the postgres install:
275+
-bash-3.00$ createlang plpgsql template1
276+
createlang: language installation failed: ERROR: could not load library
277+
"/opt/dbs/pgsql748/lib/plpgsql.so": Bad address
278+
279+
b) out of memory errors in the postgres logs
280+
Every memory allocation near or greater than 256MB failing.
281+
282+
283+
The cause of these problems
284+
----------------------------
285+
286+
The overall cause of all these problems is the default bittedness and
287+
memory model used by the postmaster process.
288+
289+
By default, all binaries built on AIX are 32-bit. This does not
290+
depend upon hardware type or kernel in use. These 32-bit processes
291+
are limited to 4GB of memory laid out in 256MB segments using one of a
292+
few models. The default allows for less than 256MB in the heap as it
293+
shares a single segment with the stack.
294+
295+
In the case of example a), above, check your umask and the permissions
296+
of the binaries in your postgres install. The binaries involved in
297+
that example were 32-bit and installed as mode 750 instead of 755.
298+
Due to the permissions being set in this fashion, only the owner or a
299+
member of the possessing group can load the library. Since it isn't
300+
world-readable, the loader places the object into the process' heap
301+
instead of the shared library segments where it would otherwise be
302+
placed.
303+
304+
Solutions and workarounds
305+
-------------------------
306+
In this section, all build flag syntax is presented for gcc.
307+
308+
The "ideal" solution for this is to use a 64-bit build of postgres,
309+
but that's not always practical. Systems with 32-bit processors can
310+
build, but not run, 64-bit binaries.
311+
312+
If a 32-bit binary is desired, set LDR_CNTRL to "MAXDATA=0xn0000000",
313+
where 1 <= n <= 8, before starting the postmaster and try different
314+
values and postgresql.conf settings to find a configuration that works
315+
satisfactorily. This use of LDR_CNTRL tells AIX that you want the
316+
postmaster to have $MAXDATA bytes set aside for the heap, allocated in
317+
256MB segments.
318+
319+
When you find a workable configuration, ldedit can be used to modify
320+
the binaries so that they default to using the desired heap size.
321+
322+
PostgreSQL might also be rebuilt, passing configure
323+
LDFLAGS="-Wl,-bmaxdata:0xn0000000" to achieve the same effect.
324+
325+
For a 64-bit build, set OBJECT_MODE to 64 and pass CC="gcc -maix64"
326+
and LDFLAGS="-Wl,-bbigtoc" to configure. If you omit the export of
327+
OBJECT_MODE, your build may fail with linker errors. When OBJECT_MODE
328+
is set, it tells AIX's build utilities such as ar, as, and ld what
329+
type of objects to default to handling.
330+
331+
Overcommit
332+
----------
333+
334+
By default, overcommit of paging space can happen. While I have not
335+
seen this occur, AIX will kill processes when it runs out of memory
336+
and the overcommit is accessed. The closest to this that I have seen
337+
is fork failing because the system decided that there was not enough
338+
memory for another process. Like many other parts of AIX, the paging
339+
space allocation method and out-of-memory kill is configurable on a
340+
system- or process-wide basis if this becomes a problem.
341+
342+
References and resources
343+
------------------------
344+
"Large Program Support"
345+
AIX Documentation: General Programming Concepts: Writing and Debugging Programs
346+
http://publib.boulder.ibm.com/infocenter/pseries/topic/com.ibm.aix.doc/aixprggd/genprogc/lrg_prg_support.htm
347+
348+
"Program Address Space Overview"
349+
AIX Documentation: General Programming Concepts: Writing and Debugging Programs
350+
http://publib.boulder.ibm.com/infocenter/pseries/topic/com.ibm.aix.doc/aixprggd/genprogc/address_space.htm
351+
352+
"Performance Overview of the Virtual Memory Manager (VMM)"
353+
AIX Documentation: Performance Management Guide
354+
http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.doc/aixbman/prftungd/resmgmt2.htm
355+
356+
"Page Space Allocation"
357+
AIX Documentation: Performance Management Guide
358+
http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.doc/aixbman/prftungd/memperf7.htm
359+
360+
"Paging-space thresholds tuning"
361+
AIX Documentation: Performance Management Guide
362+
http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.doc/aixbman/prftungd/memperf6.htm
363+
364+
"Developing and Porting C and C++ Applications on AIX"
365+
IBM Redbook
366+
http://www.redbooks.ibm.com/redbooks/pdfs/sg245674.pdf
367+
http://www.redbooks.ibm.com/abstracts/sg245674.html?Open

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp