diff options
author | Rickard Green <[email protected]> | 2010-06-03 12:44:15 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2010-06-03 12:44:15 +0000 |
commit | 17808d2471632beeb7b23b5456712cad7a5ac255 (patch) | |
tree | ef552f11c439e4a38830b9a869d05ae647c4a6be /erts | |
parent | 97fa9fe68af5990a8ef7a71ccb7fc235d20a2c04 (diff) | |
download | otp-17808d2471632beeb7b23b5456712cad7a5ac255.tar.gz otp-17808d2471632beeb7b23b5456712cad7a5ac255.tar.bz2 otp-17808d2471632beeb7b23b5456712cad7a5ac255.zip |
OTP-8673 Adjust alignment of scheduler data and run queues
Alignment of scheduler data and run queues were adjusted.
Diffstat (limited to 'erts')
-rw-r--r-- | erts/emulator/beam/erl_process.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c index c61fab5d36..5be77de7bb 100644 --- a/erts/emulator/beam/erl_process.c +++ b/erts/emulator/beam/erl_process.c @@ -2082,12 +2082,14 @@ erts_init_scheduling(int mrq, int no_schedulers, int no_schedulers_online) erts_aligned_run_queues = erts_alloc(ERTS_ALC_T_RUNQS, (sizeof(ErtsAlignedRunQueue)*(n+1))); - if ((((UWord) erts_aligned_run_queues) & ERTS_CACHE_LINE_MASK) == 0) + if ((((UWord) erts_aligned_run_queues) & ERTS_CACHE_LINE_MASK) != 0) erts_aligned_run_queues = ((ErtsAlignedRunQueue *) ((((UWord) erts_aligned_run_queues) & ~ERTS_CACHE_LINE_MASK) + ERTS_CACHE_LINE_SIZE)); + ASSERT((((UWord) erts_aligned_run_queues) & ERTS_CACHE_LINE_MASK) == 0); + #ifdef ERTS_SMP erts_smp_atomic_init(&no_empty_run_queues, 0); #endif @@ -2179,11 +2181,14 @@ erts_init_scheduling(int mrq, int no_schedulers, int no_schedulers_online) erts_aligned_scheduler_data = erts_alloc(ERTS_ALC_T_SCHDLR_DATA, (sizeof(ErtsAlignedSchedulerData) *(n+1))); - if ((((UWord) erts_aligned_scheduler_data) & ERTS_CACHE_LINE_MASK) == 0) + if ((((UWord) erts_aligned_scheduler_data) & ERTS_CACHE_LINE_MASK) != 0) erts_aligned_scheduler_data = ((ErtsAlignedSchedulerData *) ((((UWord) erts_aligned_scheduler_data) & ~ERTS_CACHE_LINE_MASK) + ERTS_CACHE_LINE_SIZE)); + + ASSERT((((UWord) erts_aligned_scheduler_data) & ERTS_CACHE_LINE_MASK) == 0); + for (ix = 0; ix < n; ix++) { ErtsSchedulerData *esdp = ERTS_SCHEDULER_IX(ix); #ifdef ERTS_SMP |