Skip to content
Snippets Groups Projects
Commit e76710a4 authored by Florian Schmaus's avatar Florian Schmaus
Browse files

Intermediate Commit (2022-02-04 18:03)

parent a1cfdc98
No related branches found
No related tags found
No related merge requests found
...@@ -470,3 +470,9 @@ continuation-stealing-locked: ...@@ -470,3 +470,9 @@ continuation-stealing-locked:
variables: variables:
EMPER_CONTINUATION_STEALING_MODE: 'locked' EMPER_CONTINUATION_STEALING_MODE: 'locked'
EMPER_LOCKED_WS_QUEUE: 'true' EMPER_LOCKED_WS_QUEUE: 'true'
continuation-stealing-madv-free:
extends:
- .test
variables:
EMPER_CONTINUATION_STEALING_MADVISE_STACK: 'free'
Continuation Stealing Stats:
- Steal count
- unmap stats:
- how often, how large, how long does it take?
- how often was resumable 'false'
TODO: TODO:
- From Nico's branch: WsClV3Queue, WsClV4Queue - From Nico's branch: WsClV3Queue, WsClV4Queue
- EMPER_FIBRIL_SYNC, that is FibrilDeque and FibrilLock (which appears to be just a spin lock?) not yet ported. Ask Nico the rationale behind that. - EMPER_FIBRIL_SYNC, that is FibrilDeque and FibrilLock (which appears to be just a spin lock?) not yet ported. Ask Nico the rationale behind that.
......
...@@ -41,7 +41,7 @@ void Context::unmap(void* from) const { ...@@ -41,7 +41,7 @@ void Context::unmap(void* from) const {
const size_t PAGE_SIZE_MASK = 4 * 1024 - 1; const size_t PAGE_SIZE_MASK = 4 * 1024 - 1;
const uintptr_t start = ((uintptr_t) context + PAGE_SIZE_MASK) & ~PAGE_SIZE_MASK; const uintptr_t start = ((uintptr_t) context + PAGE_SIZE_MASK) & ~PAGE_SIZE_MASK;
const uintptr_t end = (uintptr_t) from & ~PAGE_SIZE_MASK; const uintptr_t end = (uintptr_t) from & ~PAGE_SIZE_MASK;
const size_t length = end - start;
const int advice = []{ const int advice = []{
if constexpr (emper::CONTINUATION_STEALING_MADVISE_STACK == emper::ContinuationStealingMadviseStack::dontneed) { if constexpr (emper::CONTINUATION_STEALING_MADVISE_STACK == emper::ContinuationStealingMadviseStack::dontneed) {
return MADV_DONTNEED; return MADV_DONTNEED;
...@@ -50,8 +50,11 @@ void Context::unmap(void* from) const { ...@@ -50,8 +50,11 @@ void Context::unmap(void* from) const {
} }
}(); }();
LOGD("madvise() start=" << start << ", length=" << length << ", advice=" << advice);
// NOLINTNEXTLINE(performance-no-int-to-ptr) // NOLINTNEXTLINE(performance-no-int-to-ptr)
errno = madvise((void*) start, (end - start), advice); errno = madvise((void*) start, length, advice);
if (errno) { if (errno) {
DIE_MSG_ERRNO("Unmapping unused stack space failed"); DIE_MSG_ERRNO("Unmapping unused stack space failed");
} }
......
// SPDX-License-Identifier: LGPL-3.0-or-later
// Copyright © 2022 Florian Schmaus
#include <cstdlib>
#include "Emper.hpp"
#include "emper-common.h"
#include "test-runner.hpp"
auto main(UNUSED_ARG int argc, UNUSED_ARG char* argv[]) -> int {
if constexpr (!emper::CONTINUATION_STEALING || emper::BUILD_WITH_CLANG) {
exit(77);
}
return testMain();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment