File:  [NetBSD Developer Wiki] / wikisrc / features / uvm_hotplug.mdwn
Revision 1.2: download - view: text, annotated - select for diffs
Thu Dec 29 16:59:58 2016 UTC (6 years, 1 month ago) by cherry
Branches: MAIN
CVS tags: HEAD

    1: # [[!template id=man name=uvm_hotplug section=9]] port-masters' FAQ.
    3:   1. Why does it matter?
    5:      As a port maintainer any architecture that needs to use the virtual memory
    6:      sub-system of NetBSD aka uvm is affected by the
    7:      [[!template id=man name=uvm_hotplug section=9]] change.
    9:      Early boot code of every port is affected. Global variables:
   10:      struct vm_physseg vm_physmem;
   11:      int vm_nphysmem;
   12:      are no longer visible. They need to be replaced by appropriate
   13:      accessor calls in [[!template id=man name=uvm_hotplug section=9]]
   15:      These calls are documented as "Utility Functions" in the
   16:      [[!template id=man name=uvm_hotplug section=9]] manual.
   18:      The "switchover" CVS commit log is here:
   19:      [](
   21:   2. What files may be affected?
   23:      In most of the architectures the "sys/arch/<arch_name>/<arch_name>/machdep.c"
   24:      and "sys/arch/<arch_name>/<arch_name>/pmap.c" if they exist are usually
   25:      affected.
   27:      But this may not be a exhaustive list. Any other files that deals with pmap and
   28:      stealing pages might also be affected.
   30:   3. What does it do ?
   32:      [[!template id=man name=uvm_hotplug section=9]] manages the previously exposed "vm_physmem" static array which
   33:      used to keep track of the memory segments.
   35:      In the current implementation, the array has been replaced with a
   36:      [[!template id=man name=rbtree section=3]] backing which makes the
   37:      data structure dynamic.
   39:      An array based implementation is also provided, for backwards
   40:      compatibility. This is the default implementation and does not provide
   41:      hot pluggability. It is also used without 'options UVM_HOTPLUG'
   42:      However the API itself is implementation agnostic.
   44:   4. Why is it needed?
   46:      With the [[!template id=man name=rbtree section=3]] backing
   47:      implementation, the list of physical pages 
   48:      in the system is no longer in a static array and can dynamically
   49:      expand or collapse, hence adding new pages to the freelist from newly
   50:      available RAM / physical memory (plug) or removing retired pages
   51:      (unplug) via taking them off the freelist and the old vm_physmem.
   53:   5. What should I do?
   55:      Review the changes to your port due to this new feature. The changes
   56:      may have been made without direct knowledge of your port architecture.
   58:      See if your port has hotpluggable hardware. If it does, write a driver
   59:      to use the [[!template id=man name=uvm_hotplug section=9]] api.
   61:      An example of [[!template id=man name=uvm_hotplug section=9]] api's
   62:      application can be found in
   63:      [[!template id=man name=balloon section=4]].

CVSweb for NetBSD wikisrc <> software: FreeBSD-CVSweb