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.
3,736 questions
0
votes
0
answers
16
views
Launching I2C communication from within ISR
I have an external I2C device that signals when data is ready using a pin.
I want my Linux SBC to trigger I2C transfer routine after GPIO interrupt triggers. How would this be done within kernel space?...
6
votes
1
answer
906
views
Are Linux kernels compiled with UBSAN turned on?
For those who don't know, UBSAN is Undefined Behavior Address Sanitizer, and it places a whole bunch of checks in a compiled piece of code to detect mistakes, such as out-of-bounds access and various ...
0
votes
0
answers
29
views
Linux kernel “BUG: Bad page state / Bad page cache in process python” during PyTorch distributed training (NVidia 5090 + Ubuntu 22.04) [closed]
I’m encountering a recurring kernel memory error while running heavy PyTorch training workloads .
The system eventually becomes unstable, training stops, SSH disconnects, and the machine needs a ...
1
vote
2
answers
58
views
How to capture boot steps
I have a linux-box.
My hdd is nvme, hence boot is fast. I need to analyze each line of after grub.
Can I pass a kernel parameter to capture my boot lines?
1
vote
0
answers
31
views
Why does Linux CFS need a periodic timer interrupt more frequent than the time slice?
OSTEP says
Note that CFS utilizes a periodic timer interrupt, which means it can only make decisions at fixed time intervals. This interrupt goes off frequently (e.g., every 1 ms), giving CFS a chance ...
1
vote
0
answers
41
views
How to use dm-mirror, or 'dm-raid raid1', with dmsetup only (no LVM automation)?
The goal is to create a mirror (aka raid1) device from two devices (to be mirrored), and (if needed) a third device that serves as the dirty region log / metadata / whatever. That, without using LVM ...
1
vote
1
answer
65
views
file-nr keeps increasing forever
I have a cloud VM running linux-yocto 6.17 and a few daemon processes--postfix, dovecot, rspamd, nginx, sshd, fail2ban and redis.
Ever since upgrading from 6.11 to 6.17, I've noticed that /proc/sys/fs/...
0
votes
1
answer
49
views
Is there any way to trace how a keypress is processed from beginning to end in Linux?
I would like to find out why my power button press isn't handled correctly. I've set power manager in XFCE4 to 'ask' me, but all that happens is I'm getting logged out of my session. I have contacted ...
2
votes
1
answer
35
views
systemd-networkd drop-in files for configuring network adaptors
The Issue
I am reading this systemd documentation
I have the following files:
/usr/lib/systemd/network/80-wired.network
[Match]
eth0
[Network]
Address=192.168.3.40/22
Gateway=192.168.0.1
/usr/lib/...
0
votes
0
answers
19
views
initramfs images gzip compressed on Oracle Linux 8 UEK6 systems but not UEK7
I'm troubleshooting /boot usage differences between Oracle Linux 8 systems that use different UEK kernel streams.
On some hosts, the initramfs images are gzip-compressed, while others produce ...
1
vote
1
answer
395
views
Can I deny the root access to the user keys in the Kernel key retention service?
I know the Linux kernel has a key retention service even though I haven't used it myself.
I'm constructing a system where anybody with root cannot check the keys in that service that were registered ...
0
votes
0
answers
28
views
Linux boot on Verdin iMX8MP stops after “Freeing unused kernel memory” when booting via TFTP
I am experiencing a problem when booting Linux on the Verdin Dahlia Carrier Board, where the boot log only goes up to:
#################################################################
###########...
1
vote
1
answer
38
views
Alpine linux failed kernel upgrade and unresponsive keyboard in recovery shell
I tried to upgrade my alpine linux kernel version from linux-lts to linux-stable because support for a device I am installing was added in a newer kernel version.
I changed the apk repositories from ...
1
vote
1
answer
61
views
Why is there a discrepancy between the stack address in /proc/PID/maps vs. /proc/PID/stat?
Why does there appear to be a discrepancy between a process stack address within /proc/PID/maps compared to the stack start address within /proc/PID/stat, where the latter is a smaller subset of the ...
0
votes
1
answer
113
views
Intel Core Ultra 9 275HX throttles to ~1.8 GHz under sustained load on Linux (Lenovo Legion 7)
Hardware / OS:
Laptop: Lenovo Legion 7 16IAX10
BIOS: RXCN23WW (from sudo dmidecode -s bios-version)
CPU: Intel(R) Core™ Ultra 9 275HX (from lscpu)
Distro + kernel: EndeavourOS / Linux 6.17.2-arch1-1
...
3
votes
1
answer
66
views
What is the best way to detect busy CPU cores for blk-mq request steering in Linux kernel?
I am trying to implement request steering in Linux kernel’s blk-mq layer to distribute I/O requests across CPU cores based on load. My goal is to redirect requests from busy cores to less busy ones to ...
2
votes
1
answer
111
views
What is the cost of listening on ports?
If you would open a listening socket on every possible TCP/UDP port (so thousands in total), without actually using them, what would be the cost in terms of performance?
Is it merely an administrative ...
5
votes
1
answer
345
views
How to interpret the refcnt field in /proc/crypto?
Here's an example /proc/crypto entry:
name : md5
driver : md5-generic
module : kernel
priority : 0
refcnt : 1
selftest : passed
internal : no
type : shash
...
1
vote
1
answer
39
views
rsyslog holds on to dirty pages and does not flush pages to disk
We have kernel dirty bytes settings configured as below.
vm.dirty_background_bytes = 262144000
vm.dirty_background_ratio = 0
vm.dirty_bytes = 0
vm.dirty_expire_centisecs = 0
vm.dirty_ratio = 10
vm....
2
votes
0
answers
105
views
How to force Linux to load a custom device tree instead of the built-in DTB?
I'm trying to bring up a WWAN modem on a Dell Latitude 7455 laptop running Linux.
The modem is connected via PCIe domain 0005, but that PCIe controller is currently disabled in the default device tree....
3
votes
1
answer
166
views
How to use ≥ 16 usbip ports from one host controller on Debian?
I have 5 USB-over-IP hubs with 16 usb ports, also in future can have some hubs with 64 usb ports, and all should be connected to one virtual machine. But in Debian by default 15 usb port from one host ...
1
vote
1
answer
105
views
Are loads and stores to pointers atomic on Linux?
I came across the following quote in this LWN article:
Answer: On all systems running Linux, loads from and stores to pointers are atomic, that is, if a store to a pointer occurs at the same time as ...
1
vote
1
answer
55
views
Help needed interpreting stack trace from unexpected watchdog reset
I'm running the Nvidia flavour of Ubuntu 18.04 with kernel 4.9.140 on a TX2i using the official devkit carrier board. The system suffered a watchdog reset. I managed to capture some log output over ...
0
votes
1
answer
182
views
Kernel don't recognize my CPU (microcode is not loaded)
I have laptop from 2025 (Lenovo Legion Pro 5 16IAX10 Ultra 7 255HX) and Fedora don't recognize the CPU:
$ sudo dmesg | grep microcode
[ 0.000000] x86/CPU: Model not found in latest microcode list
[ ...
1
vote
0
answers
143
views
How does memory.max.swap work in linux's cgroup v2?
I can't figure out how swap limitation should work based on the documentation.
https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html
memory.swap.max
A read-write single value file which ...
2
votes
1
answer
130
views
What is the difference between keyctl search and keyctl request?
I am using keyctl to load and retrieve keys for encryption/decryption for an application.
I notice I am able to retrieve the key id of an encrypted key (for example called 'datakey') which has already ...
14
votes
1
answer
1k
views
How does the Linux kernel decide whether to deny memory allocation or invoke the OOM killer when a cgroup exceeds its memory limit?
This question comes from my curiosity about how Kubernetes handles resource requests and limits, especially memory constraints defined for pods.
I understand that Kubernetes uses cgroups under the ...
4
votes
2
answers
223
views
No /dev/sr0 when booting with customized kernel in qemu
I'm compiling a customized kernel for vm without module support. The CONFIG_BLK_DEV_SR is compiled into the kernel, but it /dev/sr0 still not showing up in /dev:
# qemu-system-x86_64 -accel kvm -...
3
votes
1
answer
239
views
How to test kernel driver contributions without target hardware
If I'm working on contributing to a Bluetooth driver, but don't have the actual chip available. How can I test functionality and debug during development without the physical hardware?
Does anyone ...
1
vote
1
answer
129
views
Kernel: latest wifi-card firmware load failed
The following logs have appeared
Aug 12 17:51:23 host1 kernel: iwlwifi 0000:02:00.0: enabling device (0000 -> 0002)
Aug 12 17:51:23 host1 kernel: iwlwifi 0000:02:00.0: Detected crf-id 0x2001910, ...
1
vote
1
answer
532
views
Archlinux not booting after update, root partition full, (luks) device not found, fsconfig failed, can't lookup blockdev, emergecy shell
After updating with pacman -Syu system fails to boot.
ERROR: device '/dev/lvmSystemXXX/volRootXXX' not found. Skipping fsck.
mount: /new_root: fsconfig() failed: /dev/lvmSystemXXX/volRootXXX: Can't ...
0
votes
0
answers
80
views
No wifi on ROG STRIX B550-F GAMING WIFI II motherboard
There's no wireless interface show in the network icon and none in when I type 'nmcli device' running dmesg shows
[130854.349171] mt7921e 0000:05:00.0: probe with driver mt7921e failed with error -22
...
1
vote
1
answer
86
views
`echo 2 > /proc/sys/vm/drop_caches` decreases active pages
Before running echo 2 > /proc/sys/vm/drop_caches
the active page count was:
Active(anon): 36185016 kB
after the flush, active page count became:
Active(anon): 26430472 kB
every other ...
1
vote
1
answer
145
views
mdadm --monitor --program option not working
I am trying to make mdadm call into a simple bash script which writes a message in the kernel log in case of a state change.
I am running on a VM (qemu). The VM is running debian 12.5, and kernel ...
0
votes
0
answers
47
views
Analysis of memory consumption in Linux
I am analyzing issues with unexpected increase of memory consumption in Linux. It is an embedded system with no swap.
What is happening is over some period of time around 2GB of MemFree/MemAvailable (...
0
votes
0
answers
110
views
How to config uboot loglevel to get debug logs on boot
The problem is while booting up rasbberry pi with uboot as boot loader not able to decrypt encrypted rootfs partition with initramfs,to debug and analyse what happening want to enable uboot debug logs....
1
vote
0
answers
101
views
Too slow Tiered Memory Demotion and CPU Lock-up(maybe) with cgroup v2 memory.high
We are currently testing tiered memory demotion on a machine equipped with a CXL device.
To facilitate this, we created a specific script (https://github.com/hyun-sa/comem) and are using the memory....
1
vote
1
answer
737
views
NVIDIA RTX 5070 Ti causes black screen and very slow boot
I've recently purchased an NVIDIA RTX 5070 Ti, but it doesn't work properly under Linux.
The card works perfectly under Windows 11, so hardware failure can be ruled out.
When the PC boots, I can see ...
4
votes
2
answers
872
views
Compiling stand-alone function binaries from the Linux kernel
How can I take snippets from the Linux kernel drivers' code, for example this drm_fb_helper_hotplug_event function inside drivers/gpu/drm/drm_fb_helper.c, and compile a binary file that I can run to ...
0
votes
0
answers
73
views
Do linux kernel threads run in process context?
I'm aware of Linux softirqs may run within specific per-cpu kernel thread context -- ksoftirqd/[cpu_id].
Kernel threads are similar to user-space threads, however they only execute kernel code in ...
4
votes
2
answers
259
views
How to find out a process's proportional use of system-wide Committed_AS memory on Linux?
On Linux, it's possible to disable overcommitting memory which makes it behave like Windows, in that malloc() will fail once all physical memory is used up. As explained in this insightful and good ...
0
votes
0
answers
71
views
How to add init script with decrpt LUKS Logic in Initramfs without disturbing poky source?
Here is quick description what im trying to achieve, building this mender yocto image for raspberry pi want to encrypt the root partition, while secure boot, need to add the init script which can ...
9
votes
2
answers
3k
views
Linux kernel bug - How do you kill a process that won't die?
How do I kill a process that cannot be killed?
user@kubuntu22:~$ ps -ef |grep smbd
nobody 3532354 1 0 16:30 ? 00:00:00 /usr/sbin/smbd --foreground --no-process-group
user@kubuntu22:~$ ...
1
vote
1
answer
239
views
Disabling overcommitting memory seems to cause allocs to fail too early, what could be the reason?
I tested out echo 2 > /proc/sys/vm/overcommit_memory, which I know isn't a commonly used or recommended mode, but for various reasons it could be beneficial for some of my workloads.
However, when ...
0
votes
0
answers
98
views
linux kernel - (virtual) bluetooth device for testing
I want to test and debug linux kernel internals within the bluetooth stack, i.e. /net/bluetooth. I have a (rather minimal) kernel, manually built, with debug symbols, and a busybox at the moment, ...
1
vote
2
answers
138
views
Why does /proc/vmallocinfo show userspace-like addreses?
I expected to see a list of address ranges starting with 0xffff..., but /proc/vmallocinfo gives some crazy unpadded values.
I'm cooking Mali GPU drivers for OrangePi Zero 2W, and was wondering why the ...
10
votes
3
answers
1k
views
Why can ZONE_NORMAL only go up to 896MiB on 32-bit x86 processors?
According to Linux Kernel Development by Robert Love, p. 233:
Because of hardware limitations, the kernel cannot treat all pages as identical. Some pages, because of their physical address in memory, ...
1
vote
0
answers
47
views
Linux Kernel: possible to enable hardware flow control for serial console?
How do you enable hardware flow control for the Linux serial console? Perhaps using GRUB arguments?
This post asks about specifying arguments to QEMU and GRUB to use the serial console, but doesn't ...
0
votes
0
answers
41
views
BUG: Bad page state in process swapper pfn:801bd while booting linux (5.15.68, arm64)
I'm tyring to boot linux on an SoC (arm64 based) and seeing trap in early stage.
Here is the boot message.
Booting Linux on physical CPU 0x0000000002 [0x411fd401]
Linux version 5.15.68 (etri@AB21-T07) ...
0
votes
1
answer
60
views
Getting ancillary data of a packet after recv() call
Is there a way to get struct msghdr or ancillary data of it for the last received packet, i.e. after the recv() call? My guess is that
recvmsg() is the only way to populate msghdr, but probably there ...