Page MenuHomeFreeBSD

Retry OCF ENOMEM errors in ZFS
AcceptedPublic

Authored by mav on May 18 2021, 7:39 PM.
Tags
Referenced Files
Unknown Object (File)
Sat, Mar 9, 7:25 AM
Unknown Object (File)
Jan 29 2024, 7:14 PM
Unknown Object (File)
Dec 22 2023, 11:33 PM
Unknown Object (File)
Dec 20 2023, 12:34 AM
Unknown Object (File)
Dec 9 2023, 10:48 PM
Unknown Object (File)
Sep 2 2023, 3:45 AM
Unknown Object (File)
Sep 2 2023, 3:45 AM
Unknown Object (File)
Sep 2 2023, 3:41 AM
Subscribers

Details

Reviewers
jhb
asomers
markj
Summary

ZFS does not expect transient errors from crypto. For read they are counted as checksum errors, while for write end up in panic. To not panic on random low memory conditions retry ENOMEM errors in OCF wrapper function.

While there remove unneeded timeout and priority parameters from msleep().

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

mav requested review of this revision.May 18 2021, 7:39 PM
markj added inline comments.
sys/contrib/openzfs/module/os/freebsd/zfs/crypto_os.c
177

BTW, the locking here and freebsd_zfs_crypt_done() is unnecessary for synchronous drivers like aesni. Same for the wakeup() call. You can check CRYPTO_SESS_SYNC(session->fs_sid) to determine if this is the case, if profiles suggest it is worth doing.

181

Presumably it should be else if.

193

This does not apply to the ENOMEM case, but I think it's harmless.

This revision is now accepted and ready to land.May 18 2021, 7:53 PM
sys/contrib/openzfs/module/os/freebsd/zfs/crypto_os.c
180

You should probably continue after the pause, don't you think?

sys/contrib/openzfs/module/os/freebsd/zfs/crypto_os.c
177

I haven't profiled this code very much, but I have suspect it won't be visible, comparing to cryptography.

180

No, I meant "else" there.

181

Yes. Thanks.

This revision now requires review to proceed.May 18 2021, 8:18 PM
This revision is now accepted and ready to land.May 18 2021, 8:28 PM