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

Programming: OpenJ9, SCons, and Adafruit NeoPixel Stick

  • Some Early Tests Of The Eclipse OpenJ9 Java Virtual Machine
    With IBM's newly open-sourced J9 Java Virtual Machine as the Eclipse OpenJ9, I've run some quick benchmarks to get an idea how its performance is comparing to the de facto Java Virtual Machine, Hotspot.
  • SCons 3.0 Released
    For those that haven't jumped fully on the Meson build system bandwagon, the SCons 3.0 software construction utility is now available.
  • Small Glowing Thing
    Quite a while ago I obtained an Adafruit NeoPixel Stick. It was cheap enough to be an impulse buy but it took me some time to get around to actually doing something with it. I’ve been wanting to play a little more with the ATtiny range of microcontrollers so these things seemed to go together nicely. It turns out that getting an ATtiny programmed is actually rather simple using an Arduino as an ISP programmer. I’ve written up some notes on the procedure at the 57North Hacklab wiki.

Kernel: Next Linux kernel 4.13 RC, the Linux Foundation and Graphics News

  • Linus Torvalds Kicks Off Development of Linux Kernel 4.14, the Next LTS Release
    A day early than expected, Linux creator Linus Torvalds cautiously kicked off the development of the Linux 4.14 kernel series, which looks to be the next LTS (Long Term Support) branch, with the first Release Candidate (RC) milestone. That's right, two weeks after the release of Linux kernel 4.13, which is currently the most stable and advanced kernel series, being adopted by more and more GNU/Linux distributions each day, the first RC development snapshot of Linux kernel 4.14 is ready for public testing, officially closing the merge window. And it looks like some core new functionality will be implemented in this release.
  • Linux Foundation wants to promote sustainable open source development with new initiatives
    During last week’s Open Source Summit North America in Los Angeles, the Linux Foundation announced a series of projects designed to promote sustainability and growth in open source development. We wrote last week about their “Open Source Guides for the Enterprise,” which will see a series of guides by professionals from many different organizations released over the next few months. Following that, the foundation announced the Community Health Analytics for Open Source Software, or CHAOSS, project. With CHAOSS, the Linux Foundation wants to provide a platform for measuring and analyzing open source projects. The foundation also announced that it has granted a CII security badge to 100 projects through a voluntary process for open source projects to prove their security measures stack up professionally.
  • Intel ANV Lands New Vulkan 1.0.61 Extensions, Android Prep Support
  • AMDGPU Increasing Fragment Size For Performance
    Christian König of AMD yesterday sent out an AMDGPU kernel patch for boosting the default fragment size for GCN graphics cards pre-Vega. The patch is quite trivial and is for boosting the default fragment size from 64KB to 2MB, similar to the move made with the latest Vega GPUs. This change is for GFX6/GFX7/GFX8 graphics processors or basically all the GCN cards prior to Vega "GFX9".

Debian: Tails 3.2 RC, Debian Policy, and Mini-DebConf 2017 Conference

  • Tails 3.2 release candidate has been released for testing
    The LiveUSB Linux distribution, Tails (the amnesic incognito live system), has received a new release candidate for the upcoming 3.2 update that’s due out on the 26th of this month. The update comes with some big under-the-hood changes to the system which should improve hardware support and the email experience. If you’ve ever decided to try Tails on newer hardware, you may have had some driver issues; with this release, Tails ships with the Linux 4.12.12 kernel which is one of the latest. With it, users will get a better hardware experience; for example, the NVIDIA Maxwell series of graphics cards are now supported.
  • Debian Policy call for participation -- September 2017
  • Mini-DebConf 2017 Debian Conference to Take Place November 23-26 in Cambridge UK
    Debian developer and leader of the debian-cd project Steve McIntyre announced the official dates and schedule of this year's Mini-DebConf conference for Debian developers and users. The Mini-DebConf 2017 conference will take place for four days, from Thursday, November 23 until Sunday, November 26, and it will be hosted at Arm's office in Cambridge, United Kingdom. Arm is Steve McIntyre's employer and the industry's leading supplier of microprocessors for embedded and IoT devices. "I'm organizing another mini-DebConf in Cambridge this year. Again, my employer Arm is going to host the conference for four days in November," said Steve McIntyre in the mailing list announcement. "I'm also hoping to find sponsors again to cover some other costs for the conference for things like food - please contact me if you can help!"

Oracle: New VirtualBox 5.2 Beta, SPARC M8 Processors Launched

  • VirtualBox 5.2 to Let Users Enable or Disable Audio Input and Output On-the-Fly
    Oracle announced new updates for its popular, cross-platform and open-source virtualization software, the third Beta of the upcoming VirtualBox 5.2 major release and VirtualBox 5.1.28 stable maintenance update. We'll start with the stable update, VirtualBox 5.1.28, as it's more important for our readers using Oracle VM VirtualBox for all of their virtualization needs. The VirtualBox 5.1 maintenance release 28 is here to improve audio support by fixing various issues with both the ALSA and OSS backends, as well as an accidental crash with AC'97.
  • SPARC M8 Processors Launched
    While Oracle recently let go of some of their SPARC team, today marks the launch of the SPARC M8. The initial SPARC M8 line-up includes the T8-1, T8-2, T8-4. M8-8, and SuperCluster M8-8 servers.