How to use lockdep feature in linux kernel for deadlock detection

[*] To enable lockdep feature, edit .config file through menuconfig: make menuconfig And enable following in Hacking Options: 1. [*] Detect Hard and Soft Lockups 2. [*] Detect Hung Tasks 3. [*] RT Mutex debugging, deadlock detection 4. -*- Spinlock and rw-lock debugging: basic checks 5. -*- Mutex debugging: basic checks 6. -*- Lock debugging: … Read more

Docker loading kernel modules

In Linux host: Run the container in privileged mode (–privileged) Add all capabilities (–cap-add=ALL) mount host /lib/modules into the container (-v /lib/modules:/lib/modules) docker run –name container_name \ –privileged \ –cap-add=ALL -d \ -v /dev:/dev \ -v /lib/modules:/lib/modules \ image_id Caution: Here all Linux capabilities are added so capabilities can be refined. Few words about Linux … Read more

Windows 2008 R2 – Kernel (System Process PID=4) is locking files and folders

As Dani has already mentioned in the comment: It’s a bug in Windows 7 and likely in Windows Server 2008 (possibly 64bit versions only). It surfaces when you disable Application Experience service. Re-enabling this service has fixed this problem for me. A bit more info here as to why it’s causing a problem. List of … Read more

addr2line on kernel module

I suppose the module is built with debug info included. If so, you can use gdb or objdump to find out which source file and line each address belongs to. Something like this: $ gdb “$(modinfo -n my_module)” (gdb) list *(some_function+0x12c) Gdb will now tell the name of the source file and the line in … Read more

kernel symbol marked with “T” in /proc/kallsyms is not exported

Mark “T” in /proc/kallsyms means that symbol is globally visible, and can be used in other kernel’s code (e.g. by drivers, compiled built-in). But for being usable in kernel module’s code, symbol is needed to be exported using EXPORT_SYMBOL or similar. List of exported symbols is maintained separately from list of all symbols in the … Read more

Does linux schedule a process or a thread?

The Linux scheduler (on recent Linux kernels, e.g. 3.0 at least) is scheduling schedulable tasks or simply tasks. A task may be : a single-threaded process (e.g. created by fork without any thread library) any thread inside a multi-threaded process (including its main thread), in particular Posix threads (pthreads) kernel tasks, which are started internally … Read more