Page MenuHomeFreeBSD

minidump: De-duplicate is_dumpable()
AcceptedPublic

Authored by mhorne on Wed, Sep 8, 6:51 PM.

Details

Reviewers
manu
imp
kib
markj
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 OK
Unit
No Unit Test Coverage
Build Status
Buildable 41630
Build 38519: arc lint + arc unit

Event Timeline

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

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

This revision is now accepted and ready to land.Wed, Sep 8, 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.Thu, Sep 9, 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.Thu, Sep 9, 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.Tue, Sep 21, 6:53 PM
This revision is now accepted and ready to land.Wed, Sep 22, 3:26 PM