Skip to content

Commit 40474dd

Browse files
author
Mrunal Patel
authored
Merge pull request #704 from hqhq/use_uint64_for_memory
Set specs value the same as kernel API input
2 parents 2db8391 + ec94491 commit 40474dd

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

config-linux.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,15 +285,15 @@ For more information, see [the memory cgroup man page][cgroup-v1-memory].
285285

286286
The following parameters can be specified to setup the controller:
287287

288-
* **`limit`** *(int64, OPTIONAL)* - sets limit of memory usage in bytes
288+
* **`limit`** *(uint64, OPTIONAL)* - sets limit of memory usage in bytes
289289

290-
* **`reservation`** *(int64, OPTIONAL)* - sets soft limit of memory usage in bytes
290+
* **`reservation`** *(uint64, OPTIONAL)* - sets soft limit of memory usage in bytes
291291

292-
* **`swap`** *(int64, OPTIONAL)* - sets limit of memory+Swap usage
292+
* **`swap`** *(uint64, OPTIONAL)* - sets limit of memory+Swap usage
293293

294-
* **`kernel`** *(int64, OPTIONAL)* - sets hard limit for kernel memory
294+
* **`kernel`** *(uint64, OPTIONAL)* - sets hard limit for kernel memory
295295

296-
* **`kernelTCP`** *(int64, OPTIONAL)* - sets hard limit in bytes for kernel TCP buffer memory
296+
* **`kernelTCP`** *(uint64, OPTIONAL)* - sets hard limit in bytes for kernel TCP buffer memory
297297

298298
* **`swappiness`** *(uint64, OPTIONAL)* - sets swappiness parameter of vmscan (See sysctl's vm.swappiness)
299299

@@ -414,7 +414,7 @@ Each entry has the following structure:
414414

415415
* **`pageSize`** *(string, REQUIRED)* - hugepage size
416416

417-
* **`limit`** *(int64, REQUIRED)* - limit in bytes of *hugepagesize* HugeTLB usage
417+
* **`limit`** *(uint64, REQUIRED)* - limit in bytes of *hugepagesize* HugeTLB usage
418418

419419
###### Example
420420

schema/config-linux.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
"type": "string"
164164
},
165165
"limit": {
166-
"$ref": "defs.json#/definitions/int64"
166+
"$ref": "defs.json#/definitions/uint64"
167167
}
168168
},
169169
"required": [
@@ -178,23 +178,23 @@
178178
"properties": {
179179
"kernel": {
180180
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/kernel",
181-
"$ref": "defs.json#/definitions/int64"
181+
"$ref": "defs.json#/definitions/uint64"
182182
},
183183
"kernelTCP": {
184184
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/kernelTCP",
185-
"$ref": "defs.json#/definitions/int64"
185+
"$ref": "defs.json#/definitions/uint64"
186186
},
187187
"limit": {
188188
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/limit",
189-
"$ref": "defs.json#/definitions/int64"
189+
"$ref": "defs.json#/definitions/uint64"
190190
},
191191
"reservation": {
192192
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/reservation",
193-
"$ref": "defs.json#/definitions/int64"
193+
"$ref": "defs.json#/definitions/uint64"
194194
},
195195
"swap": {
196196
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/swap",
197-
"$ref": "defs.json#/definitions/int64"
197+
"$ref": "defs.json#/definitions/uint64"
198198
},
199199
"swappiness": {
200200
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/swappiness",

specs-go/config.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ type LinuxHugepageLimit struct {
225225
// Pagesize is the hugepage size
226226
Pagesize string `json:"pageSize"`
227227
// Limit is the limit of "hugepagesize" hugetlb usage
228-
Limit int64 `json:"limit"`
228+
Limit uint64 `json:"limit"`
229229
}
230230

231231
// LinuxInterfacePriority for network interfaces
@@ -281,15 +281,15 @@ type LinuxBlockIO struct {
281281
// LinuxMemory for Linux cgroup 'memory' resource management
282282
type LinuxMemory struct {
283283
// Memory limit (in bytes).
284-
Limit *int64 `json:"limit,omitempty"`
284+
Limit *uint64 `json:"limit,omitempty"`
285285
// Memory reservation or soft_limit (in bytes).
286-
Reservation *int64 `json:"reservation,omitempty"`
286+
Reservation *uint64 `json:"reservation,omitempty"`
287287
// Total memory limit (memory + swap).
288-
Swap *int64 `json:"swap,omitempty"`
288+
Swap *uint64 `json:"swap,omitempty"`
289289
// Kernel memory limit (in bytes).
290-
Kernel *int64 `json:"kernel,omitempty"`
290+
Kernel *uint64 `json:"kernel,omitempty"`
291291
// Kernel memory limit for tcp (in bytes)
292-
KernelTCP *int64 `json:"kernelTCP,omitempty"`
292+
KernelTCP *uint64 `json:"kernelTCP,omitempty"`
293293
// How aggressive the kernel will swap memory pages. Range from 0 to 100.
294294
Swappiness *uint64 `json:"swappiness,omitempty"`
295295
}

0 commit comments

Comments
 (0)