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)
Tue, Jan 14, 9:22 AM
Unknown Object (File)
Sun, Jan 5, 9:12 AM
Unknown Object (File)
Dec 10 2024, 2:32 AM
Unknown Object (File)
Nov 23 2024, 1:51 PM
Unknown Object (File)
Nov 22 2024, 10:45 AM
Unknown Object (File)
Nov 19 2024, 5:44 AM
Unknown Object (File)
Nov 19 2024, 5:31 AM
Unknown Object (File)
Nov 19 2024, 2:50 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
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.