Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [linux-kernel]

Questions about Linux kernel and Linux kernel related topics eg. implementation details such as system calls, kernel customization, etc. For Linux user space topics which do not involve kernel details, [linux] or distribution tag are more suitable.

51
votes
2answers
51k views

Understand logging in Linux

As I understand, Linux kernel logs to /proc/kmsg file(mostly hardware-related messages) and /dev/log socket? Anywhere else? Are other applications also able to send messages to /proc/kmsg or /dev/log? ...
38
votes
1answer
22k views

Configuring, compiling and installing a custom Linux kernel

I'd like to try using a kernel other than the one provided by my distro -- either from somewhere else, or as customized by me. Is this difficult or dangerous? Where do I start?
4
votes
3answers
10k views

How Smooth is Upgrading Linux kernel in Debian 8.5?

I would like to upgrade my Linux kernel to 4.7 in Debian 8.5, since it has significant better Skylake 6th generation support than the current linux kernel. In Ubuntu 16.04, the upgrade is easy. ...
16
votes
3answers
6k views

kernel: Namespaces support

I am wondering what exactly the “Namespaces support” feature in the Linux kernel means. I am using kernel 3.11.1 (the newest stable kernel at this time). If I decide to disable it, will I notice any ...
371
votes
7answers
41k views

How can I find the implementations of Linux kernel system calls?

I am trying to understand how a function, say mkdir, works by looking at the kernel source. This is an attempt to understand the kernel internals and navigate between various functions. I know mkdir ...
55
votes
6answers
188k views

Linux: How to find the device driver used for a device?

If my target has one device connected and many drivers for that device loaded, how can I understand what device is using which driver?
6
votes
2answers
2k views

change /proc/PID/environ after process start

$ k=v p & [1] 3028 is there any way for p to change the contents of /proc/3028/environ to not mention k=v while p is still running?
21
votes
4answers
13k views

How to tell Linux Kernel > 3.0 to completely ignore a failing disk?

I have a Samsung laptop (Chronos s7) with one SATA hard disk on bus ata:1, which is detected as /dev/sda, an 8G SSD on ata:2, /dev/sdb, and various other devices on the rest of SATA interface. The ...
15
votes
1answer
20k views

How to enable and use the BFQ scheduler?

