Re: [PATCHES] Reorganization of spinlock defines

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [PATCHES] Reorganization of spinlock defines
Date: 2003-09-12 13:56:40
Message-ID: 200309121356.h8CDue011694@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Bruce Momjian wrote:
> Prompted by confusion over Itanium/Opterion, I have written a patch to
> improve the way we define spinlocks for platforms and cpu's. It
> basically decouples the OS from the CPU spinlock code. In almost all
> cases, the spinlock code cares only about the compiler and CPU, not the
> OS.
>
> The patch:
>
> o defines HAS_TEST_AND_SET inside each spinlock routine, not in
> platform-specific files
> o moves slock_t defines into the spinlock routines
> o remove NEED_{CPU}_TAS_ASM define because it is no longer needed
> o reports a compile error if spinlocks are not defined
> o adds a configure option --without-spinlocks to allow
> non-spinlock compiles

OK, we have to decide which parts of this patch we want added. I think
there was agreement that we want this part for 7.4:

> o reports a compile error if spinlocks are not defined
> o adds a configure option --without-spinlocks to allow
> non-spinlock compiles

Now, do we also want to centralize the cpu tests in s_lock.h, or try to
patch up the include/port/*.h files for Opteron/Itanium. If you look in
freebsd.h, for example, you will see we basically try to duplicate the
cpu tests done in s_lock.h. To get this working, we would need to add
Itanium/Opteron tests there, and add i386 tests in other platforms that
previously supported only i386 and add Opteron/Itanium.

Or we could just apply the entire patch.

I am going to get some folks to test the patch today on a few platforms
to see how it works for them.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2003-09-12 13:57:42 Re: [PATCHES] Reorganization of spinlock defines
Previous Message Bruce Momjian 2003-09-12 13:53:10 __cpu__ defines

Browse pgsql-patches by date

  From Date Subject
Next Message Marc G. Fournier 2003-09-12 13:57:42 Re: [PATCHES] Reorganization of spinlock defines
Previous Message Bruce Momjian 2003-09-12 13:53:10 __cpu__ defines