mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-06 13:05:47 +00:00
Merge branch 'main' into fix/resume-zram-thrash
This commit is contained in:
commit
7b7a3bd673
295 files changed
+11924
-4527
No files matched your search
@@ -102,10 +102,16 @@ available.
|
||||
|
||||
## Threads
|
||||
|
||||
Page-out never runs on a thread of the game. The preload's signal handler only wakes its
|
||||
`zr-worker` thread, which does the `madvise` calls. A forked process
|
||||
without a worker trims inline in steps of at most 32 MiB per request and looks at no more
|
||||
than 512 MiB of its address space each time. The page-out for a suspend and the read-back
|
||||
When a worker can be started, page-out runs outside the game's threads. The preload's signal
|
||||
handler starts a `zr-worker` thread for the request, which does the `madvise` calls and exits once no request
|
||||
is left, so a process that is not paging out has no thread the preload added. Programs that
|
||||
check they are single-threaded before they fork or call `unshare(CLONE_NEWUSER)`, such as
|
||||
Chromium's zygote, keep working. The worker is a bare `clone` with the flags of a normal
|
||||
thread, on a stack the preload maps itself, and makes only raw system calls, so starting it
|
||||
from the signal handler is safe and seccomp filters that only allow thread clones accept it. A
|
||||
process that has a single thread, or whose signalled thread added a seccomp filter after the
|
||||
process started, as browser sandboxes do, gets no worker. When there is no worker, the process trims inline in steps of at most 32 MiB per request and
|
||||
looks at no more than 512 MiB of its address space each time. The page-out for a suspend and the read-back
|
||||
after it are not limited there: they run once, while the process is being stopped or
|
||||
started, and cover all of it. The monitor is a
|
||||
shell loop in the session, outside every game process.
|
||||
|
||||
Reference in new issue
Block a user