Print this page
5461 #pragma align before the declaration


 679 
 680 /*
 681  * cpu private vm data - accessed thru CPU->cpu_vm_data
 682  *      vc_pnum_memseg: tracks last memseg visited in page_numtopp_nolock()
 683  *      vc_pnext_memseg: tracks last memseg visited in page_nextn()
 684  *      vc_kmptr: unaligned kmem pointer for this vm_cpu_data_t
 685  *      vc_kmsize: orignal kmem size for this vm_cpu_data_t
 686  */
 687 
 688 typedef struct {
 689         struct memseg   *vc_pnum_memseg;
 690         struct memseg   *vc_pnext_memseg;
 691         void            *vc_kmptr;
 692         size_t          vc_kmsize;
 693 } vm_cpu_data_t;
 694 
 695 /* allocation size to ensure vm_cpu_data_t resides in its own cache line */
 696 #define VM_CPU_DATA_PADSIZE                                             \
 697         (P2ROUNDUP(sizeof (vm_cpu_data_t), L2CACHE_ALIGN_MAX))
 698 
 699 /* for boot cpu before kmem is initialized */
 700 extern char     vm_cpu_data0[];
 701 
 702 /*
 703  * Function to get an ecache color bin: F(as, cnt, vcolor).
 704  * the goal of this function is to:
 705  * - to spread a processes' physical pages across the entire ecache to
 706  *      maximize its use.
 707  * - to minimize vac flushes caused when we reuse a physical page on a
 708  *      different vac color than it was previously used.
 709  * - to prevent all processes to use the same exact colors and trash each
 710  *      other.
 711  *
 712  * cnt is a bin ptr kept on a per as basis.  As we page_create we increment
 713  * the ptr so we spread out the physical pages to cover the entire ecache.
 714  * The virtual color is made a subset of the physical color in order to
 715  * in minimize virtual cache flushing.
 716  * We add in the as to spread out different as.  This happens when we
 717  * initialize the start count value.
 718  * sizeof(struct as) is 60 so we shift by 3 to get into the bit range
 719  * that will tend to change.  For example, on spitfire based machines
 720  * (vcshft == 1) contigous as are spread bu ~6 bins.
 721  * vcshft provides for proper virtual color alignment.




 679 
 680 /*
 681  * cpu private vm data - accessed thru CPU->cpu_vm_data
 682  *      vc_pnum_memseg: tracks last memseg visited in page_numtopp_nolock()
 683  *      vc_pnext_memseg: tracks last memseg visited in page_nextn()
 684  *      vc_kmptr: unaligned kmem pointer for this vm_cpu_data_t
 685  *      vc_kmsize: orignal kmem size for this vm_cpu_data_t
 686  */
 687 
 688 typedef struct {
 689         struct memseg   *vc_pnum_memseg;
 690         struct memseg   *vc_pnext_memseg;
 691         void            *vc_kmptr;
 692         size_t          vc_kmsize;
 693 } vm_cpu_data_t;
 694 
 695 /* allocation size to ensure vm_cpu_data_t resides in its own cache line */
 696 #define VM_CPU_DATA_PADSIZE                                             \
 697         (P2ROUNDUP(sizeof (vm_cpu_data_t), L2CACHE_ALIGN_MAX))
 698 



 699 /*
 700  * Function to get an ecache color bin: F(as, cnt, vcolor).
 701  * the goal of this function is to:
 702  * - to spread a processes' physical pages across the entire ecache to
 703  *      maximize its use.
 704  * - to minimize vac flushes caused when we reuse a physical page on a
 705  *      different vac color than it was previously used.
 706  * - to prevent all processes to use the same exact colors and trash each
 707  *      other.
 708  *
 709  * cnt is a bin ptr kept on a per as basis.  As we page_create we increment
 710  * the ptr so we spread out the physical pages to cover the entire ecache.
 711  * The virtual color is made a subset of the physical color in order to
 712  * in minimize virtual cache flushing.
 713  * We add in the as to spread out different as.  This happens when we
 714  * initialize the start count value.
 715  * sizeof(struct as) is 60 so we shift by 3 to get into the bit range
 716  * that will tend to change.  For example, on spitfire based machines
 717  * (vcshft == 1) contigous as are spread bu ~6 bins.
 718  * vcshft provides for proper virtual color alignment.