Vim configuration for Linux kernel development [closed]

Main differences between Linux kernel and regular C project (from developer’s point of view) are next: kernel is very big project (so you should choose which code to index) it has architecture dependent code (and you are only interested in one specific architecture at a time; other architectures shouldn’t be indexed) it has very specific … Read more

How are user-level threads scheduled/created, and how are kernel level threads created?

This is prefaced by the top comments. The documentation you’re reading is generic [not linux specific] and a bit outdated. And, more to the point, it is using different terminology. That is, I believe, the source of the confusion. So, read on … What it calls a “user-level” thread is what I’m calling an [outdated] … Read more

What is a Kernel thread?

A kernel thread is a task_struct with no userspace components. Besides the lack of userspace, it has different ancestors (kthreadd kernel thread instead of the init process) and is created by a kernel-only API instead of sequences of clone from fork/exec system calls. Two kernel threads have kthreadd as a parent. Apart from that, kernel … Read more

How to continuously monitor the directory using dnotify /inotify command

Inotify itself is a kernel module accesible via calls from e.g. a C program. https://linux.die.net/man/7/inotify There is an application suite called inotify-tools, which contains: inotifywait – wait for changes to files using inotify http://linux.die.net/man/1/inotifywait and inotifywatch – gather filesystem access statistics using inotify http://linux.die.net/man/1/inotifywatch You can use inotify directly from command line, e.g. like this … Read more

Measuring NUMA (Non-Uniform Memory Access). No observable asymmetry. Why?

The first thing I want to point out is that you might want to double-check which cores are on each node. I don’t recall cores and nodes being interleaved like that. Also, you should have 16 threads due to HT. (unless you disabled it) Another thing: The socket 1366 Xeon machines are only slightly NUMA. … Read more

What does it mean to say “linux kernel is preemptive”?

Prior to Linux kernel version 2.5.4, Linux Kernel was not preemptive which means a process running in kernel mode cannot be moved out of processor until it itself leaves the processor or it starts waiting for some input output operation to get complete. Generally a process in user mode can enter into kernel mode using … Read more

Configuring ARP age timeout [closed]

The neighbor cache in the Linux kernel isn’t as simple as one would think. I’ll try to explain some of the quirks with it. There are subtle differences between an neighbor cache entry actually falling out of the cache entirely or just being marked as stale/invalid. At some point between base_reachable_time/2 and 3*base_reachable_time/2, the entry … Read more