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

Canonical Needs Your Help to Figure Out a Direction for Ubuntu's Mir/Wayland

That's right, Canonical still has a team of developers working on the Mir display server, despite the Unity 8 development being dropped, and it looks like it's going into a different direction this time. The latest work by done Mir's devs involves basic Wayland support implementation, including mouse and keyboard inputs. Their Wayland Conformance Suite (wlcs) implementation also allow client to connect to the server, as well as to create windows and draw into them, but there's a lot of work to be done before they achieve full Wayland support for Mir, which involves adding essential functions like copy and paste or drag and drop. Read more Also: Canonical Developers To The Community: Help Us Figure Out The Direction Of Mir

openSUSE Tumbleweed Operating System Now Powered by Linux Kernel 4.14 LTS

Linux kernel 4.14 LTS is the latest and greatest kernel for GNU/Linux distributions, and now that it's ready for mass deployments, it will arrive in the software repositories of more distros, and Tumbleweed users are among the first to get it as OpenSuSE Project's Douglas DeMaio reports today. "The past week brought new features to openSUSE Tumbleweed with a snapshot that included Linux kernel 4.14," said DeMaio. "New features like HDMI Consumer Electronics Control support for Raspberry Pi and the merging of Heterogeneous Memory Management to the mainline this long-term support kernel are promising." Read more

Security: UEFI, Updates, Uber

Recommended Privacy Tools (Apps, Add-Ons, Search Engines) for Ubuntu Users

This is an user-friendly list of tools to protect user's internet privacy for Ubuntu users. The tools including search engine (StartPagec.com), add-ons (HTTPS Everywhere, Disconnect), and programs (DNSCrypt Proxy, OpenVPN) that are easy for beginners to install on Ubuntu. This list introduces the importance of privacy for all of you (yes, please read PrivacyTools.io) and that protecting your privacy is not difficult. This list is kept short so you can learn one by one and exercise them on many computers you have. I wish this helps you a lot! Read more