tobogganSe connecter

louise

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

Runtime: idle actors' stacks hibernate (issue #137)

An actor parked in a receive or a sleep for 50 to 150 ms of wall time
has its stack saved and given back (Fiber::hibernate), and written back
in place before it next runs (run_slice), whatever wakes it: a message,
a timer, a kill. An idle actor's stack holds 688 bytes, against a 4 KiB
page and a 4 KiB page table resident.

- Each scheduler thread lists the actors that park on it, each at most
  once (Cell::listed), and looks at them again two epochs (50 ms, wall
  time) later: hibernated if still in a wait that began two epochs ago,
  listed again if it parked since, dropped if running or gone. Actors
  that wait less never hibernate: messages, fanin and arith look nothing
  up; timers on one thread hibernates 2,001 of its servers.
- Not in blocking calls (they run on the actor's values) nor socket
  waits; never queued or running actors (idle_fiber, under the lock).
- A thread with listed actors sleeps an epoch at most (Sleepers::sleep
  takes a timeout; the idle thread caps its reactor wait), so they age.
- Wall time, not the scheduler's clock: hibernating changes no
  behaviour, and virtual time stays put while actors run.
- LOUISE_PARKED_EPOCH_MS sets the epoch; at 0 every parked actor is
  hibernated at once. ci.sh runs the native programs so; TSan and
  ASan+UBSan were clean so too (messages runs 9x slower: every hop
  thaws).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

olivier · il y a 1 mois · faff8f43f1e01920193f6eac828326e1e106a608

Parents c04029d

3 fichiers modifiés, 251 ajouts, 25 suppressions