Skip to content

Accept single-bit ranges in bitmap lists - #15464

Open
copybara-service[bot] wants to merge 1 commit into
masterfrom
test/cl995314862
Open

copybara-service[bot] wants to merge 1 commit into
masterfrom
test/cl995314862

Conversation

@copybara-service

Copy link
Copy Markdown

Accept single-bit ranges in bitmap lists

Writing "1-1" to cpuset.cpus failed with EINVAL because the bitmap
parser rejected ranges with equal endpoints. CpusetCgroup.SetMask
reaches this case on a two-CPU system when it removes CPU 0 from the
initial mask. Linux accepts equal endpoints as a single-bit range 1.

Reject only descending ranges and correct the existing parser case that
expected an equal-endpoint range to fail. This applies to both cgroup
versions, whose CPU and memory-node masks use the same parser.

Assisted-by: OpenAI Codex

FUTURE_COPYBARA_INTEGRATE_REVIEW=#15446 from tamird:bitmap-inclusive-ranges 01d6bdf

Writing "1-1" to cpuset.cpus failed with EINVAL because the bitmap
parser rejected ranges with equal endpoints. CpusetCgroup.SetMask
reaches this case on a two-CPU system when it removes CPU 0 from the
initial mask. Linux accepts equal endpoints as a single-bit range [1].

Reject only descending ranges and correct the existing parser case that
expected an equal-endpoint range to fail. This applies to both cgroup
versions, whose CPU and memory-node masks use the same parser.

[1]: https://github.com/torvalds/linux/blob/e5f0a698b/lib/bitmap-str.c#L220-L231

Assisted-by: OpenAI Codex

<!-- codex-thread: 01a0680f-bbf5-7511-95f7-4414f4e10d2e -->

FUTURE_COPYBARA_INTEGRATE_REVIEW=#15446 from tamird:bitmap-inclusive-ranges 01d6bdf
PiperOrigin-RevId: 995314862
@copybara-service copybara-service Bot added the exported Issue was exported automatically label Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exported Issue was exported automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant