Re:Linux kernel cgroups writeback high CPU troubleshooting
by Snild on Friday February 14, 2025 @08:44AM
(#43048166)
Or run `sync` after the copy "finishes" -- less focused, but very easy to do.
[ Parent
| on HN ]
Re:Linux kernel cgroups writeback high CPU troubleshooting
by throwway120385 on Friday February 14, 2025 @10:09AM
(#43049086)
sync is not guaranteed to do anything. And sometimes it does way more than it should. Direct I/O semantics are the correct thing here because it bypasses the cache entirely.
I've had a lot of issues writing partition and disk images using DD on modern Linux systems because of caching. And these all kept happening even though I would use `sync` like you describe. But setting oflag=direct resolved all of the issues I was having.