Skip to content

Commit 7466237

Browse files
XuNeoxiaoxiang781216
authored andcommitted
mm/Kconfig: adjust config options order and fix typos
Signed-off-by: Neo Xu <[email protected]>
1 parent 533c11e commit 7466237

File tree

1 file changed

+127
-127
lines changed

1 file changed

+127
-127
lines changed

mm/Kconfig

Lines changed: 127 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,104 @@ config MM_MAP_COUNT_MAX
104104
---help---
105105
The maximum number of memory map areas for each task.
106106

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+
107205
config ARCH_HAVE_HEAP2
108206
bool
109207
default n
@@ -137,10 +235,11 @@ config GRAN
137235
allocation size to 32 granules. That restriction could be
138236
eliminated with some additional coding effort.
139237

238+
if GRAN
239+
140240
config GRAN_INTR
141241
bool "Interrupt level support"
142242
default n
143-
depends on GRAN
144243
---help---
145244
Normally mutual exclusive access to granule allocator data is assured
146245
using a semaphore. If this option is set then, instead, mutual
@@ -151,11 +250,13 @@ config GRAN_INTR
151250
config DEBUG_GRAN
152251
bool "Granule Allocator Debug"
153252
default n
154-
depends on GRAN && DEBUG_FEATURES
253+
depends on DEBUG_FEATURES
155254
---help---
156255
Just like DEBUG_MM, but only generates output from the gran
157256
allocation logic.
158257

258+
endif # GRAN
259+
159260
config MM_PGALLOC
160261
bool "Enable Page Allocator"
161262
default n
@@ -205,46 +306,6 @@ config MM_KMAP
205306
kernel virtual memory. This includes pages that are already mapped
206307
for user.
207308

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-
248309
config MM_HEAP_MEMPOOL_BACKTRACE_SKIP
249310
int "The skip depth of backtrace for mempool"
250311
default 6
@@ -253,9 +314,9 @@ config MM_HEAP_MEMPOOL_BACKTRACE_SKIP
253314
This number is the skipped backtrace depth for mempool.
254315

255316
config FS_PROCFS_EXCLUDE_MEMPOOL
256-
bool "Exclude mempool"
317+
bool "Exclude mempool from procfs"
257318
default DEFAULT_SMALL
258-
depends on FS_PROCFS
319+
depends on FS_PROCFS && MM_HEAP_MEMPOOL_THRESHOLD > 0
259320

260321
config MM_KASAN
261322
bool "Kernel Address Sanitizer"
@@ -319,7 +380,7 @@ config MM_KASAN_DISABLE_READS_CHECK
319380
bool "Disable reads check"
320381
default n
321382
---help---
322-
This option disable kasan reads check. It speeds up performance
383+
This option disables kasan reads check. It speeds up performance
323384
compared with default read/write check. Only disable it when you are
324385
sure there's no need to do so. Or performance is too bad and only focus
325386
on writes check.
@@ -328,13 +389,27 @@ config MM_KASAN_DISABLE_WRITES_CHECK
328389
bool "Disable writes check"
329390
default n
330391
---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.
332407

333408
config MM_KASAN_SKIP_ZERO_TAGS
334409
bool "Enable skip check zero tags"
335410
default LIBC_MODLIB
336411
---help---
337-
This option enables not checking for zero tags.
412+
This option disables checking for zero tags.
338413

339414
config MM_KASAN_GLOBAL
340415
bool "Enable global data check"
@@ -351,31 +426,14 @@ config MM_KASAN_GLOBAL
351426
KEEP ( *(. data. rel. local.. LASAN0))
352427
}", used to extract data generated by the compiler
353428

354-
if MM_KASAN_GLOBAL
355-
356429
config MM_KASAN_GLOBAL_ALIGN
357430
int "KASan global alignment"
358431
default 1
432+
depends on MM_KASAN_GLOBAL
359433
---help---
360434
It is recommended to use 1, 2, 4, 8, 16, 32.
361435
The maximum value is 32.
362436

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-
379437
endif # MM_KASAN
380438

381439
config MM_UBSAN
@@ -386,9 +444,10 @@ config MM_UBSAN
386444
the program at compile-time to catch various kinds of
387445
undefined behavior during program execution
388446

447+
if MM_UBSAN
448+
389449
config MM_UBSAN_ALL
390450
bool "Enable UBSan for the entire image"
391-
depends on MM_UBSAN
392451
default y
393452
---help---
394453
This option activates UBSan instrumentation for the
@@ -400,7 +459,6 @@ config MM_UBSAN_ALL
400459

401460
config MM_UBSAN_OPTION
402461
string "UBSan options"
403-
depends on MM_UBSAN
404462
default "-fsanitize=undefined"
405463
---help---
406464
This option activates specified UBSan instrumentation. Please
@@ -409,7 +467,6 @@ config MM_UBSAN_OPTION
409467

410468
config MM_UBSAN_TRAP_ON_ERROR
411469
bool "Enable UBSan trap on error to crash immediately"
412-
depends on MM_UBSAN
413470
default n
414471
---help---
415472
The undefined instruction trap should cause your program to crash,
@@ -418,66 +475,9 @@ config MM_UBSAN_TRAP_ON_ERROR
418475
config MM_UBSAN_DUMMY
419476
bool "Bypass Undefined Behaviour Sanitizer Runtime Actions"
420477
default n
421-
depends on MM_UBSAN
422478
---help---
423-
Keep UBSAN compile time but disable runtime actions.
479+
Allow to compile with UBSAN enabled but disables runtime actions.
424480

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
482482

483483
source "mm/iob/Kconfig"

0 commit comments

Comments
 (0)