Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Florian Fischer
emper
Commits
07818464
Commit
07818464
authored
May 03, 2022
by
Florian Fischer
Browse files
waitfd: make punting the waitfd read configurable
parent
ae890661
Pipeline
#81287
failed with stages
in 21 minutes and 38 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
emper/Emper.hpp
View file @
07818464
...
...
@@ -161,6 +161,14 @@ const bool IO_NOTIFICATION =
#endif
;
const
bool
IO_PUNT_WAITFD_READ
=
#ifdef EMPER_IO_PUNT_WAITFD_READ
true
#else
false
#endif
;
const
bool
IO_STEALING
=
#ifdef EMPER_IO_STEALING
true
...
...
emper/sleep_strategy/WaitfdSleepStrategy.cpp
View file @
07818464
...
...
@@ -61,7 +61,9 @@ void WaitfdSleepStrategy::sleep() {
auto
customLogic
=
[
this
,
&
io
]
{
// waitfd non-blocking reads will always return -EAGAIN and waitfd is not pollable
// therefore we can skip that and immediately issue the read in an async manner.
prepareSleepRead
(
io
,
waitfd
,
IOSQE_ASYNC
);
uint8_t
sqe_flags
=
0
;
if
constexpr
(
emper
::
IO_PUNT_WAITFD_READ
)
sqe_flags
|=
IOSQE_ASYNC
;
prepareSleepRead
(
io
,
waitfd
,
sqe_flags
);
LOGD
(
"prepared waitfd read"
);
return
true
;
};
...
...
meson.build
View file @
07818464
...
...
@@ -194,6 +194,8 @@ io_bool_options = [
{'option': 'notification',
'dependencies': {'worker_sleep_strategy': 'waitfd'}},
{'option': 'synchronous'},
{'option': 'punt_waitfd_read',
'dependencies': {'worker_sleep_strategy': 'waitfd'}},
]
io_raw_options = [
...
...
meson_options.txt
View file @
07818464
...
...
@@ -73,6 +73,12 @@ option(
choices: ['none', 'accounting', 'waitFree', 'bestEffort'],
value: 'none',
)
option(
'io_punt_waitfd_read',
type: 'boolean',
description: 'Punt the sleep watfd read to the io_wq',
value: false,
)
option(
'wakeup_semaphore_implementation',
type: 'combo',
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment