Page MenuHomeFreeBSD

minidump: De-duplicate is_dumpable()
ClosedPublic

Authored by mhorne on Sep 8 2021, 6:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 14, 6:08 PM
Unknown Object (File)
Feb 22 2024, 5:56 PM
Unknown Object (File)
Dec 23 2023, 12:14 AM
Unknown Object (File)
Dec 14 2023, 8:37 PM
Unknown Object (File)
Nov 2 2023, 12:58 PM
Unknown Object (File)
Sep 18 2023, 9:01 AM
Unknown Object (File)
Sep 12 2023, 11:45 PM
Unknown Object (File)
Sep 9 2023, 12:01 PM

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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.