Tag Info

Hot answers tagged

53

It simply gives an illusion of speed to programs that don't actually have to wait until a write is complete. Mount your filesystems in sync mode (which gives you your instant writes) and see how slow everything is. Sometimes files exist only temporarily... a program does some bit of work and deletes the file right after the work is done. If you delayed ...


37

What's the philosophy behind such an approach? Efficiency (better usage of the disk characteristics) and performance (allows the application to continue immediately after a write). Why isn't the data written at once? The main advantage is the OS is free to reorder and merge contiguous write operations to improve their bandwidth usage (less ...


23

Asynchronous, buffered I/O was in use before Linux and even before Unix. Unix had it, and so have all its offshoots. Here is what Ritchie and Thompson wrote in their CACM paper The UNIX Time-Sharing System: To the user, both reading and writing of files appear to be synchronous and unbuffered. That is immediately after return from a read call the ...


13

Many good answers, but let me add one other thing... Remember that Unix is a multi-process and multi-users system, so potentially many users would be trying to do file-operations (esp. writes) at (almost) the same time. With old slow hard-disks - perhaps mounted over the network - this would not only take time (for which the programs would basically ...


10

It is not specific to Linux, and it is called the page cache (which Linux does quite well). See also http://linuxatemyram.com/; so if a file is written, then read again a few seconds later, very often no disk I/O is needed. The main advantage is that on many systems, there is a lot of RAM, and some of it can be used as a cache by the kernel. So some files ...


7

Spinning platters are slower than RAM. We use caching of reads/writes to 'hide' this fact. The useful thing about write IO is that it doesn't require disk IO to happen immediately - unlike a read, where you can't return data to the user until the read completes on the disk. Thus writes operate under a soft time constraint - as long as our sustained ...


5

None of the other answers mentioned delayed allocation. XFS, ext4, BTRFS, and ZFS all use it. XFS has been using it since before ext4 existed, so I'll use it as the example: XFS doesn't even decide where to put data until writeout. Delayed-allocation gives the allocator much more information to base its decisions on. When a file is first being written, ...


4

Programs like SSH, sudo, su, etc., start the shell using the exec family of system calls. And these system calls allow the calling program to specify every argument, including the function. For example, using sudo to start a login shell: $ strace -fe execve -o sudo.log sudo -i root:~ $ echo $0 -bash root:~ $ logout $ grep bash sudo.log 19124 ...


3

Mysql doesn't have a kernel module, therefore it runs in user mode. Perhaps what you are seeing is that mysql is using memory-mapped files instead of calling read/write. So, accessing a page of memory causes a read/write without using a syscall. Or, perhaps you called strace without "-f" to follow the child processes?


3

All the other answers here are at a minimum mostly correct for the normal case, and I would recommend reading any of them before mine, but you mentioned dd and dd has a typical use case that May not involve write caching. Write caching is primarily implemented at the filesystem level. Raw devices do not normally do write caching (multiple device drivers such ...


2

The kernel and the NIC communicate the same way the kernel (specifically, a device driver, which is part of the kernel) communicates with any other device (e.g., serial communications device (like keyboard, mouse, or RS232), disk (or disk-like mass storage device), display, security token, etc.) – they talk directly to each other.  So, yes, this happens ...


2

"Understanding the Linux Kernel" by "Daniel P. Bovet, Marco Cesati" could be what you are looking for.


2

How about Linux Kernel in a Nutshell by Greg Kroah-Hartman? Also worth having a look at Linux Kernel Newbies : Documents.


2

I installed the linux-lts package as suggested by @mikeserv from chroot and I set it as the default boot option from the grub configuration. This way I could boot nicely into linux 3.14 and complete the installation process. The vanilla linux kernel is installed alongside with the LTS version so using the "advanced options" from the grub menu I could still ...


2

My particular problem turned out to be ifplugd. It failed with a NLAPI: Packet too small or truncated error everytime I plugged my ethernet cable in or out. Seems like some change in Kernel 3.9 introduced something. So I recompiled ifplugd with a change to the buffer size in src/nlapi.c line 74. -- char replybuf[1024]; ++ char replybuf[8*1024]; Now it ...


2

According to _syscall(2) man page the _syscall0 macro may be obsolete and requires #include <linux/unistd.h>; indeed Linux 4.x don't have it However, you might install musl-libc and use its _syscall function. And you could simply use the indirect syscall(2) in your user code. So your testing program would be #define _GNU_SOURCE /* See ...


2

It trades a small amount of reliability for a great increase in throughput. Suppose, for example, a video compressing program. With delayed write ("write back"): spend 10ms compressing frame issue write frame to disk wait 10ms for disk to acknowledge write complete GOTO 1 Versus spend 10ms compressing frame issue write frame to disk (completes in ...


2

The philosophy is unsafe-by-default. There are two reasonable and obvious strategies possible: flush writes to disk immediately or delay writing. UNIX historically chose the latter. So get safety, you need to call fsync afterwards. However, you can specify safety upfront by mounting a device with option sync, or per-file by opening them with O_SYNC. ...


2

So I'm not sure if you're looking to do this programmatically or not. But the first step you'd need to accomplish this is a database that catalogues all of this sort of information for each distribution and their respective releases. Luckily… that is exactly what distrowatch.com is. You can gather this information using their advanced search page, which ...


1

So, here's what the link says: Maintaining ELILO If your distribution includes scripts to maintain ELILO automatically, and if those scripts work, you shouldn't need to do much to maintain this boot loader. As noted earlier, though, in my experience these auto-maintenance scripts are often worse than useless. Thus, you may need to keep your ELILO ...


1

Probably it depends on the video mode and zero page (struct bootparam, documented here, it also includes struct screen_info) setup prepared by a bootloader (GRUB) and BIOS. bootparam is passed to decompress_kernel() as the first argument. The actual function of debug_putstr() is __putstr() (Note that it's enabled only when CONFIG_X86_VERBOSE_BOOTUP is ...


1

The kernel I used was stripped afterwards. My modules were not stripped. Hence they were so big.


1

In many applications, storage devices will be intermittently busy reading data. If a system is always able to defer writes until a time when the storage device isn't busy reading data, then from an application's point of view the writes will take zero time to complete. The only situations in which writes would not be instantaneous would be when: Write ...


1

The DHCP client daemon (dhcpdc, dhclient, etc) are programs that are started during the init process. These programs are not always directly invoked by init, but rather the program that handles networking will do this when an interface is configured to use dhcp. For example, netctl is one such program distros use to manage the networking interfaces. This ...


1

This is easy to replicate with zsh, which allows the appropriate argument to the exec(3) call to be specified via ARGV0: % ARGV0=-bash bash -bash-4.1$ ps o cmd --pid=$$ CMD -bash -bash-4.1$ exit % ARGV0=imnotaduck bash $ ps o cmd --pid=$$ CMD imnotaduck $ exit % In C, as done by login(1), the code would run something along the lines of: ...


1

You should be able to re-compile it using something to the similar commands. make KERNEL_DIR=/usr/src/linux make install KERNEL_DIR=/usr/src/linux make dep make bzIamge make make install make modules Source: iptables: Table does not exist (do you need to insmod?)


1

Various layers within Linux, also showing separation between the userland and kernel space for full image Source


1

The steps I took to fix it: updated BIOS In the BIOS, diabled the SATA IDE Combined Mode with this help reading the kernel documentation about kernel parameters, since every solution online was about adding parameters to that. I found out that my SSD actually only supports SATA speed 3.0Gbps with a good shell script for i in `grep -l Gbps ...



Only top voted, non community-wiki answers of a minimum length are eligible