Questions tagged [linux-kernel]

This tag is for questions about the internals of the Linux kernel itself - particularly about writing code that runs within the context of the kernel (like kernel modules or drivers). Questions about writing userspace code in Linux should generally be tagged [linux] instead. Since the internals of the Linux kernel are constantly changing, it is helpful to include the precise kernel version(s) that you are interested in.

This tag is for questions about the internals of the Linux kernel itself - particularly about writing code that runs within the context of the kernel (like kernel modules or drivers).

Questions about writing userspace code in Linux should generally be tagged instead. Since the internals of the Linux kernel are constantly changing, it is helpful to include the precise kernel version(s) that you are interested in.

The kernel is a UNIX-like kernel initially created by Linus Torvalds in 1991 and now is maintained by developers around the world.

Frequently Asked Questions

Online resources

Books

Kernel source code and source code browsers

Further reading

Mailing lists

17371 questions
6
votes
1 answer

What is the difference between T and t in /proc/kallsyms

This is a part of text file from System.map and /proc/kallsyms. ffffffff8106c260 T leave_mm ffffffff8106c340 t do_flush_tlb_all ffffffff8106c390 t flush_tlb_func ffffffff8106c510 T native_flush_tlb_others ffffffff8106c540 T…
elsdy
  • 69
  • 1
  • 3
6
votes
1 answer

When is it necessary to rebuild the initrd (Linux initial ramdisk)?

Background: I'm developing a DKMS package for my kernel module. The DKMS manpage contains the following sentence: REMAKE_INITRD = This directive specifies whether your initrd should be remade after the module is installed onto the…
sergej
  • 17,147
  • 6
  • 52
  • 89
6
votes
2 answers

Interrupt-handling within kernel-module: request_irq() returns -22, Invalid Parameter

I'm trying to set up an interrupt-handler within a kernel-module that gets triggered by a gpio-interrupt, but it seems that I don't use the request_irq()-function right... I'm getting my irq-number via gpio_to_irq() and this seems to work. Then I'm…
DocValle
  • 125
  • 2
  • 10
6
votes
1 answer

How to use BPF to filter kernel function arguments?

How to use the Berkeley Packet Filter (BPF) to filter function arguments in kernel? The function should be any non-inline functions, rather than only system calls. Also, it is better that the pointers in function arguments can be dereferenced for…
WindChaser
  • 960
  • 1
  • 10
  • 30
6
votes
1 answer

DirectMap1G display a wired huge number

I don't set any hugepages in the system. why direct mapping has a weired value DirectMap4k: 251600 kB DirectMap2M: 5941248 kB DirectMap1G: 130023424 kB Look at the cmdline, no hugepages specified. also the runtime hugepages, only 2M…
6
votes
1 answer

Linux Kernel mutex_lock_interruptible

The mutex_lock_interruptible() function in the linux kernel basically tries to lock a mutex and will continue waiting until a task is interrupted. Well how do I actually interrupt a task?
Caleb Merchant
  • 289
  • 1
  • 5
  • 16
6
votes
2 answers

Getting kernel version from the compressed kernel image

I am working on a shell script. I have a pre-built zImage. is it possible to know the kernel version from which this zImage was created? I have tried with the commands updated @ Getting uname information from a compressed kernel image, but both…
Ravi A
  • 421
  • 2
  • 9
  • 21
6
votes
2 answers

Linux IOMMU page tables

I've been reading about IOMMU support in Linux and have some questions regarding page tables in IOMMU: Does the IOMMU uses the CPU MMU page tables for storing the VA → PA mapping? If not, i.e. the virtual addresses are different, then are the…
user6400335
  • 61
  • 1
  • 4
6
votes
2 answers

What's the difference between slab and buddy system?

It seems to me they are quite similar. So what's the relation between slab and buddy system?
bydsky
  • 1,604
  • 2
  • 14
  • 30
6
votes
3 answers

Code (.text) not execute-only? .rodata is executable?

I am trying to understand how ELF segments are memory mapped. I noticed that various sections are mapped to the same ELF segment. For example, .rodata is mapped to the same segment as .text. Why is this the case? Why not map .rodata to a separate…
MEE
  • 2,114
  • 17
  • 21
6
votes
2 answers

what scenarios we set file descriptor as -1 in mmap?

why mmap is better than read and write one more similar post My question is as follows: There are certain scenarios people using mmap rather than to read from files. One such code is: *mapping = mmap(NULL, *mapping_size, PROT_READ | PROT_WRITE, …
ANTHONY
  • 333
  • 5
  • 18
6
votes
1 answer

Android AOSP linux service standard output

Im developing my own watchdog linux service (init.rc) for an android image Im cooking. These linux services use some log libraries like log.h to show the output of such services. I have tried to track these libraries in order to find where that log…
Chus Muñoz
  • 120
  • 8
6
votes
2 answers

Global variables in linux .ko for multiple devices

I have a Wi-Fi driver (a .ko file) for embedded Linux system and there are two identical Wi-Fi devices on my board. After insmod-ing the .ko file into the kernel, the system is able to drive these two Wi-Fi devices. My question is: if the driver's…
guan boshen
  • 724
  • 7
  • 15
6
votes
3 answers

Yocto Bitbake - Git Fetch always stuck

I am using YOCTO to build an image but the Bitbake process always get stuck at any task including fetch from git Ex: Currently 2 running tasks (1373 of 2477): 0: rpi-mkimage-native-git-r0 do_fetch (pid 2372) 1:…
iwahdan
  • 429
  • 1
  • 5
  • 14
6
votes
2 answers

vmstat: What exactly does cpu wait mean?

today I had a linux system with 100% wait in the vmstat wait Column. My question here is: What exactly does a processor do when it's waiting for I/O? To my understanding a cpu can't really wait - it has to run some code! So is it running some tight…
Thomas C.
  • 173
  • 1
  • 8