Annotation of wikisrc/features/uvm_hotplug.mdwn, revision 1.2

1.1       cherry      1: # [[!template id=man name=uvm_hotplug section=9]] port-masters' FAQ.
                      2: 
1.2     ! cherry      3:   1. Why does it matter?
1.1       cherry      4: 
1.2     ! cherry      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.
1.1       cherry      8: 
1.2     ! cherry      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]]
1.1       cherry     14: 
1.2     ! cherry     15:      These calls are documented as "Utility Functions" in the
        !            16:      [[!template id=man name=uvm_hotplug section=9]] manual.
1.1       cherry     17: 
1.2     ! cherry     18:      The "switchover" CVS commit log is here:
        !            19:      [http://mail-index.netbsd.org/source-changes/2016/12/23/msg080110.html](http://mail-index.netbsd.org/source-changes/2016/12/23/msg080110.html)
1.1       cherry     20: 
1.2     ! cherry     21:   2. What files may be affected?
1.1       cherry     22: 
1.2     ! cherry     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.
1.1       cherry     26: 
1.2     ! cherry     27:      But this may not be a exhaustive list. Any other files that deals with pmap and
        !            28:      stealing pages might also be affected.
1.1       cherry     29: 
1.2     ! cherry     30:   3. What does it do ?
1.1       cherry     31: 
1.2     ! cherry     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.
1.1       cherry     34: 
1.2     ! cherry     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.
1.1       cherry     38: 
1.2     ! cherry     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.
1.1       cherry     43: 
1.2     ! cherry     44:   4. Why is it needed?
1.1       cherry     45: 
1.2     ! cherry     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.
1.1       cherry     52: 
1.2     ! cherry     53:   5. What should I do?
1.1       cherry     54: 
1.2     ! cherry     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.
1.1       cherry     57: 
1.2     ! cherry     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.
1.1       cherry     60: 
1.2     ! cherry     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 <wikimaster@NetBSD.org> software: FreeBSD-CVSweb