打开debug选项,可以选择指定的 slub name, 通过逗号隔开 debug option 当前可以选择调试类型,及开关控制字符 F Sanity checks on (SLAB_DEBUG_CONSISTENCY_CHECKS) Z Red zoning(SLAB_RED_ZONE) P Poisoning (object and padding) SLAB_POISON U User tracking (free and alloc) SLAB_STORE_USER T Trace (...
SLAB/SLUB debugging KASAN kmemcheck DEBUG_PAGEALLOC Slab debugging Slab 调试使用内存中毒技术来检测 SLAB/SUB 分配器中的几种类型的内存错误。分配的缓冲区由已填充特殊标记的内存保护。稍后,当对该缓冲区执行其他内存管理操作时(例如,释放缓冲区时),将检测到对该缓冲区的任何相邻写入。在分配缓冲区时,缓冲区还会...
In linux mm folder, there are 3 files that about kmalloc/kmem, slab/slub/slob, where slab.c defines general memory usage, slub.c defines modern memory usage, and slob.c defines embedded device memory usage. The principle behind these 3 files are almost the same, to prevent memory fragmenta...
/*获得对象所在的slab的第一个物理页*/ page = virt_to_head_page(x); slab_free(s, page, x, _RET_IP_); trace_kmem_cache_free(_RET_IP_, x); } 通过调用virt_to_head_page获得这个slab的第一个物理页的page结构。 static inline struct page *virt_to_head_page(const void *x) { struct ...
1.build kernel之时的各个configuration选项。 2.当kernel启动之时,可以参数在kernel被GRUB或LILO等启动程序调用之时传递给kernel。 3.在kernel运行时,修改/proc或/sys目录下的文件。 这里我简单讲的就是第二种方式了,kernel在grub中配置的启动参数。 首先,kernel有哪些参数呢? 在linux的源代码中,有这样的一个文档...
slab_post_alloc_hook(s, gfpflags, object); return object; } 走slowpath: static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, unsigned long addr, struct kmem_cache_cpu *c) { void **object; struct page *new; ...
768 slab_alloc_node mm/slub.c:3478 [inline] __kmem_cache_alloc_node+0x5c9/0x970 mm/slub.c:3517 __do_kmalloc_node mm/slab_common.c:1006 [inline] __kmalloc+0x121/0x3c0 mm/slab_common.c:1020 kmalloc include/linux/slab.h:604 [inline] do_sys_name_to_handle fs/fhandle.c:39 [...
Commit 5a836bf ("mm: slub: move flush_cpu_slab() invocations __free_slab() invocations out of IRQ context") moved all flush_cpu_slab() invocations to the global workqueue to avoid a problem related with deactivate_slab()/__free_slab() being called from an IRQ context on PREEMPT_RT ...
2019: "Hands Off and Putting SLAB/SLUB Feng Shui in Blackbox" by Yueqi (Lewis) Chen at Black Hat Europe [slides] [code]2019: "SLAKE: Facilitating Slab Manipulation for Exploiting Vulnerabilities in the Linux Kernel" by Yueqi (Lewis) Chen and Xinyu Xing [slides] [paper]...
'.' plus parameter name, with '=' and value if appropriate, such as: usbcore.blinkenlights=1 Hyphens (dashes) and underscores are equivalent in parameter names, so log_buf_len=1M print-fatal-signals=1 can also be entered as log-buf-len=1M print_fatal_signals=1 ...