Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Missing cgroup awareness

Aberta
#6,059 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
52/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
c, kubernetes, linux

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.)

Linguagem predominante
C
Estrelas
7.6k
Forks
1.7k
Merge médio
1d 6h
PRs com merge (30d)
46

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de OpenMathLib/OpenBLAS

Todas as issues de OpenMathLib/OpenBLAS

Issues semelhantes

Mais issues de C

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.