![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Only systems with large pagesizes support ISM, so always defining #define PG_SHMAT_FLAGS SHM_SHARE_MMU in src/backend/port/sysv_shmem.c will cause all calls to shmat to fail with EINVAL on systems that do not support large pages. |
#3
| |||
| |||
|
|
Maybe noone ever ran Postgres on Solaris on a VIA Epia system. |
#4
| |||
| |||
|
|
AFAIK getpagesizes() appeared in 2001 so that probably means it is missing in anything before Solaris 9. |
|
I'll see if I can get the x86 experts here to have a look at it... |
#5
| |||
| |||
|
|
"Paul van der Zwan" <paul.vanderzwan (AT) sun (DOT) com> writes: Only systems with large pagesizes support ISM, so always defining #define PG_SHMAT_FLAGS SHM_SHARE_MMU in src/backend/port/sysv_shmem.c will cause all calls to shmat to fail with EINVAL on systems that do not support large pages. That code's been in there since PG 7.3, and no one before you has complained. Are you sure you've identified the problem correctly? regards, tom lane |
#6
| |||
| |||
|
|
Paul van der Zwan <Paul.Vanderzwan (AT) Sun (DOT) COM> writes: Maybe noone ever ran Postgres on Solaris on a VIA Epia system. Maybe. What is a "VIA Epia system"? |
|
Frankly, I'm afraid that your patch is likely to break way more systems than it fixes. What is getpagesizes(), and is it guaranteed to exist on *every* Solaris system? What the heck correlation does its result have to whether SHM_SHARE_MMU will work? |
#7
| |||
| |||
|
|
On 25-apr-2006, at 16:46, Tom Lane wrote: AFAICS, SHM_SHARE_MMU has no guaranteed semantic effect anyway, it's just a performance hint; so ignoring it on platforms that can't handle it is reasonable. I disagree, I have no definite info why it is a hard failure, probably because there is no way to communicate to the app that it's request is ignored. |
#8
| ||||
| ||||
|
|
Paul van der Zwan <Paul.Vanderzwan (AT) Sun (DOT) COM> writes: AFAIK getpagesizes() appeared in 2001 so that probably means it is missing in anything before Solaris 9. We could handle this without relying on getpagesizes() by just trying and falling back: #ifdef SHM_SHARE_MMU memAddress = shmat(shmid, addr, SHM_SHARE_MMU); if (memAddress == (void *) -1 && errno == EINVAL) memAddress = shmat(shmid, addr, 0); #else memAddress = shmat(shmid, addr, 0); #endif That would be a clean solution ( and was suggested by some of my |
|
However, I would argue that a system is pretty broken if it exposes the SHM_SHARE_MMU #define and then rejects it at runtime. |
|
I'll see if I can get the x86 experts here to have a look at it... I think either Solaris/x86 should not expose this #define, or it should silently ignore the bit at runtime. AFAICS, SHM_SHARE_MMU has no guaranteed semantic effect anyway, it's just a performance hint; so ignoring it on platforms that can't handle it is reasonable. I disagree, I have no definite info why it is a hard failure, |
|
regards, tom lane |
#9
| |||
| |||
|
|
Paul van der Zwan <Paul.Vanderzwan (AT) Sun (DOT) COM> writes: On 25-apr-2006, at 16:46, Tom Lane wrote: AFAICS, SHM_SHARE_MMU has no guaranteed semantic effect anyway, it's just a performance hint; so ignoring it on platforms that can't handle it is reasonable. I disagree, I have no definite info why it is a hard failure, probably because there is no way to communicate to the app that it's request is ignored. Which applications do you think will do anything except exactly what you are proposing we do, ie, just redo the call without the flag bit? Why are you going to make every application jump through this hoop in order to cope with a (possibly temporary) inadequacy in some seldom-used versions of Solaris? We'll probably put in the kluge because we have no other choice, but I strongly disagree that it's our problem. |
![]() |
| Thread Tools | |
| Display Modes | |
| |