RE: AIX support

From: Srirama Kucherlapati <sriram(dot)rk(at)in(dot)ibm(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Heikki Linnakangas <hlinnaka(at)gmail(dot)com>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Noah Misch <noah(at)leadboat(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, "tvk1271(at)gmail(dot)com" <tvk1271(at)gmail(dot)com>, "postgres-ibm-aix(at)wwpdl(dot)vnet(dot)ibm(dot)com" <postgres-ibm-aix(at)wwpdl(dot)vnet(dot)ibm(dot)com>
Subject: RE: AIX support
Date: 2024-08-14 15:22:18
Message-ID: CY8PR15MB5602A5D9064A401347684A06DB872@CY8PR15MB5602.namprd15.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Heikki,
I have attached the merged patch with all the changes, the earlier patch was
just only the changes specific to older review comments.

> I'm sorry, I don't understand what you're saying here. Do you mean that
> we don't need to do anything here, and the code we have in s_lock.h in
> 'master' now will work fine on AIX? Or do we need to (re-)do some
> changes to support AIX again? If we only support GCC, can we use the
> __sync_lock_test_and_set() builtin instead?

Here we need these changes for ppc. These changes are not for enabling
the AIX support, but this is implementing “Enhanced PowerPC Architecture”.
This routine is more of compare_and_increment, which is different from
GCC __sync_lock_test_and_set(). Also I tried to write a sample function to
check the assemble generated by __sync_lock_test_and_set(), which turned out to
be different set of assemble code.

> > +#define TAS(lock) _check_lock((slock_t *) (lock),
> > 0, 1)
> >
>> +#define S_UNLOCK(lock) _clear_lock((slock_t *) (lock), 0)
>>
> > The above changes are specific to AIX kernel and it operates on fixed
> > kernel memory. This is more like a compare_and_swap functionality with
> > sync capability. For all the assemble code I think it would be better to
> > use the IBM Power specific asm code to gain additional performance.

> You mean we don't need the above? Ok, good.

I mean this part of the code is needed as this is specific to AIX kernel memory
operation which is different from __sync_lock_test_and_set().

I would like to mention that the changes made in src/include/storage/s_lock.h
are pretty much required and need to be operated in assemble specific to IBM
Power architecture.

Warm regards,
Sriram.

Attachment Content-Type Size
0001-AIX-support-revert-the-changes-from-0b16bb8776bb8.v3.patch application/octet-stream 43.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Maxim Orlov 2024-08-14 15:30:15 Re: POC: make mxidoff 64 bits
Previous Message David Fetter 2024-08-14 14:43:51 Re: [PATCH] Add get_bytes() and set_bytes() functions