Language Selection

English French German Italian Portuguese Spanish

Linux: Accessing Files With O_DIRECT

Filed under
Linux

A thread on the lkml began with a query about using O_DIRECT when opening a file. An early white paper written by Andrea Arcangeli [interview] to describe the O_DIRECT patch before it was merged into the 2.4 kernel explains, "with O_DIRECT the kernel will do DMA directly from/to the physical memory pointed [to] by the userspace buffer passed as [a] parameter to the read/write syscalls. So there will be no CPU and memory bandwidth spent in the copies between userspace memory and kernel cache, and there will be no CPU time spent in kernel in the management of the cache (like cache lookups, per-page locks etc..)." Linux creator Linus Torvalds was quick to reply that despite all the claims there is no good reason for mounting files with O_DIRECT, suggesting that interfaces like madvise() and posix_fadvise() should be used instead, "there really is no valid reason for EVER using O_DIRECT. You need a buffer whatever IO you do, and it might as well be the page cache. There are better ways to control the page cache than play games and think that a page cache isn't necessary."

Linus went on to explain,

Full Story.

More in Tux Machines

Kubuntu 14.10 review

KDE has improved in may respects since my last review of Kubuntu, so it’s fair to say that Kubuntu itself has improved. Muon Discover has improved too, so kudos to the developer. However, Kubuntu is not the best KDE-using distribution around. ROSA Desktop, for example, offers many more features than most KDE-using desktops. That said, Kubuntu 14.10 should be good enough for most users. If you would like to take it for a spin on your computer, installation images are available for download from here. Read more

Dispelling the myths of open source licences

Misconceptions surrounding the rights and obligations provided by open source software in the enterprise have fueled the spread of fear, uncertainty and doubt. A better understanding of the role open source licensing will help organizations realist the full potential of open source investments. Read more

Cinnamon Desktop Spices Up Makulu Linux

The Makulu Cinnamon Debian Edition 1.1 marks a new path for Makulu. This latest release has numerous new features that could make it a top competitor against the Linux Mint Cinnamon edition. Read more

Ubuntu 14.10 vs Kubuntu 14.10 vs Xubuntu 14.10 vs Lubuntu 14.10 vs Ubuntu GNOME 14.10: A Comparison

So, in nutshell, I found Lubuntu 14.10 to be the best in performance among the Ubuntu distros. It offered me trouble free experience throughout my usage and I found it to be really stable. Anyone looking for a really really efficient distro and those with low powered machines can safely bet on Lubuntu 14.10 Based on my experience, I found Ubuntu GNOME to be the second best offering very decent performance with a very refined desktop environment. I thought Xubuntu would occupy this position but unfortunately, a bit of instability in the distro marred my experience. I would safely recommend Ubuntu GNOME 14.10 to users with modern laptop with or without touchscreen over the rest of the four distros. As usual Kubuntu is the slowest of the lot and consumes the most power. You can expect the least battery life from Kubuntu. However, the desktop environment (specially the Plasma 5 upgrade) is mind blowing! Those with powerful modern machines and less usage of battery power can safely choose Kubuntu as it seemed to be the most exciting of the lot. Read more