Page MenuHomeFreeBSD

minidump: De-duplicate is_dumpable()
ClosedPublic

Authored by mhorne on Sep 8 2021, 6:51 PM.
Tags
None
Referenced Files
F102950087: D31884.diff
Tue, Nov 19, 2:50 AM
F102863058: D31884.diff
Mon, Nov 18, 3:39 AM
F102861601: D31884.id.diff
Mon, Nov 18, 3:14 AM
Unknown Object (File)
Mon, Nov 18, 12:03 AM
Unknown Object (File)
Sun, Nov 17, 9:16 PM
Unknown Object (File)
Sun, Nov 17, 7:58 PM
Unknown Object (File)
Sun, Nov 17, 6:20 PM
Unknown Object (File)
Sun, Nov 17, 11:38 AM

Details

Summary

The function is identical in each minidump implementation, and it is
small, so move it to the vm_dumpset.h header. The only slight exception
is powerpc where the function is public, for use in moea64_scan_pmap().

Test Plan

Will tinderbox.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 41434
Build 38323: arc lint + arc unit

Event Timeline

mhorne requested review of this revision.Sep 8 2021, 6:51 PM

Looks identical modulo int->bool changes, which don't matter.

This revision is now accepted and ready to land.Sep 8 2021, 6:55 PM
mhorne added reviewers: kib, markj.

This is a good cleanup. I don't really like the header pollution. We are already assuming that consumers have included vm_page.h (to check m->flags & PG_NODUMP), so why not vm_phys.h as well? Alternately we could have the implementation live in vm_phys.c and call it vm_phys_is_dumpable() or so.

This is a good cleanup. I don't really like the header pollution. We are already assuming that consumers have included vm_page.h (to check m->flags & PG_NODUMP), so why not vm_phys.h as well? Alternately we could have the implementation live in vm_phys.c and call it vm_phys_is_dumpable() or so.

Sure, I will drop the include from this header. I considered vm_phys.c as well, but currently nothing in that file touches dump_avail, so this seems the more natural place.

Drop include of vm_phys.h from vm_dumpset.h. Include it where it is needed instead.

This revision now requires review to proceed.Sep 9 2021, 2:51 PM

I am fine with this as is, but I think my minor preference is to have the function moved to vm_phys.c.

This revision is now accepted and ready to land.Sep 9 2021, 3:52 PM

I suspect vm_dumpset.h should be wrapped in #ifdef _KERNEL as well, just in case some other header starts including it.

Move function to vm_phys.c, rename it to vm_phys_is_dumpable().

This revision now requires review to proceed.Sep 21 2021, 6:53 PM
This revision is now accepted and ready to land.Sep 22 2021, 3:26 PM
This revision was automatically updated to reflect the committed changes.