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

Introducing Gthree

I’ve recently been working on OpenGL support in Gtk+, and last week it landed in master. However, the demos we have are pretty lame and are not very good to show off or even test the OpenGL support. I’ve looked around for some open source demos that used modern GL that we could use, but I didn’t find anything that we could easily use. What I did find though, was a lot of WebGL demos that used three.js. This looked like a very nice open source library for highlevel 3d rendering. At first I had some plans to bind OpenGL to gjs so that we could run three.js, but this turned out to be a hard. Instead I started converting three.js into C + GObject, using the Gtk+ OpenGL support and the vector/matrix library graphene that Emmanuele has been working on recently. Read more

Swiss crowdfund pays for signed PDFs LibreOffice

In just three days, the Swiss open source community Wilhelm Tux reached its crowdfunding target of 10,000 CHF (about 8000 euro) to add support for digital signatures in PDF documents. The feature will be added to LibreOffice, a free and open source suite of office productivity tools. The project is awarded to Collabora, an open source IT service provider, which will deliver the new functionality in April. Read more

Tumbleweed, Factory rolling releases to merge

“With the release of openSUSE 13.2 due in November, we realised this was a perfect opportunity to merge our two openSUSE rolling-releases together so users of Tumbleweed can benefit from the developments to our Factory development process over the last few years,” said Richard Brown, Chairman of openSUSE board. “The combined feedback and contributions from our combined Tumbleweed and Factory users should help keep openSUSE rolling forward even faster, while offering our users the latest and greatest applications on a stable rolling release.” Read more

Fedora 21 Beta to slip

Today at Go/No-Go meeting it was decided to slip Fedora 21 Beta release as we did not have release candidate (RC) available in time. However we will try one day slip. Read more