Skip to content

Not making full use of parallelism in jobserver mode #2683

@juergbi

Description

@juergbi

When ninja runs as a jobserver client, it first starts as many commands as tokens it can acquire and then waits for the first pending command to finish. Only then will it again try to acquire tokens and start more commands.

If the jobserver has multiple clients (could be multiple ninja processes or a mix of build systems), it's possible that a token becomes available before the next pending command (of a given ninja process) finishes. In the time between the token becoming available and the next command finishing, the parallelism set by the jobserver is not fully utilized.

@digit-google Is this a known limitation? Are there any plans to improve this? I'm not familiar with the ninja code base, but it may be possible to add the jobserver FIFO to the ppoll() or pselect() call to allow reacting when a jobserver token becomes available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions