Commit 9de67083 authored by Sergey Vojtovich's avatar Sergey Vojtovich

MDEV-9857 - CACHE_LINE_SIZE in innodb should be 128 on POWER

Replaced hard-coded cache line size.

Changes based on Daniel Black's work.
parent 49ad0845
...@@ -68,11 +68,8 @@ typedef struct { ...@@ -68,11 +68,8 @@ typedef struct {
void *purgatory; void *purgatory;
uint32 purgatory_count; uint32 purgatory_count;
uint32 volatile link; uint32 volatile link;
/* we want sizeof(LF_PINS) to be 128 to avoid false sharing */ /* avoid false sharing */
char pad[128-sizeof(uint32)*2 char pad[CPU_LEVEL1_DCACHE_LINESIZE];
-sizeof(LF_PINBOX *)
-sizeof(void*)
-sizeof(void *)*(LF_PINBOX_PINS+1)];
} LF_PINS; } LF_PINS;
/* compile-time assert to make sure we have enough pins. */ /* compile-time assert to make sure we have enough pins. */
......
...@@ -121,7 +121,6 @@ void lf_pinbox_init(LF_PINBOX *pinbox, uint free_ptr_offset, ...@@ -121,7 +121,6 @@ void lf_pinbox_init(LF_PINBOX *pinbox, uint free_ptr_offset,
lf_pinbox_free_func *free_func, void *free_func_arg) lf_pinbox_free_func *free_func, void *free_func_arg)
{ {
DBUG_ASSERT(free_ptr_offset % sizeof(void *) == 0); DBUG_ASSERT(free_ptr_offset % sizeof(void *) == 0);
compile_time_assert(sizeof(LF_PINS) == 128);
lf_dynarray_init(&pinbox->pinarray, sizeof(LF_PINS)); lf_dynarray_init(&pinbox->pinarray, sizeof(LF_PINS));
pinbox->pinstack_top_ver= 0; pinbox->pinstack_top_ver= 0;
pinbox->pins_in_array= 0; pinbox->pins_in_array= 0;
......
...@@ -31,7 +31,7 @@ extern bool pfs_initialized; ...@@ -31,7 +31,7 @@ extern bool pfs_initialized;
extern size_t pfs_allocated_memory; extern size_t pfs_allocated_memory;
#if defined(HAVE_POSIX_MEMALIGN) || defined(HAVE_MEMALIGN) || defined(HAVE_ALIGNED_MALLOC) #if defined(HAVE_POSIX_MEMALIGN) || defined(HAVE_MEMALIGN) || defined(HAVE_ALIGNED_MALLOC)
#define PFS_ALIGNEMENT 64 #define PFS_ALIGNEMENT CPU_LEVEL1_DCACHE_LINESIZE
#define PFS_ALIGNED MY_ALIGNED(PFS_ALIGNEMENT) #define PFS_ALIGNED MY_ALIGNED(PFS_ALIGNEMENT)
#else #else
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment