Guest processes are limited to 64 threads

Ouverte
#494 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 2 jours

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
47/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
c, go, macos

Piste de recherche

Start with MAX_THREADS in src/runtime/thread.h and the SP_EL1 slot tracking in src/runtime/thread.c; then review the thread-related context in #224. Reproduce the failure with the Go workload command in the issue and confirm whether it also occurs during make bench-ci. Done means guest processes can create more than 64 threads and the workload no longer fails with EAGAIN.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

bug enhancement

A guest process gets at most 64 threads (MAX_THREADS in src/runtime/thread.h; the SP_EL1 slots are tracked in one uint64_t in src/runtime/thread.c). The 65th clone fails with EAGAIN. Linux allows far more, and Go programs reach this with ordinary work, because the Go runtime starts a new OS thread whenever a goroutine blocks in a syscall, independent of GOMAXPROCS.

gofmt over a few standard-library trees is enough:

scripts/elfuse-oci.py run --entrypoint /bin/sh \
  mirror.gcr.io/library/golang:1.23-alpine@sha256:56e44a486dc12270a471259239c0005ae492be2f078c4f54567c0e3159e23e4b \
  -c 'r=$(go env GOROOT); go version; for t in net runtime crypto; do gofmt -l $r/src/$t; done; gofmt -d $r/src/fmt' > /dev/null

It failed 5 of 30 runs:

runtime: failed to create new OS thread (have 65 already; errno=11)
runtime: may need to increase max user processes (ulimit -u)
fatal error: newosproc

With GOMAXPROCS=4 it passed 40 of 40 runs alone but still failed inside a full make bench-ci, so capping GOMAXPROCS is not a workaround.

This is why the go row of the real-workload ranking is left out of the Tier 3 benchmarks in #493.

Refs #224

Langage dominant
C
Étoiles
287
Forks
33
Merge moyen
2 j 17 h
PR mergées (30 j)
18

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de sysprog21/elfuse

Toutes les issues de sysprog21/elfuse

Issues similaires

Plus d'issues C

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.