Skip to content
This repository was archived by the owner on Mar 11, 2020. It is now read-only.

Conversation

@tiborvass
Copy link

@tiborvass tiborvass commented Jul 6, 2017

The kernel ABI to these values is a string, which accepts the value -1
to mean "unlimited" or an integer up to 2^63 for an amount of memory in
bytes.

While the internal representation in the kernel is unsigned, this is not
exposed in any ABI directly. Because of the user-kernel memory split, values
over 2^63 are not really useful; indeed that much memory is not supported,
as physical memory is limited to 52 bits in the forthcoming switch to five
level page tables. So it is much more natural to support the value -1 for
unlimited, especially as the actual number needed to represent the maximum
has varied in different kernel versions, and across 32 and 64 bit architectures,
so determining the value to use is not possible, so it is necessary to write
the string -1 to the cgroup files.

See also discussion in

Signed-off-by: Justin Cormack [email protected]

(cherry picked from commit e73cd70)
Signed-off-by: Tibor Vass [email protected]

From opencontainers#876

cc @justincormack @crosbymichael

The kernel ABI to these values is a string, which accepts the value `-1`
to mean "unlimited" or an integer up to 2^63 for an amount of memory in
bytes.

While the internal representation in the kernel is unsigned, this is not
exposed in any ABI directly. Because of the user-kernel memory split, values
over 2^63 are not really useful; indeed that much memory is not supported,
as physical memory is limited to 52 bits in the forthcoming switch to five
level page tables. So it is much more natural to support the value `-1` for
unlimited, especially as the actual number needed to represent the maximum
has varied in different kernel versions, and across 32 and 64 bit architectures,
so determining the value to use is not possible, so it is necessary to write
the string `-1` to the cgroup files.

See also discussion in
- opencontainers/runc#1494
- opencontainers/runc#1492
- opencontainers/runc#1375
- opencontainers/runc#1421

Signed-off-by: Justin Cormack <[email protected]>
(cherry picked from commit e73cd70)
Signed-off-by: Tibor Vass <[email protected]>
@tiborvass tiborvass changed the title Make Linux memory allocations int64 not uint64 [17.06.1] Make Linux memory allocations int64 not uint64 Jul 6, 2017
@justincormack
Copy link

justincormack commented Jul 6, 2017 via email

@crosbymichael
Copy link

LFTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants