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

More on Tesla's Compliance

10 Best Open Source Forum Software for Linux

A forum is a discussion platform where related ideas and views on a particular issue can be exchanged. You can setup a forum for your site or blog, where your team, customers, fans, patrons, audience, users, advocates, supporters, or friends can hold public or private discussions, as a whole or in smaller groups. If you are planning to launch a forum, and you can’t build your own software from scratch, you can opt for any of the existing forum applications out there. Some forum applications allow you to setup only a single discussion site on a single installation, while others support multiple-forums for a single installation instance. In this article, we will review 10 best open source forum software for Linux systems. By the end of this article, you will know exactly which open source forum software best suites your needs. Read more

(K)Ubuntu: Playing' Tennis and Dropping 32-bit

  • Tennibot is a really cool Ubuntu Linux-powered tennis ball collecting robot
    Linux isn't just a hobby --  the kernel largely powers the web, for instance. Not only is Linux on many web servers, but it is also found on the most popular consumer operating system in the world -- Android. Why is this? Well, the open source kernel scales very well, making it ideal for many projects. True, Linux's share of the desktop is still minuscule, but sometimes slow and steady wins the race -- watch out, Windows! A good example of Linux's scalability is a new robot powered by Linux which was recently featured on the official Ubuntu Blog. Called "Tennibot," the Ubuntu-powered bot seeks out and collects tennis balls. Not only does it offer convenience, but it can save the buyer a lot of money too -- potentially thousands of dollars per year as this calculator shows. So yeah, a not world-changing product, but still very neat nonetheless. In fact, it highlights that Linux isn't just behind boring nerdy stuff, but fun things too.
  • Kubuntu Drops 32-bit Install Images
    If you were planning to grab a Kubuntu 18.10 32-bit download this October you will want to look away now. Kubuntu has confirmed plans to join the rest of the Ubuntu flavour family and drop 32-bit installer images going forward. This means there will be no 32-bit Kubuntu 18.10 disc image available to download later this year.

Suitcase Computer Reborn with Raspberry Pi Inside

Fun fact, the Osborne 1 debuted with a price tag equivalent to about $5,000 in today’s value. With a gigantic 9″ screen and twin floppy drives (for making mix tapes, right?) the real miracle of the machine was its portability, something unheard of at the time. The retrocomputing trend is to lovingly and carefully restore these old machines to their former glory, regardless of how clunky or underpowered they are by modern standards. But sometimes they can’t be saved yet it’s still possible to gut and rebuild the machine with modern hardware, like with this Raspberry Pi used to revive an Osborne 1. Purists will turn their nose up at this one, and we admit that this one feels a little like “restoring” radios from the 30s by chucking out the original chassis and throwing in a streaming player. But [koff1979] went to a lot of effort to keep the original Osborne look and feel in the final product. We imagine that with the original guts replaced by a Pi and a small LCD display taking the place of the 80 character by 24 line CRT, the machine is less strain on the shoulder when carrying it around. (We hear the original Osborne 1 was portable in the same way that an anvil is technically portable.) The Pi runs an emulator to get the original CP/M experience; it even runs Wordstar. The tricky part about this build was making the original keyboard talk to the Pi, which was accomplished with an Arduino that translates key presses to USB. Read more