Linux Kernel: fs: handle SEEK_HOLE/SEEK_DATA properly in all fs’s that define their own llseek

Posted on

This change “fs: handle SEEK_HOLE/SEEK_DATA properly in all fs’s that define their own llseek” (commit 06222e4) in Linux kernel is authored by Josef Bacik <josef [at] redhat.com> on Mon Jul 18 13:21:38 2011 -0400. Description of “fs: handle SEEK_HOLE/SEEK_DATA properly in all fs’s that define their own llseek” The change “fs: handle SEEK_HOLE/SEEK_DATA properly in
Read more

New Linux Kernel 5.0: Features and Improvements

Posted on

Linux is the most used and well-known open-source operating system for computers, mobile devices, servers, and mainframes, etc. Linux has so many awesome features to serve its users like Live CD/USB. And it is fast, easy and free to use by computers around the world. The kernel is referred to as the essential component of
Read more

What is the difference between work conserving I/O scheduler and non-work conserving I/O scheduler?

Posted on

What is the difference between work conserving I/O scheduler and non-work conserving I/O scheduler? In a work-conserving mode, the scheduler must choose one of the pending requests, if any, to dispatch, even if the pending requests are far away from the current disk head position. The rationale for non-work-conserving schedulers, such as the anticipatory scheduler
Read more

Getting Hostname in Bash in Linux in 3 Ways

Posted on

Getting the hostname of the node running a program can be useful in various scenarios, such as creating logs with the hostname, identifying which node a script is running on, or configuring a distributed system with different nodes. In Bash, there are several ways to retrieve the hostname of the machine, as mentioned in the
Read more

What is the vruntime of one process after it is moved into another run queue in Linux Kernel

Posted on

When we do migration, one process will be migrated from one source CPU’s runqueue to destination CPU’s run queue. What is the virtual run time (if CFS is used) after it is moved into destination CPU’s run queue? When the process is dequeued from source CPU’s run queue, its vruntime will minus the minimum vruntime
Read more

How to change CONFIG_HZ parameter for Linux Kernel

Posted on

If we want to change the tick time for Linux Kernel, we need to change CONFIG_HZ parameter in Linux Kernel. Do we have other better ways to change it rather than compiling Linux Kernel. Please ignore the way to add ‘divider=10’ in grub config file because it is limited only for RH/CentOS distros. Zhiqiang, please
Read more

Maximum number of mmap()’ed ranges and how to set it on Linux?

Posted on

What’s the maximum number of mmap()‘ed ranges that a process can makes and how to set the limits on Linux? I have a program that mmap()s and mprotect()s lots ranges. After allocating many ranges, mprotect() starts to fail with ENOMEM error number. From the man page, ENOMEM means 2 possible problems: ENOMEM Internal kernel structures
Read more

How to make Linux automatically reboot after a kernel panic?

Posted on

After a kernel panic, it is impossible to remotely connect to the Linux server to reboot it by SSH. How to make the panic kernel automatically reboot itself? Linux kernel has a nice feature that reboots itself after a timeout when a kernel panic happened. Usually, it is disabled by default. To turn it on,
Read more

How to install drivers for TL-WN725N v2 USB wireless adapter on Fedora 19

Posted on

I had a TP-Link TL-WN725N v2 USB wireless adapter. But it seems the kernels in Fedora 19 have not yet included drivers for it. How to install drivers for TL-WN725N v2 on Fedora 19? The driver is under development. You can find the source here and in the drivers/staging in the Linux kernel. If you
Read more

SEEK_HOLE and SEEK_DATA: efficiently archive/copy large sparse files

Posted on

How to efficiently archive a very large sparse file, say 1TB? The sparse file may contains a small amount of data, say 32MB. SEEK_HOLE and SEEK_DATA The SEEK_HOLE/SEEK_DATA functionalities play the trick and makes `tar` and `cp` handle the large sparse file very efficiently. `lseek` with `SEEK_HOLE` returns the offset of the start of the
Read more

How To Debug Linux Kernel With Less Efforts

Posted on

Introduction In general, if we want to debug Linux Kernel, there are lots of tools such as Linux Perf, Kprobe, BCC, Ktap, etc, and we can also write kernel modules, proc subsystems or system calls for some specific debugging aims. However, if we have to instrument kernel to achieve our goals, usually we would not
Read more

I/O Microscopy: Tasks’ Disk I/O Information with High Accuracy

Posted on

Abstract Most popular task monitor systems (such as top, iotop, proc, etc) can only get tasks’ disk I/O information like tasks’ I/O utilization percentage every seconds due to kernel timer/tick frequency and high time cost of system interfaces. This article presents I/O Microscopy, a new way to get tasks’ disk I/O information with high accuracy.
Read more

Building and Installing Linux Kernel from the Source Code in an Existing Linux OS

Posted on

Building Linux kernel may sound a complex and geek-only thing. However, as Linux kernel itself has much less depended tools/packages compared to other software packages, it is quite easy to compile, build and install a Linux kernel from the source code in an existing Linux OS. Building Linux kernel is needed if you need to
Read more

How does linux kernel collect task stats data

Posted on

Motivation Recently, I find it is hard to know the percentage of time that one process uses to wait for synchronous I/O (eg, read, etc). One way is to use the taskstats API provided by Linux Kernel [1]. However, for this way, the precision may be one problem. With this problem, I dig into Linux
Read more

x-data-plane feature in QEMU/KVM

Posted on

Abstract In systems, sometimes, we use one global lock to keep synchronization among different threads. This principle also happens in QEMU/KVM (http://wiki.qemu.org/Main_Page) system. However, this may cause lock contention problem. The performance/scalability of whole system will be decreased. In order to solve this problem in QEMU/KVM, x-data-plane feature is designed/implemented, which the high-level idea is
Read more

The length of timeslices for processes under CFS process scheduling algorithm in Linux Kernel

Posted on

Abstract As is known, CFS (Completely Fair Scheduling) is a famous process scheduling algorithm in Linux Kernel but there is no convenient way for developers to get the timeslices of processes if CFS is chosen. In this article, I will introduce one way to hack the timeslices of process easily for CFS in Linux Kernel.
Read more

How sched_min_granularity_ns, sched_latency_ns and sched_wakeup_granularity_ns in CFS affect the timeslice of processes

Posted on

Abstract Currently, the most famous process scheduling algorithm in Linux Kernel is Completely Fair Scheduling (CFS) algorithm. The core idea of CFS is to let each process share the same proportional CPU resources to run so that it is fair to each process. In this article, I will introduce how sched_min_granularity_ns and sched_latency_ns work internal
Read more

How migration thread works inside of Linux Kernel

Posted on

Abstract In computer systems, resources have to be balanced so that the performance will be better based on the same hardware. In Linux Kernel system, we will see some migration kernel threads running as daemons to do this kind of jobs as follows. In this article, we will discuss how Linux Kernel balances its hardware/software
Read more