zfs/module
Rob Norris 5b98ced63c zil: refactor zil_commit_waiter()
The previous change added a check to fall back to waiting forever if the
ZIL failed. This check was inverted; it actually caused it to always
enter a timed wait when it failed. When combined with the fact that the
last lwb issued likely would have failed quickly and so had a very small
latency, this caused effectively an infinite loop.

I initially fixed the check, but on further study I decided that this
loop doesn't need to exist. The way the whole logic falls out of the
original code in 2.1.5 is that if the lwb is OPENED, wait then issue it,
and if not (or post issue), wait forever. The loop will never see more
than two iterations, one for each half of the OPENED check, and it will
stop as soon as the waiter is signaled (zcw_done true), so it can be far
more simply expressed as a linear sequence:

    if (!issued) {
        wait a few
        if (done)
            return
        issue IO
    }
    if (!done)
          wait forever

This still holds when the ZIL fails, because zil_commit_waiter_timeout()
will check for failure under zl_issuer_lock, which zil_fail() will wait
for, and in turn, zil_fail() will wait on zcw_lock and then signal the
waiter before it releases zl_issuer_lock. Taken together, that means
that zil_commit_waiter_timeout() will do all it can under the
circumstances, and waiting forever the waiter to complete is all we can
past that point.

(cherry picked from commit c57c2ddd6f803f429da1e2b53abab277d781a5a3)
2023-08-10 19:10:59 +00:00
..
avl Fix various typos 2021-04-07 13:27:11 -07:00
icp Fix functions without a prototype 2022-05-20 10:33:24 -07:00
lua Silence -Winfinite-recursion warning in luaD_throw() 2023-07-31 15:05:56 +00:00
nvpair Update `checkstyle` workflow env to ubuntu-20.04 2021-12-08 13:27:56 -08:00
os Revert debug code from bio-seg-limit 2023-08-10 19:10:59 +00:00
spl Cleanup linux module kbuild files 2020-06-10 09:24:15 -07:00
unicode Update `checkstyle` workflow env to ubuntu-20.04 2021-12-08 13:27:56 -08:00
zcommon compress: add "slack" compression options 2023-07-05 13:27:31 +00:00
zfs zil: refactor zil_commit_waiter() 2023-08-10 19:10:59 +00:00
zstd module: zstd: check we don't leak symbols; regenerate symbol map 2022-05-16 15:48:21 -07:00
.gitignore Cleanup linux module kbuild files 2020-06-10 09:24:15 -07:00
Kbuild.in Add a JSON equivalent to zpool-status(8) 2023-07-05 13:27:30 +00:00
Makefile.bsd compress: add "slack" compression options 2023-07-05 13:27:31 +00:00
Makefile.in Add support for $KERNEL_{CC,LD,LLVM} variables 2022-02-16 17:58:55 -08:00