https://www.phoronix.com/news/Linux-Caching-Time-Block-IO Phoronix * Articles & Reviews * News Archive * Forums * Premium Ad-Free * Contact * Popular Categories * Close * * Articles & Reviews * News Archive * Forums * Premium * Contact * Categories Computers Display Drivers Graphics Cards Linux Gaming Memory Motherboards Processors Software Storage Operating Systems Peripherals * [ ] [Search] ~5 Minutes Of Coding Yields A 6%+ Boost To Linux I/O Performance Written by Michael Larabel in Linux Storage on 16 January 2024 at 06:50 AM EST. 43 Comments LINUX STORAGE IO_uring creator and Linux block subsystem maintainer Jens Axboe spent about five minutes working on two patches to implement caching for issue-side time querying in the block layer and can yield 6% or more better I/O performance. Axboe shared about his latest interesting Linux I/O performance optimization, "Something I've had in the back of my mind for years, and finally did it today. Which is kind of sad, since it was literally a 5 min job, yielding a more than 6% improvement. Would likely be even larger on a full scale distro style kernel config." Axboe explained he typically disables iostats when testing due to the performance overhead of the time querying by default. But when providing some basic caching for the issue-side time querying, he's seeing around a 6% boost to IOPS and for a more bloated Linux distribution vendor kernel the gains are likely more significant. Intel Optane storage He detailed in the RFC patch series: "Querying the current time is the most costly thing we do in the block layer per IO, and depending on kernel config settings, we may do it many times per IO. None of the callers actually need nsec granularity. Take advantage of that by caching the current time in the plug, with the assumption here being that any time checking will be temporally close enough that the slight loss of precision doesn't matter. If the block plug gets flushed, eg on preempt or schedule out, then we invalidate the cached clock. ... which is more than a 6% improvement in performance. Looking at perf diff, we can see a huge reduction in time overhead: 10.55% -9.88% [kernel.vmlinux] [k] read_tsc 1.31% -1.22% [kernel.vmlinux] [k] ktime_get Note that since this relies on blk_plug for the caching, it's only applicable to the issue side. But this is where most of the time calls happen anyway. It's also worth nothing that the above testing doesn't enable any of the higher cost CPU items on the block layer side, like wbt, cgroups, iocost, etc, which all would add additional time querying. IOW, results would likely look even better in comparison with those enabled, as distros would do." A nice win and hopefully this continues to pan out and prove useful for upstreaming with the Linux v6.9 cycle in a few months, 43 Comments Tweet [INS::INS] Related News GFS2 File-System Enables Non-Blocking Lookups With Linux 6.8 Linux 6.8 Introduces New Syscalls For More Detailed File-System Mount Information Btrfs In Linux 6.8 Transitions Metadata Processing To Using Folios Linux Gains An Open File Server Implementation For Tractors & Agriculture Machinery EROFS Adds Sub-Page Compressed Data Support To Help Out Android & ARM64 Servers F2FS Improves Zoned Block Device Support With Linux 6.8 About The Author Michael Larabel Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com. Popular News This Week A 2024 Discussion Whether To Convert The Linux Kernel From C To Modern C++ Linux 6.8 Network Optimizations Can Boost TCP Performance For Many Concurrent Connections By ~40% Linus Torvalds Hits Nasty Performance Regression With Early Linux 6.8 Code Linux Gains An Open File Server Implementation For Tractors & Agriculture Machinery Linus Torvalds On Linux 6.8 DRM: "Testing Is Seriously Lacking" GNOME 46 Alpha Released With Many Improvements Git Developers Discuss The Possibility Of Beginning To Use Rust Code Linux 6.8 Landing A Tantalizing Optimization For Common $PATH-Based Searches Latest Linux News Wine 9.0 Released With Initial Wayland Driver, WoW64 Taking Shape & Better Direct3D GCC Rust Compiler "gccrs" Sees ~900 New Patches Upstreamed For GCC 14 Ubuntu Linux Working On Installer Support For NVMe-over-TCP Intel Meteor Lake CPUs Will Be Able To Clock Higher On Linux 6.8 New AMD & Intel Laptop/Platform Support In Linux 6.8 ~5 Minutes Of Coding Yields A 6%+ Boost To Linux I/O Performance Rust-Written Linux Scheduler Showing Promising Results For Gaming Performance X.Org Server & XWayland Updated Due To Another Six Security Vulnerabilities AMD Releases AOMP 18.0-1 Compiler Based On ROCm 6.0, Defaults To -O2 Optimizations Linux 6.8 Brings More Sound Hardware Support For Intel & AMD, Including The Steam Deck Ubuntu 24.04 LTS To Ship With Some Extra GNOME Performance Optimizations Show Your Support, Go Premium Phoronix Premium allows ad-free access to the site, multi-page articles on a single page, and other features while supporting this site's continued operations. Latest Featured Articles SilverStone RM51 Is A Nice 5U Chassis For Large Servers & Workstations Intel Announces Core 14th Gen 35/65 Watt Desktop CPUs, 14th Gen HX Mobile CPUs AMD Introduces Ryzen 8000G Series & Even New Ryzen 5000 Series CPUs AMD Announces The Radeon RX 7600 XT For 1080p~1440p Gaming At $329 Intel Core Ultra 7 Meteor Lake vs. AMD Ryzen Z1 Extreme Performance Support Phoronix The mission at Phoronix since 2004 has centered around enriching the Linux hardware experience. In addition to supporting our site through advertisements, you can help by subscribing to Phoronix Premium. You can also contribute to Phoronix through a PayPal tip or tip via Stripe. Phoronix Media --------------------------------------------------------------------- * Contact * Michael Larabel * OpenBenchmarking.org Phoronix Premium --------------------------------------------------------------------- * Support Phoronix * While Having Ad-Free Browsing, * Single-Page Article Viewing Share --------------------------------------------------------------------- * Facebook * Twitter * Legal Disclaimer, Privacy Policy, Cookies | Contact * Copyright (c) 2004 - 2024 by Phoronix Media. * All trademarks used are properties of their respective owners. All rights reserved.