Page MenuHomeFreeBSD

Refactor uma_zfree_arg()
ClosedPublic

Authored by jeff on Nov 21 2019, 10:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 16 2024, 9:25 PM
Unknown Object (File)
Dec 20 2023, 1:17 AM
Unknown Object (File)
Nov 28 2023, 9:01 PM
Unknown Object (File)
Nov 28 2023, 5:13 PM
Unknown Object (File)
Nov 27 2023, 7:09 AM
Unknown Object (File)
Nov 26 2023, 7:24 AM
Unknown Object (File)
Nov 26 2023, 6:21 AM
Unknown Object (File)
Nov 22 2023, 2:09 PM
Subscribers

Details

Summary

This is a more significant refactoring than uma_zalloc_arg() because it was in worse shape. We only need the zone lock if we're going to cache a bucket. The crossdomain logic really needed to be simplified and merged with the other case. Fundamentally we're just freeing a bucket and allocating a bucket, no matter which bucket that is.

Diff Detail

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

Event Timeline

jeff added reviewers: markj, glebius, kib, cem.

The bucket_push and item_dtor refactors look reasonable. I'm not super familiar with this area of code.

sys/vm/uma_core.c
3214 ↗(On Diff #64701)

Missing space after while.

3311 ↗(On Diff #64701)

Isn't the use of lockfail redundant? We can write:

if (!ZONE_TRYLOCK(zone)) {
    ZONE_LOCK(zone);
    if (zone->uz_count < zone->uz_count_max)
        ....
}
jeff edited the summary of this revision. (Show Details)

Review feedback. Pull another function out, zone_free_bucket().

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

Missing parens.

This revision is now accepted and ready to land.Nov 27 2019, 5:01 PM