date
int64
1,220B
1,719B
question_description
stringlengths
28
29.9k
accepted_answer
stringlengths
12
26.4k
question_title
stringlengths
14
159
1,436,241,099,000
I'm building an embedded Linux system, based on Gentoo. Using udev, all tty devices are probed with a PROGRAM stanza to determine if they are a modem. Right now the system boots up with 64 /dev/tty*. When udev probes the tty devices, the system runs out of memory. How can I reduce the number of produced tty devices to...
I'm not sure exactly how the device nodes are created (i.e. the exact sequence of events that lead to their creation), but I'm pretty sure the kernel creates the underlying devices for the 63 /dev/ttyN devices (plus /dev/tty) internally, and udev does the work of making them available inside /dev (except for /dev/tty ...
Change the number of generated /dev/tty devices
1,436,241,099,000
I already asked in #debian-next and on the forum, but thought I'll also ask here before switching back to Fedora. Suspend does not work. When I use systemctl suspend, the workstation goes into suspend for about 1 second and then comes back. I have no idea what could cause that. I tried to disable some of those devices...
This is not a real solution, but the only way to get this fixed was to replace the mainboard with one from ASRock. Now everything works as expected. Very sad that there was no other way.
Suspend doesn't work in Debian / powers up after a second
1,436,241,099,000
I have built a custom kernel which I want to install. I am afraid that the next upgrade will overwrite my custom kernel. Do I have to put the current kernel on hold or is this not necessary? I cannot find a hint in the many description of how to build a custom kernel. The current kernel is: # uname -r 4.4.0-59-generic...
Package manager will not overwrite your kernel. Actually, package manager never overwrite any kernel, it just add new version parallel to existing versions on system. Depending on distribution, package manager may initiate reconfiguration of boot loader on your system upon installing new or removing existing kernel, b...
Hold Kernel for Custom Kernel
1,436,241,099,000
I already got the keycode from kernel, but acpi_listen won't recognize it in Arch Linux: # /usr/lib/udev/keymap -i /dev/input/by-path/platform-thinkpad_acpi-event Press ESC to finish, or Control-C if this device is not your primary keyboard scan code: 0x1A key code: micmute Now I try to map the key by: # /usr/lib/...
The problem is that key code micmute is out of range, as explained in this bug report. So you need to remap scan code 0x1A to some other key code you are not using that is in range. If this workaround using prog2 doesn't work you have to pick some other key code. You can look in /usr/include/linux/input.h to see wh...
Setting up kernel keyboard mapping
1,436,241,099,000
For security reasons I have to boot Linux from u-boot with all output hidden (silently) until a password is entered. I've configured uBoot to do this correctly using the CONFIG_AUTOBOOT_KEYED macro and can successfully boot silently. The issue I am having is that when uBoot boots the Linux kernel and silent mode is e...
If anyone else runs into this issue I never found a good fix. I ended up hacking both u-boot and the linux kernel serial driver and basically checking if the password had been entered. If it had, I allowed the code to run normally. If it hadn't I just returned from the functions so that nothing was actually printed ou...
Silent booting Linux from u-boot
1,440,716,501,000
Are there any other interfaces, e.g. the /proc filesystem?
The Linux kernel syscall API is the the primary API (though hidden under libc, and rarely used directly by programmers), and most standard IPC mechanisms are heavily biased toward the everything is a file approach, which eliminates them here as they ultimately require read/write (and more) calls. However, on most plat...
Are system calls the only way to interact with the Linux kernel from user land?
1,440,716,501,000
RHEL 7.2 memory use, per free -m: total used free shared buff/cache available Mem: 386564 77941 57186 687 251435 306557 Swap: 13383 2936 16381 we see that used swap is 2936M so we want to decrease it to min by the following...
As you’ve been told before (see Why does swappiness not work?), changing swappiness only affects future decisions made by the kernel when it needs to free memory. Reducing it won’t cause the kernel to reload everything that’s been swapped out. Your vmstat output shows that swap isn’t being actively used, i.e. your cur...
Why does RHEL use swap even when vm.swappiness = 1?
1,440,716,501,000
I have experienced an issue nearly identical to one described in the askubuntu community. Like that of the user who posted this issue, my system features a Kingston NVME disk, and as with that user, my issue resolved by adding the following kernel option in the grub menu: nvme_core.default_ps_max_latency_us=0. The us...
The code comment within drivers/nvme/host/core.c in Linux kernel source seems to explain it best: /* * APST (Autonomous Power State Transition) lets us program a table of power * state transitions that the controller will perform automatically. * * Depending on module params, one of the two supported techniques wi...
clarifying nvme apst problems for linux
1,440,716,501,000
I was reading some sites and came across (LTR) by the number of kernel. Can somebody explain what is means?
LTR stands for Long Term Release. This is also known as a LTSR, short for Long Term Support Release. These releases are supported for a longer time, and are meant to be used in Production Environments, where stability is preferred over new features. In terms of the kernel you are reading about, the LTR cycle is abo...
What does LTR kernel mean?
1,440,716,501,000
I don't have any swap partition/file on my machine, and only 2GB of RAM. Sometimes it happens that the memory gets saturated by some process (Xorg+browser+compiler+...) and the system hangs indefinitely, and the only way to restart it (other than hard reset) is with SysRq. I understood that the Out Of Memory Killer wo...
I'm fairly sure that the kernel reserves some memory for itself, i.e. for launching the oom_killer. (What use would a oom_killer be if it fails to load due to lack of memory?)
Preloading the OOM Killer
1,440,716,501,000
As far as I understand, the kernel is not a process, but rather a set of handlers that can be invoked from the runtime of another progress (or by the kernel itself via a timer or something similar?) If a program hits some exception handler that requires long-running synchronous processing before it can start running a...
"The kernel is not a process." This is pure terminology. (Terminology is important.) The kernel is not a process because by definition processes exist in userland. But the kernel does have threads. "If a program hits some exception handler that requires long-running synchronous processing before it can start running ...
How does the kernel scheduler know how to pre-empt a process?
1,440,716,501,000
Is there a way to increase the limit of 20 multicast groups that you can join on a given socket? Is there some system setting that I am missing or is there some hard limit which cannot be exceeded?
Well, incase someone is searching for this, the following parameter exists: /proc/sys/net/ipv4/igmp_max_memberships Currently my install says 20, in the sources, I also see: bits/in.h:#define IP_MAX_MEMBERSHIPS 20 I think bumping up the system parameter may be enough, else will have to patch the header ...
Is there a way to increase the 20 multicast group limit per socket?
1,440,716,501,000
Each process has 2 memory area: User space (high memory) and kernel space (low memmory). In the kernel space, are the first 896 MB used for mapping kernel code (not fully 1 GB)? This means, when a user -space application performs a system call or anything related to the kernel, the kernel will refer to kernel space fo...
"High memory" and "low memory" do not apply to the virtual address space of processes, it's about physical memory instead. In the process' virtual address space, the user space occupies the first 3GB, and the kernel space the fourth GB of this linear address space. The first 896MB of the kernel space (not only kernel ...
High memory (user space) and highmem (kernel space)
1,440,716,501,000
I recently ran into trouble when installing Debian on a netbook. There were three major hardware/kernel issues that I didn't feel like fixing, and since every single forum/wiki writeup reported the exact same problems with very few easy solutions, I decided to try something new. So I just tried every distro I could g...
You can't directly install packages from one distribution onto another distribution. Usually driver issues don't depend on the distribution, they depend on the kernel and driver versions. Try to find a more recent kernel or drivers for Debian. You can install Debian in a chroot (either on a separate partition or with ...
can i modify an .rpm-based system to use .deb files, apt-get and debian/ubuntu repositories?
1,440,716,501,000
After upgrading to kernel 6.8.0, VMware's vmmon and vmnet couldn't compile, giving the following error: ... ... /tmp/vmware-host-modules-w17.5.1/vmmon-only/common/task.c:548:1: warning: no previous prototype for ‘TaskGetFlatWriteableDataSegment’ [-Wmissing-prototypes] 548 | TaskGetFlatWriteableDataSegment(void...
Mkubecek's plain patch on the community forum for VMware 17.5.1 couldn't compile either.  On his website at Kernel – 6.8 Released – OK with latest NVIDIA and Patched VMware, there's a link titled modules: fix build with -Wmissing-prototypes to patch VMware 17.5.1, which fixes that compilation error, among others. Hit ...
VMware vmmon & vmnet 17.5.1 and Linux kernel 6.8.0 won't compile
1,440,716,501,000
The sock struct defined in sock.h, has two attributes that seem very similar: sk_wmem_alloc, which is defined as "transmit queue bytes committed" sk_wmem_queued, defined as "persistent queue size" To me, the sk_wmem_alloc is the amount of memory currently allocated for the send queue. But then, what is sk_wmem_queue...
I emailed Eric Dumazet, who contributes to the Linux network stack, and here is the answer: sk_wmem_alloc tracks the number of bytes for skb queued after transport stack : qdisc layer and NIC TX ring buffers. If you have 1 MB of data sitting in TCP write queue, not yet sent (cwnd limit), sk_wmem_queue will be about...
What is the difference between sock->sk_wmem_alloc and sock->sk_wmem_queued
1,440,716,501,000
The concepts of IO scheduler and CPU scheduler confuse me. Below are my understanding: Linux uses CFS scheduler + nice values by default to schedule processes. Each process has an IO queue. There is an IO scheduler kernel thread. IO scheduler is in the block level, not in the file level. IO scheduler is a module...
Let's start with the IO scheduler first. There's a IO scheduler per block device. Its job is to schedule (order) the requests that pile up in the device queue. There are three different algorithms currently shipped in the linux kernel: deadline, noop and cfq. cfq is the default, and according to its doc: The CFQ I/O ...
Relationship between IO scheduler and cpu/process scheduler?
1,440,716,501,000
I am configuring the Linux kernel version 3.9.4. I am being asked questions about RCU (seen below). Specifically, what are each of these and what are the advantages and disadvantages of enabling or disabling some of these? Consider userspace as in RCU extended quiescent state (RCU_USER_QS) [N/y/?] Tree-based hierarchi...
There are some details about these options over on the LTTng Project site. RCU's are (read-copy-update). These are data structures in the kernel which allow for the same data to be replicated across cores in a multi-core CPU and they guarantee that the data will be kept in sync across the copies. excerpt liburcu is ...
Understanding RCU when Configuring the Linux Kernel
1,440,716,501,000
I am just confused like how can I break cmd=3222823425 value into different parts to figure out what this command means actually in the Linux kernel. I know, some functions are making ioctl command with following parameters but I want to know what these parameter values mean. fd=21, cmd=3222823425 and arg=3203118816 ...
An ioctl goes to a driver, so the most important thing to figure out what an ioctl is doing is which driver is handling it. What you've read about type, number and data_type is a convention that driver writers are supposed to use when choosing ioctl numbers. Although different drivers can use the same value to mean co...
How to decode cmd = 3222823425 in ioctl in Linux 2.6.29
1,440,716,501,000
when we run the following dmesg on rhel 7.2 , we get errors about assuming drive cache dmesg --level=err [ 5.325381] sd 0:0:0:0: [sda] Assuming drive cache: write through [ 5.325492] sd 0:0:5:0: [sde] Assuming drive cache: write through [ 5.325637] sd 0:0:3:0: [sdc] Assuming drive cache: write through [ 5...
From the link you gave, “So these events can typically be ignored.” That’s the solution. The kernel prints the message to err on the side of caution; all it means is that the kernel tried to determine the drives’ caches’ characteristics, using an optional feature of the SCSI specification, but the drives don’t support...
dmesg + Assuming drive cache: write through
1,440,716,501,000
Is there a way to measure elapsed time running the program under gdb? Look to this: <------------bp----------------------------------> Assume that we are debugging a file and in some random place, we set a breakpoint. Now in gdb we perform something and then we let the program continue the execution by using the gdb ...
The easiest way to do this (if your gdb has python support): break *0xaddress run # target process is now stopped at breakpoint python import time python starttime=time.time() continue python print (time.time()-starttime) If your gdb doesn't have python support but can run shell commands, then use this: shell echo se...
Elapsed time in gdb
1,440,716,501,000
There are two Linux kernel functions: get_ds() and get_fs() According to this article, I know ds is short for data segment. However, I cannot guess what "fs" is short for. Any explanations?
The FS comes from the additional segment register named FS on the 386 architecture (end of second paragraph). My guess is that after DS for Data Segment and ES for Extra Segment Intel just went for the next characters in the alphabet (FS, GS). You can see the 386 register on the wiki page, on the graphic on the right...
What is "fs" short for in kernel function "get_fs()"?
1,440,716,501,000
I came across the following parameter in kernel settings (in sysctl): vm.min_free_kbytes This is the amount of free memory (RAM) that's always free no matter what. In my case, I have only 1 GiB of RAM, and this parameter was set to about 64MiB. I thought that's pretty high, so I lowered it to 8MiB so far. I don't kno...
Should be safe but can't guarentee it. From kernel docs: min_free_kbytes: This is used to force the Linux VM to keep a minimum number of kilobytes free. The VM uses this number to compute a watermark[WMARK_MIN] value for each lowmem zone in the system. Each lowmem zone gets a number of reserved free pages based pro...
What would happen if the amount of free memory (vm.min_free_kbytes) was too low?
1,440,716,501,000
Here is an example that will explain better: I have a selected the audio driver from the picture and i would like to browse through its source. How do i get to the path of the source files from here?
You have to use grep -r CONFIG_SND_SOC_MXS_SGTL5000. Each of these config options just represents a #define macro. Many of them don't belong to a single file but instead are checked in multiple source files. CONFIG_64BIT for example appears in around 1k source code files.
How to relate a kernel config setting to the source files?
1,440,716,501,000
I am compiling my first Kernel (3.5 rc1) from source through menuconfig. Certain configuration options are pre-set. Who / what determines if they are pre-set? Does the make menuconfig somehow detect my computer and its devices and characteristics and generates them? Or do the default configs come with the source, p...
make menuconfig doesn't dynamically determine your environment and tries to set the appropriate config but uses your .config file and the default entries in kconfig. So yes the defaults come with the source and are specified in the kconfig files which also specify the help text, dependencies and other things. Have a l...
How are Linux kernel compile config's determined?
1,440,716,501,000
Windows 10 support Intel speed shift. Does Linux (kernel) also support it? Speed shift related info: https://www.anandtech.com/show/9751/examining-intel-skylake-speed-shift-more-responsive-processors
Should support since 3.19: https://elixir.bootlin.com/linux/v3.19/source/drivers/cpufreq/intel_pstate.c static void intel_pstate_hwp_enable(void) { hwp_active++; pr_info("intel_pstate HWP enabled\n"); wrmsrl( MSR_PM_ENABLE, 0x1); } another commit (v3.19-rc1): intel_pstate: Add support for HWP https://git...
Does linux (kernel) support Intel speed shift?
1,440,716,501,000
A swap partition doesn't contain a structured filesystem. The kernel doesn't need that because it stores memory pages on the partition marked as a swap area. Since there could be several memory pages in the swap area, how does the kernel locate each page when a process requests its page to be loaded into memory? Let's...
Swap is only valid during a given boot, so all the tracking information is kept in memory. Swapping pages in and out is handled entirely by the kernel, and is transparent to processes. Basically, memory is split up into pages, tracked in page tables; these are structures defined by each CPU architecture. When a page i...
How does the kernel address swapped memory pages on swap partition or swap file?
1,440,716,501,000
I am using Arch Linux with a custom kernel stored as /boot/vmlinuz-linux1. Some features I would like to have don't work in it, but there is also a /boot/vmlinuz-linux kernel where those features work. How can I retrieve the .config kernel configuration file from the second vmlinuz file in order to compare it with the...
As far as I'm aware, extracting the .config configuration file from a kernel is possible only if you've compiled it with the configuration option CONFIG_IKCONFIG (available in the configuration menu as entry General setup > Kernel .config support). Here is the documentation of that configuration option: CONFIG_IKCONFI...
Can I get .config file from vmlinuz file?
1,440,716,501,000
I want to see all hardware supported by the kernel in use. For example, if I have the 3.8.x.x version of the Linux kernel, how will I know what hardware is supported there. Tools like lspci, lshw, lscpu and dmidecode only check the hardware that is used at the moment and trying to find this using the loaded modules wi...
What I want is something that checks all hardware actually supported by the kernel in use without taking into consideration if I am using that hardware or not. If you have the .config file the kernel was built with, you can download the source and run make menuconfig, which will give you an idea of A) what hardw...
How to list all hardware supported by kernel
1,440,716,501,000
I using embedded Linux, I have compiled the kernel without initramfs and kernel is booting fine. But It shows me rcS file is not found I have put it in /etc/init.d/rcS and my rcS file look like #!/bin/sh echo "Hello world" After the file system is mounted by the kernel it prints Hello world. Can any one tell/explain ...
/etc/init.d/rcS allows you to run additional programs at boot time. Its typical use is to mount additional filesystems (only the root filesystem is mounted at that point) and launch some daemons. Usually rcS is a shell script, which can easily be customized on the fly. Typical distributions make rcS a simple script th...
Why is rcS required after file system is mounted by the kernel?
1,440,716,501,000
I downloaded the sources for my kernel, applied a patch and rebuilt it and now I have a kernel module that, when I try to insmod, complains "Unknown symbol in module" with dmesg giving the error "disagrees about the version of symbol ...". Without having to hunt down the source for this module and rebuild it against m...
insmod isn't the best tool to load modules - use modprobe instead, it's smarter. In modprobe's man page, you'll find that it has a --force option which might load a module with conflicting version information. As you said, this is dangerous and should essentially never be used. You pick up the pieces if your system bl...
possible to load kernel module that "disagrees about version of symbol"
1,440,716,501,000
we have moon server - version rhel 7.5 the behavior of consuming swap on this server is very strange we configured the /proc/sys/vm/swappiness to 1 and restart the server but we can see that server is eating 15G , when the available is 44G !! HOW IT CAN BE?? [root@moon01 network-scripts]# more /proc/sys/vm/swappiness ...
Even with swappiness=1 Linux will continue to use swap if available. Your user-space programs do not need to exhaust free RAM for the kernel to start swapping. I first discovered this because I was having problems on an Ubuntu Linux desktop. In answers and comments to my question, someone pointed out that disk cachi...
swap is high inspite configuration is swappiness=1
1,440,716,501,000
I have a system that is becoming unresponsive for anywhere from a few seconds to a couple minutes. The only messages I see in the logs are like this: Sep 16 18:07:33 server kernel: igb 0000:01:00.3: exceed max 2 second Sep 16 18:07:50 server kernel: igb 0000:01:00.3: exceed max 2 second Sep 16 18:07:58 server kernel: ...
I've been seeing this problem (together with even more NIC Link is Down and NIC Link is Up messages) since updating from Devuan beowulf (with Kernel 4.19) to Chimera (with Kernel 5.10), on 00:14.0 Ethernet controller: Intel Corporation Ethernet Connection I354 (rev 03) on a Supermicro A1SRi-2558F board. The network in...
kernel: igb exceed max 2 second (system is unresponsive)
1,440,716,501,000
I updated the kernel from 3.10.0-514.26.2.el7.x86_64 to 3.10.0-693.11.6.el7.x86_64 I noticed all the kernel modules in 3.10.0-693.11.6.el7.x86_64 are now appended with ".xz" (sample output below) /usr/lib/modules/3.10.0-693.11.6.el7.x86_64/kernel/sound/soc/intel/skylake/snd-soc-skl-ipc.ko.xz /usr/lib/modules/3.10.0-69...
This is fine, modules can be compressed using either gzip or xz. Compression is enabled using the MODULE_COMPRESS kernel build option, with MODULE_COMPRESS_GZIP or MODULE_COMPRESS_XZ to select the compression tool.
CentOS7 latest kernel moved from "kernel.ko" to "kernel.ko.xz"
1,440,716,501,000
I am studying for a Computer Security exam, and I am struggling to understand the following sample question. 'Explain the difference between running in ring 0 on x86 and running as UID 0 in Linux. Give an example of something that each one enables, but the other does not.' My current understanding is that ring 0 on x8...
Your understanding is correct. “Ring 0” is the x86 term for the kernel mode of the processor. “Running in ring 0” means “kernel code”. In terms of security, everything that can be done by a process (under any UID) can be done by the kernel. Some things are very inconvenient to do from kernel code, for example opening ...
Linux Permissions UID 0 vs Ring 0
1,442,202,278,000
I am compiling the Linux kernel for my specific hardware and I only select the drivers/options which I really need. This is in contrast to a typical distribution kernel, where they compile almost everything, to be compatible with as many hardware configurations as possible. I imagine, for my kernel, I am only using 1%...
Compiling my comment as answer: Run the following command on one shell. You can make a shell script of it or demonize with the -d option. inotifywait -m -r -e open --format '%f' /kernel_sources/directory/in_use/ -o /home/user/kernel_build.log On other shell, execute make The log file /home/user/kernel_build.log will...
Find out which kernel source files were used when kernel was compiled
1,442,202,278,000
I've heard that FUSE-based filesystems are notoriously slow because they are implemented in a userspace program. What is it about userspace that is slower than the kernel?
Code executes at the same speed whether it's in the kernel or in user land, but there are things that the kernel code can do directly while user land code has to jump through hoops. In particular, kernel code can map application memory directly, so it can directly copy the file contents between the application memory ...
Why is userspace slower than the kernel?
1,442,202,278,000
Installing Debian I have to choose between the kernels linux-image-3.2.0.4-amd64 linux-image-amd64 What's the difference?
According to Debian wiki the package linux-image-amd64 is a metapackage meaning it does not exist but represent a set of package. In fact installing this package is the same as installing the last kernel available for amd64 architecture. If you install Linux-image-3.2.0.4-amd64 and this package is the only one ava...
Linux-image-3.2.0.4-amd64 vs linux-image-amd64 [duplicate]
1,442,202,278,000
I monitor value from /proc/meminfo file, namely the MemTotal: number. It changes if a ram module breaks, roughly by size of the memory module - this is obvious. I know the definition for the field from kernel documentation: MemTotal: Total usable ram (i.e. physical ram minus a few reserved bits and the kerne...
I was not comfortable with having bug in kernel or a module, so I digged further and found out... that MemTotal can regularly change, downwards, or upwards. It is not a constant and this value is definitely modified by kernel code on many places, under various circumstances. E.g. virtio_balloon kmod can decrease MemTo...
Why does MemTotal in /proc/meminfo change?
1,442,202,278,000
I'm experimenting with different kernel configuration files and wanted to keep a log on the ones I used. Here is the situation: There is configuration file called my_config which i want to use as a template I do make menuconfig, load my_config make NO changes and save as .config. When i do diff .config my_config, th...
Why would here be differences Because you loaded my_config into menuconfig, made changes, then saved it as .config. Of course they are different. If you saved it twice, once with each name, then they would be the same. If you mean, they are more different than you think they should be, keep in mind there is not a ...
Saving a kernel config file through menuconfig results with different options?
1,442,202,278,000
I'm working on building a kernel module for an input device, and I noticed that in the module source, there's a couple calls to input_get_keycode(data->input_dev, scancode, &keycode); When I was compiling I was getting errors that there's no function with that prototype. Looking into the input/input.c source code, thi...
If you are working on a kernel module, I very much recommend that you get a git tree. Obviously Linus's tree is mandatory - I also get the stable trees. Since you are working on Ubuntu, I'd check to see if they have a tree with their changes you can pull from. Using the git tree, I was able to checkout master and run ...
Changes to input_get_keycode function in linux kernel (input/input.c)
1,442,202,278,000
I'm trying to boot Linux from U-boot on an embedded ARM board using a filesystem on a remote machine served via NFS. It appears that the ethernet connection is not coming up correctly, which results in a failure to mount the NFS share. However, I know that the ethernet hardware works, because U-boot loads the kernel v...
You can compile a initrd image into kernel (General Setup -> Initial RAM filesystem and RAM disk (initramfs/initrd) support -> Initramfs source file(s)). You specify file in special format like (my init for x86): dir /bin 0755 0 0 file /bin/busybox /bin/busy...
Debugging ethernet before NFS boot
1,442,202,278,000
Asked this on superuser, got no response: Can anyone tell me of the status/state of WLM (Workload Management) kernel scheduler systems in Linux? Alternatively, any user-space process goal-based load management programs? This is a good start, but I'm not aware if these proposals are implemented? http://www.computer.or...
Not very sure, but the closest I can think of is cgroups: Control Groups provide a mechanism for aggregating/partitioning sets of tasks, and all their future children, into hierarchical groups with specialized behaviour. For more information, see one of: Arch Wiki page for cgroups Wikipedia cgroups page. RedHat...
Are there any Workload Management subsystems for Linux?
1,442,202,278,000
If I compile latest kernel from kernel.org, make a deb package and install it on my Debian system, shall I worry about libc (and any other libraries?) and kernel being out-of-sync? I vaguely understand that kernel developers try hard to not break API/ABI exposed to userspace, but I guess once in a while breaks do happ...
Linus is tougher on userspace breakage than pretty much any of his other policies. Breaks are way rarer than "once in a while", essentially unheard-of. Just don't worry about it at all.
How/Shall I keep libc and kernel in sync?
1,442,202,278,000
I would like to ask question about the output from sar -q . I appreciate if someone can help me out with understanding runq-sz. I have a system which cpu threads are 8 cpu threads on RHEL 7.2 . [ywatanabe@host2 ~]$ cat /proc/cpuinfo | grep processor | wc -l 8 Below is sar -q result from my system but runq-sz seems...
This man page has a more detailed explanation of this property: runq-sz The number of kernel threads in memory that are waiting for a CPU to run. Typically, this value should be less than 2. Consistently higher values mean that the system might be CPU-bound. Interpreting results As is the case with many "indicators"...
How is runq-sz counted in sar?
1,442,202,278,000
I am trying to debug a kernel running on QEMU with GDB. The kernel has been compiled with these options: CONFIG_DEBUG_INFO=y CONFIG_GDB_SCRIPTS=y I launch the kernel in qemu with the following command: qemu-system-x86_64 -s -S -kernel arch/x86_64/boot/bzImage In a separate terminal, I launch GDB from the same path a...
I ran into the same problem and found the solution from the linux kernel newbies mailing list. You should disable KASLR in your kernel command line with nokaslr option, or disable kernel option "Randomize the kernel memory sections" inside "Processor type and features" when you build your kernel image.
Hardware breakpoint in GDB +QEMU missing start_kernel
1,442,202,278,000
I want to enable google bbr on my VPS. But I don't know this feature is integrated on linux kernel or not. How can I check it?
Below command used to find the available tcp congestion control algorithms supported. 1. cat /proc/sys/net/ipv4/tcp_available_congestion_control bic reno cubic 2. This command used to find which tcp congestion control configured for your Linux. sysctl net.ipv4.tcp_congestion_control 3. Below command is used to chang...
How to check what congestion algorithm supported on my linux kernel?
1,442,202,278,000
How are the signals handled in the kernel. What happens internally if I send a kill signal to a kernel thread/process. Does a crash in kernel process means kernel panic always, if not will it generate coredump.
When a thread is running code in kernel mode, signals are queued, i.e. the kernel remembers that a signal has been sent but doesn't act on it. When a kernel thread is waiting for an event, the wait may be interrupted by the signal — it's up to the author of the kernel code. For example, the Linux kernel API has pairs ...
How signals are handled in kernel
1,442,202,278,000
My Raspberry Pi (which is 10,000 km away from me right now) works as follows: It is running Raspbian (July 2016's version) The SD card contains /boot An encrypted hard disk drive (using LUKS cryptsetup) contains / When the Pi boots, I can unlock the HDD remotely using dropbear over SSH. It asks for the HDD's password...
I do not know what gave you the impression that aptitude upgrade would leave your kernel untouched, it simply doesn't. I had the same trouble after a kernel update on my encrypted pi. The problem is that your initramfs needs to be rebuilt. Here is how you do that on an external machine. First, plug in your SD card wit...
initramfs, LUKS and dm_mod can't boot after upgrade
1,442,202,278,000
Are the system calls like fork(), exit() saved in some kind of function pointer table , just like the Interrupt Descriptor Table ? where does my OS go when I call my fork() or exit() ? I guess this image explains it, but I would like an explanation from a person who really knows what's happening , I don't want knowled...
There's a fantastic pair of articles on LWN that describe how syscalls work on Linux: "Anatomy of a system call", part 1 and part 2.
Is there any Syscall table just like Interrupt Table?
1,442,202,278,000
I've created a basic linux kernel module, which does the following: static __init int init(void) { printk(KERN_DEBUG "Banana"); return 0; } And of course: module_init(init); Strangely, I cannot find the string "Banana" after I insert the module via insmod banana_module.ko The command dmesg -k | grep Banana doe...
I've figured out what the problem was: I did not specify the endline character \n at the end of my kernel message. If you leave it out, it behaves like described above. The reason is, that kernel messages are rather seen as records that are only printed out when completed. For more information see this article about p...
module prints to kernel log with delay
1,442,202,278,000
While I know that lot of packet processing(CRC calculations, packet segmentation handling, etc) can be offloaded to NIC, then does each packet still cause an interrupt to CPU? Is there a difference if NIC is in promiscuous mode?
Normally, the NIC will only interrupt the CPU if it needs to send the received packet to the system. In non-promiscuous mode, this would only be for packets addressed to its MAC address, the broadcast address ff:ff:ff:ff:ff:ff, or a multicast address to which it has been subscribed. It also does validation before send...
Does each network packet cause an interrupt to CPU?
1,442,202,278,000
After building a new OpenBSD kernel, the install target of the kernel Makefile does the following: rm -f /obsd ln /bsd /obsd cp bsd /nbsd mv /nbsd /bsd I understand that the first two lines remove the old backup kernel /obsd and create a hard link /obsd pointing to the currently running kernel /bsd. In particular, th...
A makefile recipe will stop executing if any command in it returns a failure status (unless the command is preceded by a -). The recipe you cited will ensure that /bsd only gets replaced if the cp bsd /nbsd command succeeds. The cp could fail if the partition were full or out of inodes.
Installing a new OpenBSD kernel "safely": why does `make install` go through these extra hoops?
1,442,202,278,000
It is said that kernel responsible for the transport, internet and network access layers for a network data. Then, the network data is passed on the appropriate process based on port number. How security programs like firewall, IPS and IDS have access to network data that do not belong them while they are just user le...
Generally, those security programs contain two parts, one running in kernel space, one running in user space. The user space part is only an interface to iteract with kernel space part. For example, iptables contains: netfilter, a set of hooks to the networking code in the kernel. It also includes mechanisms for pass...
How security programs like firewall, IPS and IDS have access to network data?
1,442,202,278,000
I am trying to compile OpenOnload from Solarflare for my nic on a server that I'm building. It is saying something about not having a kernel build. root@server:/usr/src/openonload-201310-u2# ./scripts/onload_install onload_install: Building OpenOnload. mmakebuildtree: No kernel build at '/lib/modules/3.2.0-4-amd64/bu...
It's talking about the kernel development headers which are needed for compiling certain applications. On Debian-based distributions, you can install them with this command: sudo apt-get install linux-headers-`uname -r` If you're asked for that, you may also require the following: sudo apt-get install build-essential...
What is the "kernel build", and where do I get it?
1,442,202,278,000
What's the prescribed way to set Linux kernel runtime parameters? I've seen sometimes that people will set these in files such as /etc/rc.local. Is this really the right way to do this?
You can use sysctl to set some of the kernel parameters, specifically the ones under /proc/sys. These can be set in the file /etc/sysctl.conf or added to a single file (the preferred method on some distro's such as Fedora) in the directory /etc/sysctl.d. On distros that have this directory it's meant for customization...
What's the right way to set Linux kernel runtime parameters?
1,442,202,278,000
Is it possible to limit the access to a root account from within the kernel? I mean that if I press a button then the system detects the button being pressed and then allows access to the root account at boot. To me this could be useful to prevent a hacking attack from a bug of one of my programs that have an open po...
Anything is usually possible with Linux/Unix but most of the time a break-in isn't coming through the front door by logging into the root account. The more typical vector of attack is that a process that is running with elevated privileges is targeted for attack and then a weakness in the applications functionality is...
Linux Kernel limit access to root with a button?
1,442,202,278,000
I am trying to get some logging in place and am trying to troubleshoot it and this question became relevant. I use rsyslog config files to redirect some of my logging. (Will use iptables logging since I am working with it but please assume the general case) Under my rsyslog.d config I have :msg, startswith, "iptables...
The & only applies to the preceeding selector, so you will need one for each of those :msg lines. http://www.rsyslog.com/doc/rsyslog_conf_actions.html
If I redirect logs using rsyslog, will dmesg be affected?
1,442,202,278,000
I'm running a 64bit kernel, already have CONFIG_IA32_EMULATION set, so do I still need CONFIG_IA32_AOUT enabled? From the help in menuconfig, I don't quite get it.
Short answer: If your system is a normal desktop/laptop and you don't run any really archaic software, you should be safe to disable CONFIG_IA32_AOUT. Keep CONFIG_IA32_EMULATION, as chances are that some of your binaries are still 32-bit. Explanation: There are two issues involved here: executable file formats and e...
What does CONFIG_IA32_AOUT do actually?
1,442,202,278,000
I am using Gentoo, and I need to load an extra firmware to get my USB Wifi adapter work. I found an EXTRA_FIRMWARE_DIR kernel option, but I do not understand if it is used during compile time only or if it is effective after the new kernel is used. My WiFi adapter chip is Atheros, and according to this page, I have to...
Take a look at this: http://www.kernel.org/doc/menuconfig/drivers-base-Kconfig.html In particular: EXTRA_FIRMWARE "allows firmware to be built into the kernel, for the cases where the user either cannot or doesn't want to provide it from userspace at runtime" EXTRA_FIRMWARE_DIR "controls the directory in which the ke...
How to use the EXTRA_FIRMWARE_DIR kernel option?
1,442,202,278,000
I have 4GB RAM installed on my machine, and I'm considering using all of it (IE, installing PAE-enabled kernel). I heard there's a performance penalty for this, so I wanted to know about other's experiences. Should I proceed, or should I remain content with 3GB? [note] I will be running Linux 2.6.32.
If you have a 64-bit processor, an alternative would be to try a 64-bit kernel. According to this RedHat white paper, a typical server experiences around 1% performance hit, and other tasks suffered a performance hit of 0% - 10%. In addition to having more available memory, enabling PAE means you have an NX bit, which...
Is PAE worth it when I have 4GB RAM?
1,442,202,278,000
I removed kernel modules installed with rpm using yum remove kmodname. The *.ko was located under /lib/modules/$(uname -r)/extra/. I run depmod -a and I get depmod: ERROR: fstatat(4, kmodname.ko.xz): No such file or directory How can I force depmod to update its database?
Most likely you have symlinks, probably under one of your kernels' weak-modules, pointing at modules that have been deleted.
Why does depmod keep trying to load deleted modules
1,442,202,278,000
On one install, dnf managed to upgrade that kernel. On a newer machine (installed and upgraded today), it fails. Not sure why… Here is a full run: ; sudo dnf upgrade -y Last metadata expiration check: 5:42:13 ago on Wed 06 Mar 2019 10:56:30 GMT. Dependencies resolved. Problem 1: cannot install both kernel-3.10.0-957...
As far as Sardathrion and I can tell, we're jointly hitting a dnf breakage in the version currently shipped in our respective distributions of EL7. Sardathrion gets a Python traceback while I get a basic_string::_S_construct null not valid, ignoring this repo (which I cannot place in the dnf code). In both cases, we s...
dnf upgrade kernel on Centos 7…
1,442,202,278,000
I am looking for the basic kernel drivers to enable SATA support. I have a Braswell (Intel SoC) setup and I would like to reduce the number of kernel drivers to a minimum. Does SATA support need the ATA drivers ? What about the SCSI drivers ? Or Device Mapper Support (from the RAID menu) ? It seems there is more than ...
Partial answer: The kernel layers are a bit complex, and I can't give you a complete picture. Today, nearly all storage devices use some kind of SCSI commands (which why they show up as /dev/sdX instead of /dev/hdX), though that can be transported over different mechanisms (ATA packets, or USB, or others). So you need...
SATA: what linux kernel drivers are needed for basic support?
1,442,202,278,000
I wrote the following simple linux kernel module to test the param feature: #include<linux/module.h> int a = 5; module_param(a, int, S_IRUGO); int f1(void){ printk(KERN_ALERT "hello world\n"); printk(KERN_ALERT " value passed: %d \n", a); return 0; } void f2(void){ printk(KERN_ALE...
The /sys (sysfs) filesystem is somewhat special; many operations are not possible, for example creating or removing a file. Changing the permissions and ownership of a file or setting an ACL is permitted; that allows the system administrator to allow certain users or groups to access certain kernel entry points. There...
Why am I able to write a module parameter with READ ONLY permissions?
1,442,202,278,000
I have an embedded device with this SD card: [root@(none) ~]# busybox fdisk -l Disk /dev/mmcblk0: 3965 MB, 3965190144 bytes 4 heads, 16 sectors/track, 121008 cylinders Units = cylinders of 64 * 512 = 32768 bytes Device Boot Start End Blocks Id System /dev/mmcblk0p1 305 84...
I am guessing here, as I have no Kobo Glo (I wish my Bookeen HD was reprogrammable). You seem to have a 2Gb SD memory internally ( 60352 cylinders of 32K each) The dd does skip 2048 blocks of 512 (1048576), which is less than the 305 cylinder offset (9994240). In fact have to write more than 8Mb to reach the /dev/mmcb...
What does this dd command do exactly?
1,442,202,278,000
I wanted to know how to add packages to the Linux kernel and then package it to a ISO or CD for friends. Thanks in advance and please don't point me to LFS - Linux From Scratch!
Most of the distros can be used as a base and then customizations can be applied to this base, and written to an ISO. Fedora Fedora offers what's called a a "spin" or "respin". You can check them out here on the spins website: http://spins.fedoraproject.org/ It's pretty straight-forward to "roll your own" versions o...
How can I create my own distro and include a custom kernel & packages? [closed]
1,442,202,278,000
My PC has two processors, and I know that each one runs at 1.86 GHz. I want to measure the clock pulse of my PC processor/s manually, and my idea is just to compute the quotient between the number of assembler lines a program have, and the time my computer spends to execute it, so then I have the number of assembly i...
That won't work. The number of clock cycles each instruction takes to execute ( they take quite a few, not just one ) depends heavily on the exact mix of instructions that surround it, and varies by exact cpu model. You also have interrupts coming in and the kernel and other tasks having instructions executed mixed ...
How to measure the clock pulse of my computer manually?
1,442,202,278,000
udev is responsible for populating /dev. It adds and removes device nodes to /dev dynamically based on rules/configs/scripts under /lib/udev and /etc/udev/. If I have a CDROM device node /dev/sr0 I can add a symlink /dev/cdrom by adding a rule like: SUBSYSTEM=="block", KERNEL=="sr0", SYMLINK+="cdrom", GROUP="cdrom" I...
The default device, based on the kernel name (sr0 in this case) is always created automatically as a real device file, so no rule is needed for that. Additional synonyms are then created by writing rules which specify symlinks to be added which point at the real file.
How does udev create /dev/sr*? (Or: Which rule does create /dev/sr*?)
1,442,202,278,000
So I've been at this for a while and have been poking around for an answer for a few days, and figure it's about time to ask for help. I am running Ubuntu 10.10 in VMWare Fusion, and have downloaded a copy of the 3.2 kernel and built it with all default settings. When I try to boot into the new kernel after a call t...
You forgot to build your initrd that goes with the kernel. Run update-initramfs -c -k kernelversion and then update-grub to find it and add it to the grub menu.
Kernel Panic - not syncing: VFS: Unable to mount root fs after new kernel compile
1,442,202,278,000
Dear all, I was wondering where the trampoline code went. It is referenced here, and I could find some code in an earlier distro, but I can't find it in the 2.6.38 kernel. Can you explain to me the path of execution, if trampoline.S is not there anymore? Thanks.
When the x86_64 a.k.a. amd64 architecture was introduced in the Linux kernel tree, it was in a separate subtree from i386. So there was arch/i386/kernel/trampoline.S on one side and arch/x86_64/kernel/trampoline.S on the other side. The two architectures were merged in 2.6.24. This was done because there was a lot of ...
Where did Trampoline.S go?
1,442,202,278,000
If I enable Hyper-Threading for my netbook which has an Intel Atom (1.6 GHz) will the kernel see two virtual 800 MHz processors?
No, it will create two virtual 1.6 GHz processors. (However, when not under load, they will clock down to a much lower clock speed, then 800 MHz might be correct.) Do cat /proc/cpuinfo for information about them.
Will enabling Hyper-Threading create two virtual half-speed processors?
1,442,202,278,000
Does the PREEMPT_RT patch (real-time kernel) have any benefit for regular desktop users?
I don't think so. The patch seems to provide real-time scheduling which is very important for some enviroments (planes, nuclear reactors etc.) but overkill for regular desktop. The current kernels however seems to be enough "real-time" and "preemptive" for regular desktop users[1]. It may be useful if you work with hi...
Does the Linux PreemptRT patch benefit desktop users?
1,442,202,278,000
Is there any patch for Linux kernel to use different memory allocators, such as ned allocator or TLSF allocator?
The allocators you mention are userspace allocators, entirely different to kernel allocators. Perhaps some of the underlying concepts could be used in the kernel, but it would have to be implemented from scratch. The kernel already has 3 allocators, SLAB, SLUB, SLOB, (and there was/is SLQB). SLUB in particular is desi...
Kernel memory allocator patch
1,624,558,154,000
After reading man user_namespaces, I'm not sure, whether user (group) ID mappings to the parent namespace, set in /proc/[pid]/uid_map (/proc/[pid]/gid_map), apply to all processes in the namespace or only for the process [pid]? If the mappings apply to all processes, then it's a bit of a race-condition, which process ...
The manpage says After the creation of a new user namespace, the uid_map file of one of the processes in the namespace may be written to once to define the mapping of user IDs in the new user namespace. An attempt to write more than once to a uid_map file in a user namespace fails with ...
Do user (group) ID mappings in `/proc/[pid]/uid_map` (`/proc/[pid]/gid_map`) only apply for the process `[pid]` or globally for the whole namespace?
1,624,558,154,000
I am running Ubuntu 19.04, after installing virtualbox and rebooting, i noticed these non-descriptive lines in the /var/log/kern.log Sep 30 16:36:34 a kernel: [ 236.760271] test1 Sep 30 16:36:34 a kernel: [ 236.760273] test2 Sep 30 16:41:07 a kernel: [ 509.036723] test1 Sep 30 16:41:07 a kernel: [ 509.036726] test...
This has been taken from https://wiki.chotaire.net/vbox-test-warning-messages. Kudos to them. If it helps you, please consider visiting them and letting them know it was helpful. The source code for Virtual Box 6.0.6 shows kernel print statements that have been accidentally left in the production release. If you're u...
i noticed these odd lines in my /var/log/kern.log file, what are they?
1,624,558,154,000
In my previous question How does the kernel scheduler know how to pre-empt a process? I was given an answer to how pre-emption occurs. Now I am wondering, how does the kernel scheduler know that a timeslice has passed? I read up on the hardware timer solution which makes sense to me, but then I read that most current ...
It seems like some hardware timer would be necessary? Yes, the kernel relies on hardware to generate an interrupt at regular intervals. On PCs, this was historically the 8253/8254 programmable interval timer, or an emulation thereof, then the local APIC timer, then the HPET. Current Linux kernels can be built to run...
How does the kernel scheduler know a timeslice has passed?
1,624,558,154,000
I have a development board which has an older version of Linux installed on it. The vendor supplies an image for the device with a heavily modified linux kernel, some loadable kernel modules, and some example software. I would like to install a newer version of the linux kernel on the device, but the vendor has no sup...
This question has a lot of assumptions in it. Here are some reasons. The kernel interface is not stable so a module for one version may not compile for a different version. The kernel may not expose a required facility. The kernel may expose a required facility but not in a way that is acceptable, for example requirin...
Why modify the linux kernel instead of creating a kernel module?
1,624,558,154,000
I have one kernel installed currently, 3.10.0-327.28.3. In my /boot directly, I have what looks like a lot of stuff that package-cleanup perhaps missed: -rw-r--r-- 1 root root 17M Aug 28 18:00 initramfs-3.10.0-327.10.1.el7.x86_64.img -rw-r--r-- 1 root root 17M Aug 28 18:00 initramfs-3.10.0-327.28.2.el7.x...
Yes. Those files are from previous kernel installation. You may had upgraded kernel hence old kernel files along with their initramfs files are residing on /boot partition. If you want to clean up them then you can remove by using distribution-specific utility like apt-get. Once you remove, then execute the following ...
Is it safe to remove these kernel files in /boot? [duplicate]
1,624,558,154,000
For the millionth time or so I had to look in /usr/include/foo.h to find the members of a struct foo or foo_t or whatever. There's a man section for library and kernel calls, some of which include descriptions of data structures and others not. Is there a single place to look up the definitions of kernel and library d...
The GNU C library has a reference manual that includes documentation for all or most of the data structures in the standard library and extensions. This has a type index. Beware there's also a "GNU C Reference Manual", but it and the "GNU C Library Reference Manual" are two different things. You can also autogenerat...
Is there a man section or other doc repository for data structure definitions?
1,624,558,154,000
I'm trying to use Redis for production services and trying to avoiding swapping, which is bad for performance. I had learn that swap is triggered by swap_tendency which is depending on swap_tendency = mapped_ratio/2 + swappiness + distress How can I get mapped_ratio/distress from /proc/meminfo for my monitor script?...
mapped_ratio mapped_ratio can be calculated like so: mapped ratio = (nr mapped * 100) / total memory; Source: https://www.cs.columbia.edu/~smb/classes/s06-4118/l19.pdf nr_mapped The value, nr_mapped can be read from /proc/vmstat: $ grep nr_mapped /proc/vmstat nr_mapped 47640 distress According to this article, title...
When is swap triggered or how to calculate swap_tendency?
1,624,558,154,000
I'm using qemu for different kind of tasks, I would like to pick a filesystem that is both qemu-compatible and easy to mount under my host. I already discarded both qcow and qcow2 because apparently they are not supported as filesystem by the linux kernel, there is a little trick but it doesn't meet my needs, I basica...
Instead of using an image file (or in addition to an image file) you can use a block device (LVM or loop device) and pass this to the VM (which sees it as disk drive). You can mount it from the guest and from the host. But you should make sure this is not done simultaneously. The obvious disadvantage: This volume does...
filesystem that works under qemu and I can mount on my host
1,624,558,154,000
From here: http://www.xenomai.org/index.php/RTnet:Installation_%26_Testing#Debugging_RTnet The Linux driver for the real-time network device was built into the kernel and blocks the hardware. When I execute rmmod 8139too it says the module does not exist in /proc/modules. Kernel is 2.6.38.8 (64 bit). What other in...
rmmod 8139too doesn't work because either: 8139 support is built into the kernel, and the driver can't be unloaded because it's not a module. On many systems, there's a /boot/config-2.6.38.8 file (or similar). You can grep it for something like ‘8139TOO’. If you see something like CONFIG_8139TOO=m, then the 8139too d...
How to know whether the Linux driver for the real-time network device was built into the kernel?
1,624,558,154,000
During a recent update I received this: Installing: kernel-default-2.6.37.6-0.11.1 [error] Installation of kernel-default-2.6.37.6-0.11.1 failed: (with --nodeps --force) Error: Subprocess failed. Error: RPM failed: installing package kernel-default-2.6.37.6-0.11.1.x86_64 needs 147MB on the / filesystem Abort, ret...
Make a backup before making any of the following changes Do not proceed without either a backup or the willingness to lose all data. run du -sh /home to get the size used by /home directory. If it's sufficiently large(>=4G), /home is a good candidate to have its own partition. Boot from either a livecd or System...
Not enough space on / to install new kernel update
1,624,558,154,000
I had difficulties installing Cisco5.0 VPN on my Ubuntu 10.04 LTS. I asked for assistance in this question: link to previous question. The answer is that this Cisco program will run on only older versions of the kernel. I would like to use the VPN to connect through my university's network so that I can view academic...
I installed VPNC instead through the synaptic package manager. It was able to import the .pcf file for the cisco VPN. It was then able to connect properly.
Installing OpenVPN to replace Cisco VPN because Cisco will not work with the kernel I am on or downgrade instead?
1,624,558,154,000
While configuring kernel for debugging found this option: CONFIG_X86_PTDUMP: Export kernel pagetable layout to userspace via debugfs Does this mean RAM page-table layouts ? any guides on how to use debugfs and view this layout ?
Take a look at the following: Page table management Dumping kernel page tables
Dump Page table layout (KERNEL CONFIG)
1,624,558,154,000
How can i create initrd image for a new(experimental) kernel without actually installing it. (Existing tools to create initrd based on config and details from installed kernel.) Say i compile a new kernel with experimental features turned on, i have this in another separate partition. I would like to boot into this k...
Creating an initrd doesn't have anything to do with installing a kernel. All you do is to create a file structure for the initrd, copy the required files, write the init script and package all of that into a cpio archive. I used the instructions in the Gentoo Wiki to make my initrd. Some distributions make tools to ge...
Creating new initrd without installing kernel
1,624,558,154,000
I would like to study the flow of some linux device drivers and some minimal flow of kernel (threading cum context switching and interrupt management). How can I debug the linux kernel? What are the basic steps for doing that? Recently i successfully compiled and integrated new kernel (2.6.34.7) into my machine runnin...
It depends on what you really need. Probably simple printk() function is gonna be OK for the beginning. There is also the /proc interface you can use to get useful information from kernel. If you need something more complicated, use KGDB (kernel debugger).
Kernel debugging
1,624,558,154,000
I would like to know how much CPU / memory my current iptables rules consume. I have tried looking in ps and htop, but even with kernel threads displayed and did not see anything related to iptables. I am using the conntrack module with these module-specific settings: xt_recent.ip_pkt_list_tot=1 xt_recent.ip_list_tot=...
Linux Kernel's Process: Many Kernel's functions like Iptables are processed in the Kernel level as kworker tasks, they are visible on task managers like top. As mentioned on the comments, you can compute the CPU and memory usage by comparing the total ressource usage usage with and without loading the iptables rules. ...
How to monitor the performance of "iptables" kernel module?
1,624,558,154,000
I have been playing around kernel programming for a while and want to create this simple data acquiring interface with some custom hardware. For portability and reusability, I do the whole thing on my Raspberry Pi. The challenging part of the project is having a high speed ADC (parallel) connected to GPIO's and havin...
For the userspace data collection program, what is wrong with an infinite loop? As long as you are using the poll system call, it should be efficient: https://stackoverflow.com/questions/30035776/how-to-add-poll-function-to-the-kernel-module-code/44645336#44645336 ? Permanent data storage I'm not sure what is the best...
Saving data from kernel module into userspace
1,624,558,154,000
According to Documentation/x86/x86_64/mm.txt, the layout of kernel space should be like this in 64bit linux: 6 0000000000000000 - 00007fffffffffff (=47 bits) user space, different per mm 7 hole caused by [48:63] sign extension 8 ffff800000000000 - ffff80ffffffffff (=40 bits) guard hole 9 ffff880000000000 - fff...
Well, now I think I can give myself an answer:) In a word, in 32-bit linux, some kernel regions collide to prevent waste of limited kernel virtual address space(e.g., modules and vmalloc arena, kernel image and physmap) so the layout of kernel space may not be as clear as it is in 64-bit. The layout of kernel space i...
What is the layout of kernel space in 32bit linux?
1,624,558,154,000
I'm using Linux in embedded systems, and want to configure the system to automatically reboot after a kernel panic. However, when the system comes back up, it's important for me to detect and log the fact that the kernel panicked (rather than, say, the user toggling the power switch). I could configure a kernel core d...
If you run customized kernels for your embedded hw and have some hw register/bit available you may be able to customize the kernel crash code to set a flag in that hw location which you'd check after reboot. If not AFAIK you're only chance is to configure your kernel core dumping facility. Indeed, it's risky to write ...
How do I detect that my system has auto-rebooted after a kernel panic?
1,624,558,154,000
With the real-time executive approach, a small real-time kernel coexists with the Linux kernel. This real-time core uses a simple real-time executive that runs the non-real-time Linux kernel as its lowest priority task and routes interrupts to the Linux kernel through a virtual interrupt layer. All interrupts are init...
This sounds very much like the approach taken by RTLinux, which still seems to be available but not commercially supported. That being said, there's a community unto itself about real-time Linux concepts, and the CONFIG_PREEMPT_RT patch would seem to enable the functionality you're looking for. As with all kernel hack...
Real-time executive approach, can be run in desktop Linux?
1,624,558,154,000
I'm compiling a flavor of the Linux kernel based on the default configuration (for an ODROID system), with some additional features enabled. I want to automate this process so that I don't have to reselect the features again if I want to build a newer version of the kernel. I could have saved the whole .config file, b...
You can apply your current .config to a newer version of the kernel; they're tagged, and the make system will update it appropriately without changing what you have -- that's not a guarantee, of course; there may be some kind of incompatibility that requires a change. I can't recall noticing anything like this, howev...
How to automate configuration of the Linux kernel build
1,624,558,154,000
I have a remote server which has some issues (Seem hardware related) which means that it logs KVM errors and then sometime later it becomes unresponsive and locked up. There is an often an early indication of it failing, in the dmesg log output, so I would like to know, is there a Debian utility which can send me (da...
In the past I've used logwatch to do exactly this. Directions on customizing it are here, titled: HOWTO-Customize-LogWatch. Installation $ sudo apt-get install logwatch Setup Logwatch runs daily but can be configured to run more frequently It's typically kicked off from a crontab entry. $ ls -l /etc/cron.daily/0logwa...
dmesg email digest
1,624,558,154,000
I'm using Debian testing, and I've problems with MiniDLNA on kernel > 3.2. The DLNA client works about 30 min, after that it lost the connection with the minidlna server and can't discover the server again. But if I load with an old kernel (3.2) all works fine. The time that minidlna works (30 min) may be related to t...
It was related to my network configuration. My network config: iface br0 inet static address 192.168.5.2 netmask 255.255.255.0 gateway 192.168.5.1 bridge_ports eth0 bridge_stp off bridge_maxwait 0 bridge_fd 0 In 3.5 kernel was added multicast_querier toggle and disabled queries by default...
What changed between kernels 3.2 and 3.9 that affect MiniDLNA?
1,624,558,154,000
I am trying to disassemble a compound file that consists of several parts, one of which is an uncompressed kernel sandwiched between several other files. I am trying to find the exact length of the kernel part which is proving difficult. Is there some indication in the vmlinux header of how much data the bootloader...
The quick answer is "no", but if this is an ELF image then with some hacking you can probalby find kernel. See the readelf hack below. The bootloader is responsible to know the format of whatever file in which the kernel and root filesystem reside. This includes knowing the size of the kernel file, in whatever fomat i...
Does the vmlinux header contain the length of the kernel image?
1,624,558,154,000
The kernel configuration contains an NLS_UTF8 option. It can be found under File systems → Native language support. What does it do? Its description maintains that it is needed for using a FAT or JOLIET CD-ROM filesystem. Is it necessary for an ext[234] filesystem?
FAT filenames (not file contents) are encoded in a country-specific manner, DOS called those "codepages". They need to be present in the kernel so your console con correctly display the characters. This also counts for the UTF-8 encoding of the Unicode charater set. This doesn't apply to ext FS though, read up here.
What does the CONFIG_NLS_UTF8 kernel option do?
1,624,558,154,000
I want to compile and install a kernel.org kernel on a custom HDD volume, say /dev/sda5, instead of being merged with my current Ubuntu's directories. I can find information about configuration and compilation process all over the web, but there's no track of how to put the kernel on a custom volume (different than th...
You can compile a kernel anywhere you like, including your home directory. The only time directories outside the build tree are modified is when you make one of the install* targets. So, to install a kernel you'd do the obvious: cd $SOME_DIRECTORY tar -xjvf linux-$VERSION.tar.bz2 cd linux-$VERSION make mrproper menuco...
Compiling and installing a kernel.org kernel to a custom volume on disk
1,624,558,154,000
I recently migrated an existing Debian system to new hardware, a core i3 chip running on an intel sandy bridge motherboard. I’m experiencing a very strange problem; when I ping my router, about 50% of the packets are getting dropped. I spent some time testing, and can verify it’s not the router. It works fine with mul...
Apparently this issue is already known to the Ubuntu folks. Got to hand it to 'em! For starters: the quick work around. You can get your system running again by slowing down the ethernet to 10 mpbs like this: sudo ethtool -s eth0 speed 10 autoneg off (Note the mii-tool does NOT work with this ethernet chip) I actuall...
Debian 6.0 system with 2.6.39 kernel dropping packets, sandy bridge hardware