Page MenuHomeFreeBSD

for a cache-only zone the destructor tries to destroy a non-existent keg
ClosedPublic

Authored by tychon on Apr 5 2019, 11:55 PM.
Tags
None
Referenced Files
F135786832: D19835.id56130.diff
Wed, Nov 12, 9:05 PM
F135786010: D19835.id56133.diff
Wed, Nov 12, 8:54 PM
F135769223: D19835.id.diff
Wed, Nov 12, 4:50 PM
F135766844: D19835.id56091.diff
Wed, Nov 12, 4:10 PM
F135758408: D19835.diff
Wed, Nov 12, 1:51 PM
F135758063: D19835.id55868.diff
Wed, Nov 12, 1:44 PM
F135757879: D19835.diff
Wed, Nov 12, 1:41 PM
F135756678: D19835.id.diff
Wed, Nov 12, 1:22 PM
Subscribers

Details

Summary

Pure cache zones have no kegs. However since uz_keg and uz_lockptr are shared members of struct uma_zone a pointer to a lock may masquerade as a pointer to a keg. Therefore it’s insufficient to test uz_keg to determine if a zone has a keg.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/vm/uma_core.c
1921 ↗(On Diff #55868)

I believe you can test (uz_flags & UMA_ZFLAG_CACHE) == 0 instead.

tychon edited the summary of this revision. (Show Details)

Use markj@'s suggestion for a more overt/intuitive fix.

markj added inline comments.
sys/vm/uma_core.c
1922 ↗(On Diff #56091)

These tests can be combined into one.

This revision is now accepted and ready to land.Apr 11 2019, 5:16 PM

Might a well make this as good as can be. I combined the tests into one.

This revision now requires review to proceed.Apr 12 2019, 11:01 AM
This revision is now accepted and ready to land.Apr 12 2019, 11:57 AM
This revision was automatically updated to reflect the committed changes.