Mercurial > hg > release > icedtea6-1.9
changeset 2258:f1c14c74edd7
Support systems where the sched_getcpu libc call is not present but the syscall is.
2010-09-17 Andrew John Hughes <ahughes@redhat.com>
* Makefile.am:
Add new patch.
* NEWS: Updated.
* patches/numa_on_early_glibc.patch,
Fallback to making a syscall if sched_getcpu
exists but the glibc used is too old to support it.
author | Andrew John Hughes <ahughes@redhat.com> |
---|---|
date | Mon, 04 Oct 2010 23:47:52 +0100 |
parents | 4b6985a218f7 |
children | 821336d74fc7 |
files | ChangeLog Makefile.am NEWS patches/numa_on_early_glibc.patch |
diffstat | 4 files changed, 63 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Wed Sep 29 13:37:46 2010 -0700 +++ b/ChangeLog Mon Oct 04 23:47:52 2010 +0100 @@ -1,5 +1,14 @@ +2010-09-17 Andrew John Hughes <ahughes@redhat.com> + + * Makefile.am: + Add new patch. + * NEWS: Updated. + * patches/numa_on_early_glibc.patch, + Fallback to making a syscall if sched_getcpu + exists but the glibc used is too old to support it. + 2010-09-29 Deepak Bhole <dbhole@redhat.com> - + Fixed PR519 (patch from dnietoc@gmail.com). * plugin/icedteanp/IcedTeaNPPlugin.cc: Have ITNP_NewStream return NPERR_GENERIC_ERROR instead of NPERR_NO_ERROR.
--- a/Makefile.am Wed Sep 29 13:37:46 2010 -0700 +++ b/Makefile.am Mon Oct 04 23:47:52 2010 +0100 @@ -289,7 +289,8 @@ patches/openjdk/6510892-httpserver_test.patch \ patches/icedtea-shark-build.patch \ patches/openjdk/6638712-wildcard_types.patch \ - patches/openjdk/6650759-missing_inference.patch + patches/openjdk/6650759-missing_inference.patch \ + patches/numa_on_early_glibc.patch if !WITH_ALT_HSBUILD
--- a/NEWS Wed Sep 29 13:37:46 2010 -0700 +++ b/NEWS Mon Oct 04 23:47:52 2010 +0100 @@ -13,11 +13,12 @@ * Backports - S6638712: Inference with wildcard types causes selection of inapplicable method - S6650759: Inference of formal type parameter (unused in formal parameters) is not performed +* Fixes + - Fix build failure on S390 + - RH633510: OpenJDK should use NUMA even if glibc doesn't provide it * NetX - - New man page for javaws -* Fixes - - Fix build failure on S390 - * Plugin + - New man page for javaws +* Plugin - PR519: 100% CPU usage when displaying applets in Webkit based browsers New in release 1.9 (2010-09-07):
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/numa_on_early_glibc.patch Mon Oct 04 23:47:52 2010 +0100 @@ -0,0 +1,46 @@ +--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp 2010-09-14 15:30:59.000000000 +0100 ++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp 2010-09-14 17:45:54.000000000 +0100 +@@ -54,6 +54,10 @@ + # include <sys/shm.h> + # include <link.h> + ++#if __x86_64__ ++#include <asm/vsyscall.h> ++#endif ++ + #define MAX_PATH (2 * K) + + // for timer info max values which include all bits +@@ -2414,6 +2418,21 @@ + return end; + } + ++static int sched_getcpu_syscall(void) { ++ unsigned int cpu; ++ int retval = -1; ++ ++#if __x86_64__ ++ typedef long (*vgetcpu_t)(unsigned int *cpu, unsigned int *node, unsigned long *tcache); ++ vgetcpu_t vgetcpu = (vgetcpu_t)VSYSCALL_ADDR(__NR_vgetcpu); ++ retval = vgetcpu(&cpu, NULL, NULL); ++#elif __i386__ ++ retval = syscall(SYS_getcpu, &cpu, NULL, NULL); ++#endif ++ ++ return (retval == -1) ? retval : cpu; ++} ++ + extern "C" void numa_warn(int number, char *where, ...) { } + extern "C" void numa_error(char *where) { } + +@@ -2422,6 +2441,10 @@ + set_sched_getcpu(CAST_TO_FN_PTR(sched_getcpu_func_t, + dlsym(RTLD_DEFAULT, "sched_getcpu"))); + ++ // If it's not, try a direct syscall. ++ if (sched_getcpu() == -1) ++ set_sched_getcpu(CAST_TO_FN_PTR(sched_getcpu_func_t, (void*)&sched_getcpu_syscall)); ++ + if (sched_getcpu() != -1) { // Does it work? + void *handle = dlopen("libnuma.so.1", RTLD_LAZY); + if (handle != NULL) {