< prev index next >

src/hotspot/os/solaris/os_solaris.cpp

Print this page
rev 56448 : imported patch 8220310.mut.0
rev 56449 : imported patch 8220310.mut.1
rev 56451 : imported patch 8220310.mut.3


2409   }
2410   return false;
2411 }
2412 
2413 // Get the group id of the current LWP.
2414 int os::numa_get_group_id() {
2415   int lgrp_id = Solaris::lgrp_home(P_LWPID, P_MYID);
2416   if (lgrp_id == -1) {
2417     return 0;
2418   }
2419   const int size = os::numa_get_groups_num();
2420   int *ids = (int*)alloca(size * sizeof(int));
2421 
2422   // Get the ids of all lgroups with memory; r is the count.
2423   int r = Solaris::lgrp_resources(Solaris::lgrp_cookie(), lgrp_id,
2424                                   (Solaris::lgrp_id_t*)ids, size, LGRP_RSRC_MEM);
2425   if (r <= 0) {
2426     return 0;
2427   }
2428   return ids[os::random() % r];




2429 }
2430 
2431 // Request information about the page.
2432 bool os::get_page_info(char *start, page_info* info) {
2433   const uint_t info_types[] = { MEMINFO_VLGRP, MEMINFO_VPAGESIZE };
2434   uint64_t addr = (uintptr_t)start;
2435   uint64_t outdata[2];
2436   uint_t validity = 0;
2437 
2438   if (meminfo(&addr, 1, info_types, 2, outdata, &validity) < 0) {
2439     return false;
2440   }
2441 
2442   info->size = 0;
2443   info->lgrp_id = -1;
2444 
2445   if ((validity & 1) != 0) {
2446     if ((validity & 2) != 0) {
2447       info->lgrp_id = outdata[0];
2448     }




2409   }
2410   return false;
2411 }
2412 
2413 // Get the group id of the current LWP.
2414 int os::numa_get_group_id() {
2415   int lgrp_id = Solaris::lgrp_home(P_LWPID, P_MYID);
2416   if (lgrp_id == -1) {
2417     return 0;
2418   }
2419   const int size = os::numa_get_groups_num();
2420   int *ids = (int*)alloca(size * sizeof(int));
2421 
2422   // Get the ids of all lgroups with memory; r is the count.
2423   int r = Solaris::lgrp_resources(Solaris::lgrp_cookie(), lgrp_id,
2424                                   (Solaris::lgrp_id_t*)ids, size, LGRP_RSRC_MEM);
2425   if (r <= 0) {
2426     return 0;
2427   }
2428   return ids[os::random() % r];
2429 }
2430 
2431 int os::numa_get_address_id(void* address) {
2432   return 0;
2433 }
2434 
2435 // Request information about the page.
2436 bool os::get_page_info(char *start, page_info* info) {
2437   const uint_t info_types[] = { MEMINFO_VLGRP, MEMINFO_VPAGESIZE };
2438   uint64_t addr = (uintptr_t)start;
2439   uint64_t outdata[2];
2440   uint_t validity = 0;
2441 
2442   if (meminfo(&addr, 1, info_types, 2, outdata, &validity) < 0) {
2443     return false;
2444   }
2445 
2446   info->size = 0;
2447   info->lgrp_id = -1;
2448 
2449   if ((validity & 1) != 0) {
2450     if ((validity & 2) != 0) {
2451       info->lgrp_id = outdata[0];
2452     }


< prev index next >