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

Elementary OS: Freya 0.3.1 is Here!

After just a few months, we’re excited to announce a major upgrade for elementary OS Freya! This new version 0.3.1 closes about 200 reports and brings new features, tons of fixes, better hardware support, visual polish, and enhanced translations. We’re very proud to share some elementary OS download stats as well! So far, elementary OS has been downloaded an estimated 5 million times. Of those downloads, we’re seeing that almost 70% are coming from Windows and OS X. So, “Welcome and congratulations!” to the over 3 million new users of an open source operating system! Read more

Announcing dex, an Open Source OpenID Connect Identity Provider from CoreOS

Today we are pleased to announce a new CoreOS open source project called dex: a standards-based identity provider and authentication solution. Just about every project requires some sort of authentication and user-management. Applications need a way for users to log-in securely from a variety of platforms such as web, mobile, CLI tools and automated systems. Developers typically use a platform-dependent solution or, just as often, find existing solutions don't quite address their needs and so they resort to writing their own solution from scratch. Read more

Samsung rolls out a round, Tizen-based Gear S2 watch

Samsung debuted its gen 2 smartwatch: a round, 11.5mm thick “Gear S2″ device with a 1.2-inch 360×360 pixel AMOLED display. As expected, it runs Tizen. Samsung’s Tizen Linux-based Gear S2 smartwatch, which was recently teased at the Galaxy Note 5 and Edge S6+ launch, features a round watch-faced, up to three days battery life, and a rotating bezel to augment the touchscreen UI. A slightly thicker 3G model with up to two hours of life supports voice calls, according to a report from The Verge. Read more

GNOME 3.17.91 released!

Hi, the second beta release of the GNOME 3.17 development cycle is finally here! With this release we are officially now in "The String Freeze" [1] (that stacks with all the current freezes): - String Freeze: no string changes may be made without confirmation from the l10n team (gnome-i18n ) and notification to both the release team and the GDP (gnome-doc-list ). Read more