Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Missing cgroup awareness

Aperta
#6,059 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c, kubernetes, linux

Direzione di ricerca

Start with the code that determines the value returned by openblas_get_num_threads(), then reproduce the issue with the provided systemd-run CPUQuota command. Compare the needed cgroup parsing with the referenced num_cpus Linux implementation and decide which cgroup versions are in scope. Done means a quota-limited container reports its available CPU count rather than the physical count.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

There are a variety of ways cgroups can restrict CPU availability, and OpenBLAS does not know about all of them.

Without knowing about these restrictions, the result can be code running in a container (e.g. Kubernetes pod) thinking it has far more cores than it actually does, since it will choose the physical CPU count instead of the restricted access the container has been given. This can cause oversaturation and slowness.

To try this out, you can run a program that checks openblas_get_num_threads() under a container created with systemd-run:

systemd-run --user --scope --property CPUQuota="200%" -- yourprogram --yourarg=yourvalue

The program should only have 2 cores, but will in fact report the number of physical cores on the CPU instead.

You can see logic for cgroups parsing (it's on the filesystem) in https://github.com/seanmonstar/num_cpus/blob/master/src/linux.rs for example.

(Not sure if cgroups v1 is worth supporting at this point, since it's old.)

(I validated this with the threadpoolctl Python library.)

Lingua principale
C
Stelle
7.6k
Fork
1.7k
Merge medio
1g 9h
PR unite (30g)
44

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenMathLib/OpenBLAS

Tutte le issue di OpenMathLib/OpenBLAS

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.