GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — io-wait used 100% cpu after 6.1.39 and 6.5.1 · Issue #943 · axboe/liburing

io-wait used 100% cpu after 6.1.39 and 6.5.1 #943

New issue
Copy link
New issue
Copy link
Closed
Closed
io-wait used 100% cpu after 6.1.39 and 6.5.1#943
Copy link

Description

@beldzhang
beldzhang
opened on Sep 4, 2023
Issue body actions

after this commit:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.39&id=f32dfc802e8733028088edf54499d5669cb0ef69
a running io-uring object will cause one cpu showing 100% usage of io-wait, in my environment 8 rings/threads make 8 cpu got 100% io-wait usage. beside this nothing else found.

try to revert this commit from 6.1.39 then everything is ok.
6.1.51/6.5.1 it is the same, can not direct revert this commit so not tested yet.

all following test got the same performance result:
6.1.38
6.1.39
6.1.39(reverted)
6.1.51

re-produce:
use this testing program: https://github.com/axboe/liburing/files/9571382/issue-643-v2.zip, build and just run server, it will showing io-wait 100% on one cpu.

Reacted by Sebastian Lövdahl, Ryosuke Fukutani, Philip Miglinci and Stanislav

Activity

Next
  1. redbaron commented on Sep 5, 2023

    @redbaron
    redbaron
    on Sep 5, 2023
    More actions

    isn't IO wait time is what you want to see? That is time app is blocked waiting on io (at least it was the case for file IO), but CPU has nothing else to do, so that time is accounted as IO wait.

  2. isilence commented on Sep 5, 2023

    @isilence
    isilence
    on Sep 5, 2023
    Collaborator
    More actions

    Note that io-wait doesn't burn CPU cycles, it's sleeping and so it's not a problem apart from reporting. There was a change doing that, and I think it actually makes more sense reporting a task waiting for io_uring completions as io-wait

  3. axboe commented on Sep 5, 2023

    @axboe
    axboe
    on Sep 5, 2023
    Owner
    More actions

    Yes this is expected. iowait literally just means "waiting on IO", which is what the task is doing. It does NOT mean that it's busy 100% of the time, in fact if you have 100% iowait it means 1 task is sleeping waiting on IO 100% of the time.

  4. beldzhang commented on Sep 5, 2023

    @beldzhang
    beldzhang
    on Sep 5, 2023
    Author
    More actions

    Yes this is expected. iowait literally just means "waiting on IO", which is what the task is doing. It does NOT mean that it's busy 100% of the time, in fact if you have 100% iowait it means 1 task is sleeping waiting on IO 100% of the time.

    noticed that, when this happen, system load is only 0.0x

    we are using io-uring in a storage service, so is very sensitive about the storage/network load, previously io-wait is a good indicator to check this.
    and before kernel 5.0, iostat's %util value can be used also, but after 5.0, this number will easily up to 100% even on a small load. many articles also said this number is not reliable.
    is there any other way to check the disk load?

    and I calculate a performance score after each test based on total cpu usage, just ignore the io-wait part looks like not a good solution...

  5. beldzhang commented on Sep 13, 2023

    @beldzhang
    beldzhang
    on Sep 13, 2023
    Author
    More actions

    looks no more comments, closed.

  6. beldzhang
    closed this as completedon Sep 13, 2023
  7. beldzhang
    closed this as not plannedon Sep 13, 2023
  8. romange commented on Nov 16, 2023

    @romange
    romange
    on Nov 16, 2023
    Contributor
    More actions

    @axboe, one of Dragonfly's users, also reported this as a behavioural change: Dragonfly, which does not use disk IO, bumps up the IOWAIT metric to 100%. If they run it using the epoll API, it does not affect IOWAIT. I am just double checking whether this change is indeed intended.

    Reacted by rickytato and Juri Malinovski
  9. rickytato commented on Nov 25, 2023

    @rickytato
    rickytato
    on Nov 25, 2023
    More actions

    I see same issue with Kernel 6.5.11 (on Proxmox)
    image

  10. beldzhang commented on Dec 5, 2023

    @beldzhang
    beldzhang
    on Dec 5, 2023
    Author
    More actions

    emmm... reopen?

  11. RX14 commented on Feb 22, 2024

    @RX14
    RX14
    on Feb 22, 2024
    More actions

    IOwait has been traditionally thought of as "waiting for disk io", which will always complete. Since io_uring can be used to wait on the network, which has unbounded waiting time, it changes the metric considerably. For example, many monitoring systems have alerts for iowait being high, correctly or not assuming it to be a proxy for disk contention.

    Reacted by Christian Rishøj, Forza, Victor Babenko, Evan Sikorski and SaberStrat
  12. axboe
    reopened this on Feb 22, 2024
  13. axboe commented on Feb 22, 2024

    @axboe
    axboe
    on Feb 22, 2024
    Owner
    More actions

    Here's what I think we should do:

    1. Default to not using iowait, as it is indeed somewhat confusing for networked or mixed network/storage workloads. I do think iowait is an awful metric that makes very little sense for async workloads, even just pure storage based ones. Lots of consumers will assume it's busy time, or has a direct correlation with disk usage, which is just wrong.
    2. Add an IORING_ENTER_IOWAIT flag that can be used in conjunction with IORING_ENTER_GETEVENTS. If set, iowait will be used. Storage can use this, if they so wish.
    3. Add an IORING_FEAT_IOWAIT flag, which tells the app/liburing that this feature is available.
    4. Add liburing helpers, ala io_uring_set_iowait() and io_uring_clear_iowait(), which can be used to toggle this flag, if IORING_FEAT_IOWAIT is set. Storage based workloads can set this.

    And that should be it. That gives the app control over whether iowait should be used or not.

    Reacted by Stephanie Wilde-Hobbs
  14. beldzhang commented on Feb 22, 2024

    @beldzhang
    beldzhang
    on Feb 22, 2024
    Author
    More actions

    will test when avaliable

  15. isilence commented on Feb 24, 2024

    @isilence
    isilence
    on Feb 24, 2024
    Collaborator
    More actions

    @axboe, I just mentioned it in the mailing list, but even though I don't understand why people are taken aback by hi iowait from io_uring waiting, but I think we should just revert that change, there has been too many reports from different people regarding this one. We should be able to do the optimisation that was the reason for the change without reporting iowait.

  16. 28 remaining items

  17. axboe commented on Mar 28, 2025

    @axboe
    axboe
    on Mar 28, 2025
    Owner
    More actions

    For me, CPU always sits at the lowest idle frequency, despite having 100% iowait.

    Sounds like a machine/setup issue. It should avoid the lower power states on the CPU where that task is currently waiting. This isn't related to io_uring at all, io_uring just marks it as being in iowait, just like you'd see if iowait was used elsewhere.

    Eg if you do:

    # taskset -c 0 dd if=/dev/nvmeX of=/dev/null bs=4k iflag=direct
    

    and watch the C state of CPU 0, then it should not be in lower power states.

  18. HanabishiRecca commented on Mar 28, 2025

    @HanabishiRecca
    HanabishiRecca
    on Mar 28, 2025
    More actions

    Sounds like a machine/setup issue.

    As I said above, tested on different machines. And it doesn't sound like an issue for me, exactly the opposite actually.

    This isn't related to io_uring at all

    Yes, I just pointed out that (for me) iowait does not bother the CPU.

    Eg if you do:

    # taskset -c 0 dd if=/dev/nvmeX of=/dev/null bs=4k iflag=direct
    

    and watch the C state of CPU 0, then it should not be in lower power states.

    Well, with this exact example - yes. But simply because with such small block size dd process itself produces a significant CPU load.
    But if I change it to say bs=4M, I have 100% iowait with CPU remaining at the lowest state.

    Reacted by ValeZAA
  19. axboe commented on Mar 28, 2025

    @axboe
    axboe
    on Mar 28, 2025
    Owner
    More actions

    Agree, sounds like it's working as expected then, for longer waits you very much do want to go lower in power. This should be the same then for anything waiting off io_uring_enter(2) with GETEVENTS set, that should also drift down in power states depending on the duration.

    Reacted by Hanabishi
  20. ValeZAA commented on Apr 10, 2025

    @ValeZAA
    ValeZAA
    on Apr 10, 2025
    More actions

    But if I change it to say bs=4M, I have 100% iowait with CPU remaining at the lowest state.

    So there is no bug and this can be closed? What the patches for linux kernel for? It will be still be the same, just hidden?

  21. HanabishiRecca commented on Apr 10, 2025

    @HanabishiRecca
    HanabishiRecca
    on Apr 10, 2025
    More actions

    So there is no bug and this can be closed?

    Well, dd performs actual work here, it reads from the disk at max speed. So iowait metric is actually useful, shows how busy the disk I/O is.

    But io_uring shows 100% iowait when literally nothing is happening. E.g. a server app simply waiting for incoming network requests.

    What the patches for linux kernel for? It will be still be the same, just hidden?

    Yes.

  22. beldzhang commented on Apr 10, 2025

    @beldzhang
    beldzhang
    on Apr 10, 2025
    Author
    More actions

    patch already in kernel 6.15-rc1, 07754bfd9aee59063f8549f6e4d455eae636ecc7
    and liburing master, commit: 8f0c124
    tested yesterday, functionality pass.

    Well, dd performs actual work here, it reads from the disk at max speed. So iowait metric is actually useful, shows how busy the disk I/O is.

    But io_uring shows 100% iowait when literally nothing is happening. E.g. a server app simply waiting for incoming network requests.

    that is what I meet and open this issue for.

    So there is no bug and this can be closed?

    since this reopened by @axboe, so I think it's better to let him decide.

    Reacted by GalaxySnail
  23. HanabishiRecca commented on Apr 10, 2025

    @HanabishiRecca
    HanabishiRecca
    on Apr 10, 2025
    More actions

    patch already in kernel 6.15-rc1, 07754bfd9aee59063f8549f6e4d455eae636ecc7

    No global sysfs knob after all, huh. That's unfortunate.

  24. Athinivas commented on May 21, 2025

    @Athinivas
    Athinivas
    on May 21, 2025
    More actions

    @beldzhang Has the patch been released? anything decided ? Thanks!

  25. axboe commented on May 21, 2025

    @axboe
    axboe
    on May 21, 2025
    Owner
    More actions

    It'll be in the 6.15 kernel that's set to be released this weekend, and liburing has io_uring_set_iowait() for toggling it.

    Reacted by Devoe
  26. axboe commented on May 21, 2025

    @axboe
    axboe
    on May 21, 2025
    Owner
    More actions

    Closing.

  27. axboe
    closed this as completedon May 21, 2025
  28. wineway
    added a commit that references this issue on May 4, 2026

    IoUring: Add opt-in IORING_ENTER_NO_IOWAIT for accurate CPU usage

    a75fb91
  29. chrisvest
    added a commit that references this issue on Jun 9, 2026

    IoUring: Pass IORING_ENTER_NO_IOWAIT to report accurate CPU usage (#1…

    3fb6987
  30. normanmaurer
    added a commit that references this issue on Jun 9, 2026

    IoUring: Pass IORING_ENTER_NO_IOWAIT to report accurate CPU usage (#1…

    a98360a
  31. kevinastone
    added a commit that references this issue on Oct 15, 2026

    fix(dragonfly): use --force_epoll to avoid io_uring SQPOLL iowait

    42e62f1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.