Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
emper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lehrstuhl für Informatik 4 (Systemsoftware)
manycore
emper
Commits
3fb3892b
Commit
3fb3892b
authored
3 years ago
by
Florian Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[IoContext] don't manually invalidate broken chains after linux 5.15
parent
f40fd830
No related branches found
No related tags found
1 merge request
!248
Deprecate IoContext submit broken chain logic
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
emper/Emper.cpp
+3
-0
3 additions, 0 deletions
emper/Emper.cpp
emper/Emper.hpp
+10
-0
10 additions, 0 deletions
emper/Emper.hpp
emper/io/IoContext.cpp
+8
-1
8 additions, 1 deletion
emper/io/IoContext.cpp
with
21 additions
and
1 deletion
emper/Emper.cpp
+
3
−
0
View file @
3fb3892b
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
#include
"emper-version.h"
#include
"emper-version.h"
#include
"emper.hpp"
#include
"emper.hpp"
#include
"io/Future.hpp"
#include
"io/Future.hpp"
#include
"lib/LinuxVersion.hpp"
void
async
(
Fiber
*
fiber
)
{
void
async
(
Fiber
*
fiber
)
{
assert
(
fiber
!=
nullptr
);
assert
(
fiber
!=
nullptr
);
...
@@ -44,6 +45,8 @@ void async(const Fiber::fiber_fun0_t& function, workeraffinity_t* affinity) {
...
@@ -44,6 +45,8 @@ void async(const Fiber::fiber_fun0_t& function, workeraffinity_t* affinity) {
namespace
emper
{
namespace
emper
{
bool
IO_MUST_INVALIDATE_BROKEN_CHAIN
=
EMPER_LINUX_LT
(
"5.15.0"
);
auto
getFullVersion
()
->
std
::
string
{
return
EMPER_FULL_VERSION
;
}
auto
getFullVersion
()
->
std
::
string
{
return
EMPER_FULL_VERSION
;
}
static
void
ensure_no_current_runtime
()
{
static
void
ensure_no_current_runtime
()
{
...
...
This diff is collapsed.
Click to expand it.
emper/Emper.hpp
+
10
−
0
View file @
3fb3892b
...
@@ -130,6 +130,16 @@ static const bool IO_URING_SQPOLL =
...
@@ -130,6 +130,16 @@ static const bool IO_URING_SQPOLL =
#endif
#endif
;
;
// Initialize this bool in Emper.cpp because it needs code evaluation
// (LinuxVersion::compare) during runtime.
// Using a static variable here means EACH object file including this header has to
// evaluate the needed code during library initialization.
// An extern variable results in a single execution during initialization of the
// Emper.cpp object.
// This also has the advantage that the probability we crash because printing
// warnings during the comparison use not yet initialized components is reduced.
extern
bool
IO_MUST_INVALIDATE_BROKEN_CHAIN
;
static
const
bool
IO_URING_SHARED_WQ
=
static
const
bool
IO_URING_SHARED_WQ
=
#ifdef EMPER_IO_URING_SHARED_WQ
#ifdef EMPER_IO_URING_SHARED_WQ
true
true
...
...
This diff is collapsed.
Click to expand it.
emper/io/IoContext.cpp
+
8
−
1
View file @
3fb3892b
...
@@ -197,7 +197,14 @@ void IoContext::submitAndWait(Future &future, unsigned wait_nr) {
...
@@ -197,7 +197,14 @@ void IoContext::submitAndWait(Future &future, unsigned wait_nr) {
// broken chains. This means that all sqes in a chain except the broken one will
// broken chains. This means that all sqes in a chain except the broken one will
// result in cqes with result -ECANCELD and the invalid one will
// result in cqes with result -ECANCELD and the invalid one will
// generate a cqe with the appropriate error code
// generate a cqe with the appropriate error code
if
(
unlikely
(
static_cast
<
unsigned
>
(
submitted
)
<
prepared
))
{
// When 5.15 is released with
// https://lore.kernel.org/io-uring/180ec124-79b1-2274-4570-9b0d6620d512@linux.alibaba.com/T/#t
// the kernel will consume the whole broken chain and we
// don't need to manually invalidate not submitted sqes.
// This allows SQPOLL to work for invalid chains.
if
(
unlikely
(
static_cast
<
unsigned
>
(
submitted
)
<
prepared
)
&&
emper
::
IO_MUST_INVALIDATE_BROKEN_CHAIN
)
{
cancelUnsubmittedChainParts
<
callerEnvironment
>
(
future
);
cancelUnsubmittedChainParts
<
callerEnvironment
>
(
future
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment