]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Linux: Remove remnants of the getcpu cache
authorFlorian Weimer <fweimer@redhat.com>
Fri, 15 May 2020 09:32:30 +0000 (11:32 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Sat, 16 May 2020 13:47:51 +0000 (15:47 +0200)
The getcpu cache was removed from the kernel in Linux 2.6.24.  glibc
support from the sched_getcpu implementation was removed in commit
dd26c44403582fdf10d663170f947dfe4b3207a0 ("Consolidate sched_getcpu").

sysdeps/unix/sysv/linux/pthread_setaffinity.c
sysdeps/unix/sysv/linux/sched_setaffinity.c
sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c [deleted file]
sysdeps/unix/sysv/linux/x86_64/sched_setaffinity.c [deleted file]
sysdeps/x86_64/nptl/tcb-offsets.sym
sysdeps/x86_64/nptl/tls.h

index 264d677c298e0f1320c531c817760a02488868dc..b0bd90c3248e5440f4da2e9731321d1abea9c12c 100644 (file)
@@ -33,11 +33,6 @@ __pthread_setaffinity_new (pthread_t th, size_t cpusetsize,
   res = INTERNAL_SYSCALL_CALL (sched_setaffinity, pd->tid, cpusetsize,
                               cpuset);
 
-#ifdef RESET_VGETCPU_CACHE
-  if (!INTERNAL_SYSCALL_ERROR_P (res))
-    RESET_VGETCPU_CACHE ();
-#endif
-
   return (INTERNAL_SYSCALL_ERROR_P (res)
          ? INTERNAL_SYSCALL_ERRNO (res)
          : 0);
index fc2c69278382531247e74172ba4fd8096fa3aadd..978291fc3e50ef2458381f47558c93c791e50e17 100644 (file)
@@ -32,11 +32,6 @@ __sched_setaffinity_new (pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)
 {
   int result = INLINE_SYSCALL (sched_setaffinity, 3, pid, cpusetsize, cpuset);
 
-#ifdef RESET_VGETCPU_CACHE
-  if (result != -1)
-    RESET_VGETCPU_CACHE ();
-#endif
-
   return result;
 }
 libc_hidden_def (__sched_setaffinity_new)
diff --git a/sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c b/sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c
deleted file mode 100644 (file)
index a7bbe38..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <tls.h>
-
-#define RESET_VGETCPU_CACHE() \
-  do {                       \
-    asm volatile ("movl %0, %%fs:%P1\n\t"                                    \
-                 "movl %0, %%fs:%P2"                                         \
-                 :                                                           \
-                 : "ir" (0), "i" (offsetof (struct pthread,                  \
-                                            header.vgetcpu_cache[0])),       \
-                   "i" (offsetof (struct pthread,                            \
-                                  header.vgetcpu_cache[1])));          \
-  } while (0)
-
-#include <sysdeps/unix/sysv/linux/pthread_setaffinity.c>
diff --git a/sysdeps/unix/sysv/linux/x86_64/sched_setaffinity.c b/sysdeps/unix/sysv/linux/x86_64/sched_setaffinity.c
deleted file mode 100644 (file)
index d1101c5..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <tls.h>
-
-#define RESET_VGETCPU_CACHE() \
-  do {                       \
-    asm volatile ("movl %0, %%fs:%P1\n\t"                                    \
-                 "movl %0, %%fs:%P2"                                         \
-                 :                                                           \
-                 : "ir" (0), "i" (offsetof (struct pthread,                  \
-                                            header.vgetcpu_cache[0])),       \
-                   "i" (offsetof (struct pthread,                            \
-                                  header.vgetcpu_cache[1])));          \
-  } while (0)
-
-#include "../sched_setaffinity.c"
index 037759eb4f1da1cc48f597fa0930c7fd19eb515d..2bbd563a6c8997ebe199e7e1373df8cd0374109d 100644 (file)
@@ -11,7 +11,6 @@ CLEANUP_PREV          offsetof (struct _pthread_cleanup_buffer, __prev)
 MUTEX_FUTEX            offsetof (pthread_mutex_t, __data.__lock)
 MULTIPLE_THREADS_OFFSET        offsetof (tcbhead_t, multiple_threads)
 POINTER_GUARD          offsetof (tcbhead_t, pointer_guard)
-VGETCPU_CACHE_OFFSET   offsetof (tcbhead_t, vgetcpu_cache)
 FEATURE_1_OFFSET       offsetof (tcbhead_t, feature_1)
 SSP_BASE_OFFSET                offsetof (tcbhead_t, ssp_base)
 
index cb60ed4c3c17fc37637a1659c423885da6342bdb..7ba9c4e69b285fa357a9989026da2fb31cc7077d 100644 (file)
@@ -50,7 +50,7 @@ typedef struct
   uintptr_t sysinfo;
   uintptr_t stack_guard;
   uintptr_t pointer_guard;
-  unsigned long int vgetcpu_cache[2];
+  unsigned long int unused_vgetcpu_cache[2];
   /* Bit 0: X86_FEATURE_1_IBT.
      Bit 1: X86_FEATURE_1_SHSTK.
    */