@@ -104,6 +104,104 @@ config MM_MAP_COUNT_MAX
104
104
---help---
105
105
The maximum number of memory map areas for each task.
106
106
107
+ config MM_FILL_ALLOCATIONS
108
+ bool "Fill allocations with debug value"
109
+ default n
110
+ ---help---
111
+ Fill all malloc() allocations with MM_ALLOC_MAGIC.
112
+ Fill all add_addregion() with MM_INIT_MAGIC.
113
+ Fill all free() with MM_FREE_MAGIC.
114
+ This helps detecting uninitialized variable errors.
115
+
116
+ config MM_BACKTRACE
117
+ int "The depth of backtrace"
118
+ default -1
119
+ ---help---
120
+ Config the depth of backtrace in memory block by specified this
121
+ config: disable backtrace by -1, only record pid info by zero and
122
+ enable record backtrace info by 8(fixed depth).
123
+
124
+ config MM_BACKTRACE_SKIP
125
+ int "The skip depth of backtrace"
126
+ depends on MM_BACKTRACE > 0
127
+ default 3
128
+
129
+ config MM_BACKTRACE_DEFAULT
130
+ bool "Enable the backtrace record by default"
131
+ default n
132
+ depends on MM_BACKTRACE > 0
133
+
134
+ config MM_DUMP_ON_FAILURE
135
+ bool "Dump heap info on allocation failure"
136
+ default n
137
+ depends on DEBUG_MM
138
+
139
+ config MM_DUMP_DETAILS_ON_FAILURE
140
+ bool "Dump all used memory blocks on allocation failure"
141
+ default n
142
+ depends on MM_DUMP_ON_FAILURE
143
+
144
+ config MM_PANIC_ON_FAILURE
145
+ bool "Panic on allocation failure"
146
+ default n
147
+ depends on DEBUG_MM
148
+
149
+ config MM_FREE_DELAYCOUNT_MAX
150
+ int "Maximum memory nodes can be delayed to free"
151
+ default 0
152
+ ---help---
153
+ Set to 0 to disable the delayed free mechanism. Otherwise,
154
+ the value decides the maximum number of memory nodes that
155
+ will be delayed to free.
156
+
157
+ config MM_HEAP_BIGGEST_COUNT
158
+ int "The largest malloc element dump count"
159
+ default 30
160
+ ---help---
161
+ The dump support for largest allocated memory.
162
+ If too big, should take care of stack usage.
163
+ Define 0 to disable largest allocated element dump feature.
164
+
165
+ config MM_HEAP_MEMPOOL_THRESHOLD
166
+ int "Threshold for malloc size to use multi-level mempool"
167
+ default -1
168
+ ---help---
169
+ If the size of the memory requested by the user is less
170
+ than the threshold, the memory will be requested from the
171
+ multiple mempool by default.
172
+ > 0 Enable pool feature, and set umm/kmm pool threshold size.
173
+ == 0 Enable pool feature, but disable the umm/kmm pool function.
174
+ < 0 Disable pool feature.
175
+
176
+ if MM_HEAP_MEMPOOL_THRESHOLD > 0
177
+
178
+ config MM_HEAP_MEMPOOL_EXPAND_SIZE
179
+ int "The expand size for each mempool in multiple mempool"
180
+ default 4096
181
+ ---help---
182
+ This size describes the size of each expansion of each memory
183
+ pool with insufficient memory in the multi-level memory pool.
184
+
185
+ config MM_HEAP_MEMPOOL_DICTIONARY_EXPAND_SIZE
186
+ int "The expand size for multiple mempool's dictionary"
187
+ default MM_HEAP_MEMPOOL_EXPAND_SIZE
188
+ ---help---
189
+ This size describes the multiple mempool dictionary expand.
190
+
191
+ config MM_HEAP_MEMPOOL_CHUNK_SIZE
192
+ int "The multiples pool chunk size"
193
+ default 0
194
+ ---help---
195
+ This size describes the multiple mempool chunk size.
196
+
197
+ config MM_MIN_BLKSIZE
198
+ int "Minimum memory block size"
199
+ default 0
200
+ ---help---
201
+ Users can configure the minimum memory block size as needed
202
+
203
+ endif # MM_HEAP_MEMPOOL_THRESHOLD > 0
204
+
107
205
config ARCH_HAVE_HEAP2
108
206
bool
109
207
default n
@@ -137,10 +235,11 @@ config GRAN
137
235
allocation size to 32 granules. That restriction could be
138
236
eliminated with some additional coding effort.
139
237
238
+ if GRAN
239
+
140
240
config GRAN_INTR
141
241
bool "Interrupt level support"
142
242
default n
143
- depends on GRAN
144
243
---help---
145
244
Normally mutual exclusive access to granule allocator data is assured
146
245
using a semaphore. If this option is set then, instead, mutual
@@ -151,11 +250,13 @@ config GRAN_INTR
151
250
config DEBUG_GRAN
152
251
bool "Granule Allocator Debug"
153
252
default n
154
- depends on GRAN && DEBUG_FEATURES
253
+ depends on DEBUG_FEATURES
155
254
---help---
156
255
Just like DEBUG_MM, but only generates output from the gran
157
256
allocation logic.
158
257
258
+ endif # GRAN
259
+
159
260
config MM_PGALLOC
160
261
bool "Enable Page Allocator"
161
262
default n
@@ -205,46 +306,6 @@ config MM_KMAP
205
306
kernel virtual memory. This includes pages that are already mapped
206
307
for user.
207
308
208
- config MM_HEAP_MEMPOOL_THRESHOLD
209
- int "The default size of threshold to avoid using multiple mempool in heap"
210
- default -1
211
- ---help---
212
- If the size of the memory requested by the user is less
213
- than the threshold, the memory will be requested from the
214
- multiple mempool by default.
215
- > 0 Enable pool feature, and set umm/kmm pool threshold size.
216
- == 0 Enable pool feature, but disable the umm/kmm pool function.
217
- < 0 Disable pool feature.
218
-
219
- if MM_HEAP_MEMPOOL_THRESHOLD > 0
220
-
221
- config MM_HEAP_MEMPOOL_EXPAND_SIZE
222
- int "The expand size for each mempool in multiple mempool"
223
- default 4096
224
- ---help---
225
- This size describes the size of each expansion of each memory
226
- pool with insufficient memory in the multi-level memory pool.
227
-
228
- config MM_HEAP_MEMPOOL_DICTIONARY_EXPAND_SIZE
229
- int "The expand size for multiple mempool's dictionary"
230
- default MM_HEAP_MEMPOOL_EXPAND_SIZE
231
- ---help---
232
- This size describes the multiple mempool dictionary expand.
233
-
234
- config MM_HEAP_MEMPOOL_CHUNK_SIZE
235
- int "The multiples pool chunk size"
236
- default 0
237
- ---help---
238
- This size describes the multiple mempool chunk size.
239
-
240
- config MM_MIN_BLKSIZE
241
- int "Minimum memory block size"
242
- default 0
243
- ---help---
244
- Users can configure the minimum memory block size as needed
245
-
246
- endif # MM_HEAP_MEMPOOL_THRESHOLD > 0
247
-
248
309
config MM_HEAP_MEMPOOL_BACKTRACE_SKIP
249
310
int "The skip depth of backtrace for mempool"
250
311
default 6
@@ -253,9 +314,9 @@ config MM_HEAP_MEMPOOL_BACKTRACE_SKIP
253
314
This number is the skipped backtrace depth for mempool.
254
315
255
316
config FS_PROCFS_EXCLUDE_MEMPOOL
256
- bool "Exclude mempool"
317
+ bool "Exclude mempool from procfs "
257
318
default DEFAULT_SMALL
258
- depends on FS_PROCFS
319
+ depends on FS_PROCFS && MM_HEAP_MEMPOOL_THRESHOLD > 0
259
320
260
321
config MM_KASAN
261
322
bool "Kernel Address Sanitizer"
@@ -319,7 +380,7 @@ config MM_KASAN_DISABLE_READS_CHECK
319
380
bool "Disable reads check"
320
381
default n
321
382
---help---
322
- This option disable kasan reads check. It speeds up performance
383
+ This option disables kasan reads check. It speeds up performance
323
384
compared with default read/write check. Only disable it when you are
324
385
sure there's no need to do so. Or performance is too bad and only focus
325
386
on writes check.
@@ -328,13 +389,27 @@ config MM_KASAN_DISABLE_WRITES_CHECK
328
389
bool "Disable writes check"
329
390
default n
330
391
---help---
331
- This option disable kasan writes check.
392
+ This option disables kasan writes check.
393
+
394
+ config MM_KASAN_DISABLE_READ_PANIC
395
+ bool "Disable panic on kasan read error"
396
+ default n
397
+ ---help---
398
+ This option disables panic on kasan read error. It will print error info
399
+ and continue to run.
400
+
401
+ config MM_KASAN_DISABLE_WRITE_PANIC
402
+ bool "Disable panic on kasan write error"
403
+ default n
404
+ ---help---
405
+ This option disables panic on kasan write error. It will print error info
406
+ and continue to run.
332
407
333
408
config MM_KASAN_SKIP_ZERO_TAGS
334
409
bool "Enable skip check zero tags"
335
410
default LIBC_MODLIB
336
411
---help---
337
- This option enables not checking for zero tags.
412
+ This option disables checking for zero tags.
338
413
339
414
config MM_KASAN_GLOBAL
340
415
bool "Enable global data check"
@@ -351,31 +426,14 @@ config MM_KASAN_GLOBAL
351
426
KEEP ( *(. data. rel. local.. LASAN0))
352
427
}", used to extract data generated by the compiler
353
428
354
- if MM_KASAN_GLOBAL
355
-
356
429
config MM_KASAN_GLOBAL_ALIGN
357
430
int "KASan global alignment"
358
431
default 1
432
+ depends on MM_KASAN_GLOBAL
359
433
---help---
360
434
It is recommended to use 1, 2, 4, 8, 16, 32.
361
435
The maximum value is 32.
362
436
363
- endif # MM_KASAN_GLOBAL
364
-
365
- config MM_KASAN_DISABLE_READ_PANIC
366
- bool "Disable panic on kasan read error"
367
- default n
368
- ---help---
369
- This option disable panic on kasan read error. It will print error info
370
- and continue to run.
371
-
372
- config MM_KASAN_DISABLE_WRITE_PANIC
373
- bool "Disable panic on kasan write error"
374
- default n
375
- ---help---
376
- This option disable panic on kasan write error. It will print error info
377
- and continue to run.
378
-
379
437
endif # MM_KASAN
380
438
381
439
config MM_UBSAN
@@ -386,9 +444,10 @@ config MM_UBSAN
386
444
the program at compile-time to catch various kinds of
387
445
undefined behavior during program execution
388
446
447
+ if MM_UBSAN
448
+
389
449
config MM_UBSAN_ALL
390
450
bool "Enable UBSan for the entire image"
391
- depends on MM_UBSAN
392
451
default y
393
452
---help---
394
453
This option activates UBSan instrumentation for the
@@ -400,7 +459,6 @@ config MM_UBSAN_ALL
400
459
401
460
config MM_UBSAN_OPTION
402
461
string "UBSan options"
403
- depends on MM_UBSAN
404
462
default "-fsanitize=undefined"
405
463
---help---
406
464
This option activates specified UBSan instrumentation. Please
@@ -409,7 +467,6 @@ config MM_UBSAN_OPTION
409
467
410
468
config MM_UBSAN_TRAP_ON_ERROR
411
469
bool "Enable UBSan trap on error to crash immediately"
412
- depends on MM_UBSAN
413
470
default n
414
471
---help---
415
472
The undefined instruction trap should cause your program to crash,
@@ -418,66 +475,9 @@ config MM_UBSAN_TRAP_ON_ERROR
418
475
config MM_UBSAN_DUMMY
419
476
bool "Bypass Undefined Behaviour Sanitizer Runtime Actions"
420
477
default n
421
- depends on MM_UBSAN
422
478
---help---
423
- Keep UBSAN compile time but disable runtime actions.
479
+ Allow to compile with UBSAN enabled but disables runtime actions.
424
480
425
- config MM_FILL_ALLOCATIONS
426
- bool "Fill allocations with debug value"
427
- default n
428
- ---help---
429
- Fill all malloc() allocations with MM_ALLOC_MAGIC.
430
- Fill all add_addregion() with MM_INIT_MAGIC.
431
- Fill all free() with MM_FREE_MAGIC.
432
- This helps detecting uninitialized variable errors.
433
-
434
- config MM_BACKTRACE
435
- int "The depth of backtrace"
436
- default -1
437
- ---help---
438
- Config the depth of backtrace in memory block by specified this
439
- config: disable backtrace by -1, only record pid info by zero and
440
- enable record backtrace info by 8(fixed depth).
441
-
442
- config MM_BACKTRACE_SKIP
443
- int "The skip depth of backtrace"
444
- depends on MM_BACKTRACE > 0
445
- default 3
446
-
447
- config MM_BACKTRACE_DEFAULT
448
- bool "Enable the backtrace record by default"
449
- default n
450
- depends on MM_BACKTRACE > 0
451
-
452
- config MM_DUMP_ON_FAILURE
453
- bool "Dump heap info on allocation failure"
454
- default n
455
- depends on DEBUG_MM
456
-
457
- config MM_DUMP_DETAILS_ON_FAILURE
458
- bool "Dump all used memory blocks on allocation failure"
459
- default n
460
- depends on MM_DUMP_ON_FAILURE
461
-
462
- config MM_PANIC_ON_FAILURE
463
- bool "Panic on allocation failure"
464
- default n
465
- depends on DEBUG_MM
466
-
467
- config MM_FREE_DELAYCOUNT_MAX
468
- int "Maximum memory nodes can be delayed to free"
469
- default 0
470
- ---help---
471
- Set to 0 to disable the delayed free mechanism. Otherwise,
472
- the value decides the maximum number of memory nodes that
473
- will be delayed to free.
474
-
475
- config MM_HEAP_BIGGEST_COUNT
476
- int "The largest malloc element dump count"
477
- default 30
478
- ---help---
479
- The dump support for largest allocated memory.
480
- If too big, should take care of stack usage.
481
- Define 0 to disable largest allocated element dump feature.
481
+ endif # MM_UBSAN
482
482
483
483
source "mm/iob/Kconfig"
0 commit comments