src/os/linux/vm/os_linux.cpp

changeset 25
873fd82b133d
parent 1
2d8a650513c2
child 107
68d7c979cca6
equal deleted inserted replaced
24:d2be62fdfa50 25:873fd82b133d
249 #define SYS_gettid 224 249 #define SYS_gettid 224
250 #elif __amd64__ 250 #elif __amd64__
251 #define SYS_gettid 186 251 #define SYS_gettid 186
252 #elif __sparc__ 252 #elif __sparc__
253 #define SYS_gettid 143 253 #define SYS_gettid 143
254 #elif __mips__ 254 #elif __mips__
255 #define SYS_gettid 4222 255 #define SYS_gettid 4222
256 #else 256 #else
257 #error define gettid for the arch 257 #error define gettid for the arch
258 #endif 258 #endif
259 #endif 259 #endif
2839 } 2839 }
2840 } 2840 }
2841 return 0; 2841 return 0;
2842 } 2842 }
2843 2843
2844 int os::numa_get_cpu_id() {
2845 int cpu_id = Linux::sched_getcpu();
2846 if(cpu_id != -1)
2847 return cpu_id;
2848 else {
2849 tty->print_cr("cpu_id got a unacceptable value");
2850 return 0;
2851 }
2852 }
2853
2854 size_t os::numa_get_leaf_groups(int *ids, size_t size) { 2844 size_t os::numa_get_leaf_groups(int *ids, size_t size) {
2855 for (size_t i = 0; i < size; i++) { 2845 for (size_t i = 0; i < size; i++) {
2856 ids[i] = i; 2846 ids[i] = i;
2857 } 2847 }
2858 return size; 2848 return size;
4923 if (!UseNUMA && ForceNUMA) { 4913 if (!UseNUMA && ForceNUMA) {
4924 UseNUMA = true; 4914 UseNUMA = true;
4925 } 4915 }
4926 } 4916 }
4927 4917
4928 /*Liao:2013/11/18 UseOldNUMA: Let OldGen support NUMA*/
4929 if(UseNUMA == true && UseOldNUMA == true) {
4930 UseOldNUMA = true;
4931 } else {
4932 UseOldNUMA = false;
4933 }
4934
4935 if(UseOldNUMA == false) {
4936 UseNUMAGC = false;
4937 UseNUMAThreadRoots = false;
4938 UseNUMASteal = false;
4939 BindGCTaskThreadsToCPUs = false;
4940 }
4941
4942 if (MaxFDLimit) { 4918 if (MaxFDLimit) {
4943 // set the number of file descriptors to max. print out error 4919 // set the number of file descriptors to max. print out error
4944 // if getrlimit/setrlimit fails but continue regardless. 4920 // if getrlimit/setrlimit fails but continue regardless.
4945 struct rlimit nbr_files; 4921 struct rlimit nbr_files;
4946 int status = getrlimit(RLIMIT_NOFILE, &nbr_files); 4922 int status = getrlimit(RLIMIT_NOFILE, &nbr_files);
5026 // Not yet implemented. 5002 // Not yet implemented.
5027 return false; 5003 return false;
5028 } 5004 }
5029 5005
5030 bool os::bind_to_processor(uint processor_id) { 5006 bool os::bind_to_processor(uint processor_id) {
5031 /* 2014/7/7 implemented by Liao */ 5007 // Not yet implemented.
5032 if(BindGCTaskThreadsToCPUs) { 5008 return false;
5033 cpu_set_t mask;
5034 cpu_set_t get;
5035 CPU_ZERO(&mask);
5036 CPU_SET(processor_id, &mask);
5037
5038 if(sched_setaffinity(0, sizeof(mask), &mask) == -1) {
5039 tty->print_cr("Can't bind to processor_id = %d!", processor_id);
5040 return false;
5041 }
5042 else {
5043 return true;
5044 }
5045 }
5046 else {
5047 return false;
5048 }
5049 } 5009 }
5050 5010
5051 /// 5011 ///
5052 5012
5053 void os::SuspendedThreadTask::internal_do_task() { 5013 void os::SuspendedThreadTask::internal_do_task() {

mercurial