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

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

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb