migration(3)                                                      migration(3)


NAME
     migr_range_migrate, migr_policy_args_init - user migration operations

SYNOPSIS
     #include <sys/types.h>
     #include <sys/pmo.h>

     typedef struct migr_policy_uparms {
             __uint64_t  migr_base_enabled         :1,
                         migr_base_threshold       :8,
                         migr_freeze_enabled       :1,
                         migr_freeze_threshold     :8,
                         migr_melt_enabled         :1,
                         migr_melt_threshold       :8,
                         migr_enqonfail_enabled    :1,
                         migr_dampening_enabled    :1,
                         migr_dampening_factor     :8,
                         migr_refcnt_enabled       :1,
                         migr_resv_bits            :4;
     } migr_policy_uparms_t;


     int migr_range_migrate(void* base_addr, size_t length,
                            pmo_handle_t pmo_handle)


     void migr_policy_args_init(migr_policy_uparms_t* p)

DESCRIPTION
     migr_range_migrate migrates a range of memory to the node where the
     pmo_handle has been placed. The pmo_handle can be a placed MLD or an
     MLDSET with at least one placed MLD contained within it.

     migr_policy_args_init fills a migration parameter structure with default
     values. This function is applicable to Origin 2000/200 systems, and has
     no effect on other Origin systems.

     migr_range_migrate attempts to move all pages that have been faulted in
     within the range of base_addr plus length.  If base_addr is not on a page
     boundary, the actual start address of the migration is rounded down to
     the previous page boundary. If base_addr+length is not on a page
     boundary, the actual migration length is adjusted by rounding up to end
     on the next page boundary.  If a page cannot be migrated, it is skipped
     and the next page is attempted. If the destination node does not have
     enough available free memory to migrate the new pages into, the migration
     operation is ended and error is returned (see below).  It is usually not
     possible to migrate every single page of user memory for a variety of
     reasons. A page that is set up for DMA I/O is an example of an un-
     migratable page. A page set up for fetchops, a pinned page, a page not
     faulted in, and a page that is shared with unrelated processes will not
     migrate. In some cases of a physical page shared with several virtual
     addresses, it may be migratable if the migrating process can obtain all


     the necessary locks. In situations where pages are skipped over, these
     skipped pages remain on their current node location for the duration of
     their existence.

     migr_range_migrate will fail and some or all of the specified memory may
     not be successfully migrated if one or more of the following are true:

     EFAULT         Arguments could not be copied into kernel space.

     EINVAL         The specified pmo_handle is invalid or does not exist.

     EINVAL         The specified pmo_handle is not placed on a valid node.

     EINVAL         Memory to migrate is not a user segment address.

     ENOMEM         The user address is not mapped.

     EBUSY          One or more of the user pages is already in the process of
                    migrating.

     EBUSY          The anonymous page being migrated is no longer owned by
                    the caller.

     EBUSY          One of the pages to migrate has raw I/O in progress.

     EBUSY          One of the pages to migrate is on its way back from
                    backing store.

     EBUSY          One of the pages is marked BAD and cannot be moved.

     EBUSY          One of the pages has its RMAP lock set and cannot be
                    moved.

     EBUSY          One of the pages could not achieve a lock on all shared
                    page table entries.

     EBUSY          One of the pages has no page table entry.

     EBUSY          One of the pages has a mismatch of shared use and reverse
                    map entries.

     EBUSY          One of the pages has a lock set from another shared
                    virtual address.

     EBUSY          One of the vnode pages has changed while migrating.

     ENOMEM         There is not enough free memory to migrate the specified
                    memory.

     ENOTSUP        Memory locality domains are not supported on this system
                    architecture.


SEE ALSO
     numa(5), mmci(5), mld(3c), mldset(3c), pm(3c).

DIAGNOSTICS
     Upon successful completion, migr_range_migrate returns 0.  Otherwise, a
     value of -1 is returned and errno is set to indicate the error.


                                                                        Page 3