Page MenuHomeFreeBSD

[PowerPC64] fix uma_small_free panic
ClosedPublic

Authored by alfredo on Mar 2 2020, 9:37 PM.
Referenced Files
F132264538: D23931.diff
Wed, Oct 15, 7:49 AM
Unknown Object (File)
Wed, Oct 8, 7:50 AM
Unknown Object (File)
Mon, Oct 6, 10:43 AM
Unknown Object (File)
Sep 10 2025, 4:29 PM
Unknown Object (File)
Sep 6 2025, 11:13 AM
Unknown Object (File)
Sep 2 2025, 5:51 AM
Unknown Object (File)
Aug 15 2025, 11:00 AM
Unknown Object (File)
Aug 11 2025, 8:36 PM
Subscribers

Details

Summary

This fixes panic like "Freeing UMA block at 0xc00000004b0ce000 with no associated page", reproduced when huge pages is not enabled and system starts using swap.

Solution provided by jhibbits.

Test Plan

Force swap usage running several buildworld threads as well with stress util on powerpc64 QEMU VM.

Diff Detail

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

Event Timeline

Given what I see in uma_small_alloc(), this change really should be unnecessary (uma_small_alloc() returns an identity-mapped page), but relying on that is obviously incorrect. The pmap_kextract() in here is the correct solution.

sys/powerpc/powerpc/uma_machdep.c
102 ↗(On Diff #69089)

I think this should be pmap_kremove() anyway, to match the pmap_kenter() above. Semantically the same, but better symmetry.

alfredo marked an inline comment as done.

replaced pmap_extract by pmap_kextract

System was running under load with latest change for almost 13 hours. Everything seems good.

This revision is now accepted and ready to land.Mar 4 2020, 3:01 PM
This revision was automatically updated to reflect the committed changes.