When Linux kernel runs on NUMA, each NUMA node has partially separate memory management. There is echo ‘?’ > /proc/sysrq-trigger function “Will dump current memory info to your console.” of SysRq (implemented as sysrq_handle_showmem and show_mem) to get basic memory statistics for every NUMA node to system console, dmesg and system kernel log. As I understand, there is data printed
Tag: linux-kernel
I’ve added a MAX7320 i2c output chip. How can I get the kernel to load the driver for it?
I’ve added a MAX7320 i2c expander chip to i2c bus 0 on my ARM Linux board. The chip works correctly from userspace with commands such as /usr/sbin/i2cset -y 0 0x5d 0x02 and /usr/sbin/i2cget -y 0 0x5d. There is a drivers/gpio/gpio-max732x.c file in the kernel source, which is compiled into the kernel that I’m running. (I’ve built it from source.) How
Reading in kernel second time overrides first instance
I have written a read function to read a file into buffer in Kernel space. Now, this function works really well and I am able to read contents of filename into buf by calling this function from my system call Then, I am calling this function again to read contents of secondfile into secondbuffer. The problem is that after calling
Linux user space threads, kernel threads , lightweight processes
I am bit confused with all this enteties and how they interconnected in Linux. “Unix internals” book states that lightweight process (LWP) is kernel-supported user thread, and that kernel doesn’t see threads inside processes. Is it stil true for Linux? As I understand, user-space threads scheduled inside process, by higher level abstraction as pthread library, without kernel’s intervention. Am I
infinite loop malloc in a 32 bit kernel with 4 Gb RAM and 10 Gb Swap Partition
Let’s say I have a 32-bit kernel. 4 Gb RAM, 10 Gb Swap Partition. I have a process which has malloc in an infinite loop. So, eventually system’s OOM would kill the process. Here are two arguments. Argument 1: Since, it’s 32 bit Kernel with a Virtual address split of 3:1 i.e. 3Gb for user space and 1 Gb for
how to return a phys_addr_t type value to user space
I need my driver to return phys_addr_t type value through an ioctl call. I need to return this value through a struct which is passed through arg. The question is what type do I use in this struct? For example, say the following struct is passed through an arg virt_to_phys returns a phys_addr_t, however this type doesn’t seem to exist
Security concerns around KSM
When using KSM (Kernel Same-page Mapping), if two completely identical pages of memory are owned by two completely isolated processes, for example, two virtual machines, will those pages be merged? Or will they remain separate due to the fact that each process is isolated from each other? I’m confused because the VMs boil down to a single process on the
meaning of p in %pa[p] in the printk formats
The question is with regard to the printk formats. The documentation that I’m reading is located here Here is an excerpt that I’m asking about: What does [p] in %pa[p] stand for? What does it mean? Answer The p in [p] stands for phys_addr_t when used in %pap. This is analogous to the d in %pad stands for dma_addr_t, as
What kind of api does a sata hard drive expose?
I understand that the linux kernel uses a driver to communicate with the hard disk device and that there is firmware code on the device to service the driver’s requests. My questions are: what kind of functionality (i.e. api) does the firmware expose? For example, does it only expose an address space that the kernel manages, or is there some
How does linux kernel switch between user-mode and kernel-mode stack?
How does linux kernel switch between user-mode and kernel-mode stack when a system call or an interrupt appears? I mean what is the exact mechanism – what happens to user-mode stack pointer and where does kernel-mode stack pointer come from? What is done by hardware and what must be done by software? Answer All of the words below are about