I just installed Linux kernel version 4.12 on Ubuntu 17.04 using ukuu (Ubuntu Kernel Update Utility https://doc.ubuntu-fr.org/ubuntu_kernel_upgrade_utility). The thing is, when I check the available ...
6
votes
2answers
2k views

mount options shown in /proc/mounts

IIRC then the mount options shown in /proc/mounts have changed. Some time ago acl and user_xattr were shown, now it seems that only noacl and nouser_xattr are shown if these features are turned off. ...
5
votes
1answer
2k views

Linux kernel action upon init process exiting

Say I am writing my own init program running on a Linux kernel. What happens when my init program exits with return value 0 ? Additionally is the behaviour different if the return value is non-zero?
52
votes
7answers
40k views

Linux Kernel: Good beginners' tutorial [closed]

I'm interested in modifying the kernel internals, applying patches, handling device drivers and modules, for my own personal fun. Is there a comprehensive resource for kernel hacking, intended for ...
41
votes
7answers
37k views

Is it possible to install the Linux kernel alone?

I'm just curious if it's possible to install the Linux kernel alone, or if you need to use one of the flavours. If it were possible, how would you do it? I don't need a detailed tutorial. I just want ...
39
votes
7answers
20k views

Can ps display only non kernel processes on Linux?

How can I ask ps to display only user processes and not kernel threads? See this question to see what I mean...
86
votes
1answer
96k views

What is a tainted kernel in Linux?

Under certain conditions, the Linux kernel may become tainted. For example, loading a proprietary video driver into the kernel taints the kernel. This condition may be visible in system logs, kernel ...
15
votes
3answers
7k views

Are Linux kernel threads really kernel processes?

I've read in many places that Linux creates a kernel thread for each user thread in a Java VM. (I see the term "kernel thread" used in two different ways: a thread created to do core OS work and a ...
60
votes
7answers
16k views

Are threads implemented as processes on Linux?

I'm going through this book, Advanced Linux Programming by Mark Mitchell, Jeffrey Oldham, and Alex Samuel. It's from 2001, so a bit old. But I find it quite good anyhow. However, I got to a point ...
65
votes
2answers
84k views

How to display the Linux kernel command line parameters given for the current boot?

In the grub.conf configuration file I can specify command line parameters that the kernel will use, i.e.: kernel /boot/kernel-3-2-1-gentoo root=/dev/sda1 vga=791 After booting a given kernel, is ...
52
votes
7answers
16k views

Why does mount require root privileges?

Why does Linux require that a user be root/using sudo/specifically authorized per mount in order to mount something? It seems like the decision as to whether to allow a user to mount something should ...
23
votes
2answers
25k views

How does the system shutdown of a linux kernel work internally?

I have somehow an rough idea of how the userspace and init-system (be it classic init sysV /upstart/ systemd) work at system shutdown. (Essentially there is an order succession of "Stop!", "Please ...
16
votes
2answers
20k views

Is it possible to get the information for a device tree using /sys of a running kernel?

Commonly for arm systems, device trees supply hardware information to the kernel (Linux). These device trees exist as dts (device tree source) files that are compiled and loaded to the kernel. Problem ...
21
votes
4answers
9k views

Given a git commit hash, how to find out which kernel release contains it?

Assume I have some issue that was fixed by a recent patch to the official Linux git repository. I have a work around, but I’d like to undo it when a release happens that contains my the fix. I know ...
11
votes
1answer
9k views

Why does Linux show both more and less memory than I physically have installed?

I know about swap - this question isn't about that. In dmesg, the Linux (x86-64) kernel tells me this about how much memory I have: [ 0.000000] Memory: 3890880k/4915200k available (6073k kernel ...
10
votes
1answer
2k views

Unmount a rbind mount without affecting the original mount

Asked on serverfault but didn't get enough attention, so reposted here, with the hope some people here know the answer. There is another question discussing about umounting rbind mounts, but the ...
3
votes
5answers
8k views

Kernel can't find /dev/sda file during boot

I configured a gentoo kernel (kernel-2.6.36-gentoo-r5), but when I boot it can't mount /dev/sda1: ALERT! /dev/sda1 does not exist . Dropping to a shell . I use the shell to go to the /dev directory, ...
2
votes
3answers
3k views

Everything is a file?

In Linux, every single entity is considered as FILE. If I do vim <cd-Name> then, vim will open the directory content into it's editor, because, it do not differentiate between file and ...
4
votes
1answer
2k views

How does the linux kernel know device major and minor numbers?

As far as I know, the kernel detects hardware, adds information to sysfs creates a device in /dev and then generates a udev event. My question is, do device drivers do all of this or it is the kernel ...
3
votes
2answers
80k views

Can't install Linux Headers (Kali Linux)

I am trying to install Linux headers for Kali Linux on my machine and I have tried every possible solution on the internet but it always show "Unable to locate packages " root@kali:/usr/sbin# apt-get ...
21
votes
3answers
57k views

What exactly are Linux kernel headers? [duplicate]

Possible Duplicate: What does a kernel source tree contain? Is this related to Linux kernel headers? I know that if I want to compile my own Linux kernel I need the Linux kernel headers, but what ...
27
votes
2answers
2k views

ip vs ifconfig commands pros and cons

At some point, in some teaching material (from Linux Foundation) on Linux that I came across, the following is mentioned: ip command is more versatile and more efficient than ifconfig because it ...
14
votes
4answers
41k views

How do I safely delete old kernel versions in CentOS 7?

I might be encountering odd symptoms resulting from competing kernels in CentOS 7. So how do I safely delete the old kernels? And how do I know which kernel is the newest one? Below is the ...
13
votes
3answers
5k views

ACPI wakeup 4-letters code meaning?

I have to disable some event to avoid an immediate wakeup after suspend in my desktop machine, and I made it by trial and error (works well, so that is not a problem). But I wonder... for example in ...
6
votes
2answers
8k views

MMU-less kernel?

I would like to try compile mmu-less kernel. From what I found in configuration there is no option for such a thing. Is it possible to be done?
12
votes
7answers
39k views

How to configure the Linux kernel to reboot on panic?

You can put "panic=N" on the kernel command line to make the system reboot N seconds after a panic. Is there a config option to specify this (other than the default kernel command line option)?
15
votes
1answer
15k views

Load Linux bzImage in QEMU?

I compiled a Linux by doing make menuconfig then make and now I have compiled the most recent version of Linux. How can I load the kernel into QEMU?
8
votes
4answers
4k views

Delete new kernels /boot full

We've some Ubuntu 16.04 servers. unattended-upgrades are automatically enabled since 16.04 and the boot partition is on a separate partition. Due to the automatic security updates the boot partition ...
6
votes
2answers
7k views

How to install X11 on my own Linux Buildroot system?

I have developed my own tiny linux file system using buildroot and busybox. I used linux-2.6.38.8 kernel configured and cross-compiled for target system(X86) according to needs.Now the filesystem is ...
6
votes
2answers
6k views

How to script make menuconfig to automate Linux kernel build configuration?

I want to automate a Linux build but eventually get to a point where I need to run what seems to be a very manual step: make menuconfig. This seems to synchronize configs between the OS and kernel ...
3
votes
1answer
792 views

How does the kernel assign cpu ids to physical cores?

One may find a lot of info about how to inspect physical cores layout in a running linux system, but I'm wondering how the physical cores are assigned a cpu id in the first place. After experiencing ...
2
votes
1answer
107 views

Writeback cache (`dirty`) seems to be limited below the expected threshold where throttling starts. What is it being limited by?

In a previous question and answer, I showed an experiment about dirty_ratio. Writeback cache (`dirty`) seems to be limited to even less than dirty_background_ratio. What is it being limited by? How ...
8
votes
2answers
7k views

Running bzImage in QEMU: Unable to mount root fs on unknown-block(0.0)

I compiled the kernel by doing make menuconfig and make. I was trying to run the bzImage in qemu, by doing qemu -kernel bzImage but it didn't work out with the error message: Unable to mount root fs ...
6
votes
2answers
2k views

How to block drivers built-into Kernel, i.e. drivers who are not a module

I configured and compiled Linux kernel with nouveau driver built-into kernel, i.e. with <*> as opposed to <M> when doing make menuconfig inside Linux kernel source directory. Now, I ...
3
votes
2answers
338 views

How to find the connection between tap interface and its file descriptor?

I have a qemu VM started by an orchestration script, which creates transient tap interfaces. When I inspect the command line arguments of the qemu-system-x86_64 process, then I can see, that the ...
2
votes
1answer
239 views

Writeback cache (`dirty`) seems to be limited to even less than dirty_background_ratio. What is it being limited by? How is this limit calculated?

I have been testing Linux 4.18.16-200.fc28.x86_64. My system has 7.7G total RAM, according to free -h. I have default values for the vm.dirty* sysctl's. dirty_background_ratio is 10, and ...
1
vote
5answers
4k views

Kernel didn't update to last version

I saw on Debian website that https://security-tracker.debian.org/tracker/CVE-2017-5754 stretch (security) 4.9.65-3+deb9u2 fixed I tried to update it using: sudo apt-get update && sudo apt-...
1
vote
1answer
236 views

Why is `sync + drop_caches` not dropping caches?

I have a test case for journalctl where it spends several seconds reading from the disk. But if I try to benchmark multiple runs of the test case, I find that it's impossibly fast after the first run....
60
votes
4answers
93k views

How to list all loadable kernel modules?

I'm looking for a few kernel modules to load i2c-dev and i2c-bcm2708. But the modprobe command returns: sudo modprobe i2c-dev modprobe: module i2c-dev not found in modules.dep How can I list all the ...
20
votes
5answers
35k views

Restrict size of buffer cache in Linux

Is there a way to tell the Linux kernel to only use a certain percentage of memory for the buffer cache? I know /proc/sys/vm/drop_caches can be used to clear the cache temporarily, but is there any ...
20
votes
1answer
7k views

How is nice working?

sched_setscheduler says : All scheduling is preemptive: if a process with a higher static priority becomes ready to run, the currently running process will be preempted and ...
35
votes
1answer
5k views

What is a “subreaper” process?

The word "subreaper" is used in some answers. Searching Google also turn up entries where the word is "just used". How can I understand what a "subreaper" is?