17,818 questions
Advice
1
vote
4
replies
84
views
Is __vmalloc(size, GFP_NOWAIT) really guaranteed not to sleep?
I'm working on a kernel module where I need to allocate a few gigabytes of memory. I want the allocation to fail rather than sleep if it cannot be satisfied immediately.
However, I haven't been able ...
Score of 0
0 answers
114 views
kgdb kernel-backtrace for waiting process
I'm trying to get kernel backtrace of waiting task in kgdb(x86-64/kvm).
The /proc/$pid/stack shows that the task is waiting in folio_wait_bit_common(), and I need to get the value of argument of some ...
Advice
0
votes
3
replies
141
views
Demand paged shared memory between kernel space and user space
I have a user space program which loads a kernel module, and the module is going to send logs to the program. I have already implemented this using Netlink but it appeared to me that it is not the ...
Advice
0
votes
2
replies
70
views
BeagleBone Black Rev D does not show up as Mass storage in Windows 11
I am just starting to learn how to use BBB rev D and the instruction manuals and the BeagleBone Getting Started actual states that it is accessible as a Mass Storage but I don't see anything like that ...
Score of 3
1 answer
112 views
Questions regarding preemption and blocking in Linux kernel
I've been questioning the scenario when __exit is called while any of my kernel module's code would have been running.
I learned that any execution in kernel space has a context. A process, kthread, ...
Advice
0
votes
10
replies
184
views
Does the Linux kernel interrupt any running code to call the __exit function when unloading a kernel module?
I have a cleanup function that I call in my code. The __exit function also goes through the same routine, but we will have a global flag for that to not run it twice. My question is, if my cleanup ...
Advice
1
vote
1
replies
82
views
Contiguous DMA on a PCIe device in systems with IOMMU enabled
I have a system on Linux and with IOMMU enabled onboard. I know that when using dma_alloc_coherent() in systems without IOMMU, it allocates a physically contiguous space in RAM, because without IOMMU ...
Advice
0
votes
3
replies
151
views
Why does the Linux GPIO API enforce exclusive ownership?
I am bringing up an embedded Linux platform, and using the newer "GPIO v2 API". In the past, I've always used the older "sysfs GPIO API". The older interface provided a file for ...
Advice
0
votes
3
replies
130
views
Why can't Linux compile with x86_64-none-elf toolchains?
I'm primarily use the bare-metal GNU toolchains for my projects. Have no issues with them, both GCC and the GNU assembler. But I'm wondering why Linux can't compile with it.
Get these assembler errors ...
Score of 0
1 answer
82 views
Call different bpf helpers depending on kernel version?
I need to get the current system time in my BTF probe. How can I call bpf_ktime_get_boot_ns() on kernels 5.8 and newer, and bpf_ktime_get_ns() on older kernels where bpf_ktime_get_boot_ns is not yet ...
Advice
1
vote
6
replies
170
views
Is it safe to directly dereference mmap'ed I/O memory in userspace (e.g., via UIO)?
I have a question regarding memory-mapped I/O access in Linux, particularly in the context of device drivers and userspace frameworks like UIO.
When writing a Linux kernel device driver (especially on ...
Score of 0
0 answers
103 views
I can't get the kernel source code for my Android 16 Pixel 6a
I'm trying to run repo init -u https://android.googlesource.com/kernel/manifest -b android-gs-bluejay-6.1-android16, but the repo can't sync absolutely ALL branches. When I try the same thing with the ...
Score of 0
1 answer
103 views
Does `ext4` use `i_generation` inside `name_to_handle_at`?
My question is pretty straightforward. Does the ext4 file-system use inode's i_generation-property for the creation of the file-handle inside name_to_handle_at?
Advice
0
votes
2
replies
269
views
How to become a great (excellent) kernel engineer?
I am a beginner kernel engineer and I have tried creating an x86-64 Unix-like kernel from scratch using C and assembly for my real machine. I am also trying contributing to the Linux kernel. I am ...
Score of 1
0 answers
125 views
Linux kernel netdev: module_param deprecated
I am working on a linux kernel tcp congestion control module and was using the module_param macro to get some runtime configurable parameters.
When submitting to the netdev mailing list, the automated ...