Page MenuHomeFreeBSD

Refactor uma_zfree_arg()
ClosedPublic

Authored by jeff on Nov 21 2019, 10:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jul 1, 6:55 AM
Unknown Object (File)
Mon, Jun 30, 10:04 AM
Unknown Object (File)
Sat, Jun 28, 12:05 PM
Unknown Object (File)
Mon, Jun 23, 7:42 PM
Unknown Object (File)
Wed, Jun 4, 11:20 PM
Unknown Object (File)
May 28 2025, 7:14 PM
Unknown Object (File)
May 28 2025, 7:45 AM
Unknown Object (File)
May 7 2025, 3:51 AM
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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 27787
Build 25973: arc lint + arc unit

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
3274

Missing space after while.

3380

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

Missing parens.

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