diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-10-11 20:41:32 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-10-11 20:41:32 +0000 |
commit | a72ee090900a24815aea5986ef5417c2312c52a5 (patch) | |
tree | 5e85710931097f7cc9cfbf3aa37e94a66aa00e91 /src/include | |
parent | 9907b9775b4035f846fec5bb4d077eca7e5494ea (diff) |
Add infrastructure for making spins_per_delay variable depending on
whether we seem to be running in a uniprocessor or multiprocessor.
The adjustment rules could probably still use further tweaking, but
I'm convinced this should be a win overall.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/storage/proc.h | 4 | ||||
-rw-r--r-- | src/include/storage/s_lock.h | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index 7297f444bfd..b915f78035e 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/proc.h,v 1.82 2005/09/19 17:21:48 momjian Exp $ + * $PostgreSQL: pgsql/src/include/storage/proc.h,v 1.83 2005/10/11 20:41:32 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -105,6 +105,8 @@ typedef struct PROC_HDR { /* Head of list of free PGPROC structures */ SHMEM_OFFSET freeProcs; + /* Current shared estimate of appropriate spins_per_delay value */ + int spins_per_delay; } PROC_HDR; diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h index 9c8b71820f3..7b94d64c73d 100644 --- a/src/include/storage/s_lock.h +++ b/src/include/storage/s_lock.h @@ -66,7 +66,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.141 2005/10/11 20:01:30 tgl Exp $ + * $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.142 2005/10/11 20:41:32 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -872,4 +872,10 @@ extern int tas(volatile slock_t *lock); /* in port/.../tas.s, or */ extern void s_lock(volatile slock_t *lock, const char *file, int line); +/* Support for dynamic adjustment of spins_per_delay */ +#define DEFAULT_SPINS_PER_DELAY 100 + +extern void set_spins_per_delay(int shared_spins_per_delay); +extern int update_spins_per_delay(int shared_spins_per_delay); + #endif /* S_LOCK_H */ |