[Openmp-commits] [PATCH] D49802: PR30734: Remove __kmp_ft_page_allocate()

Jonas Hahnfeld via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Jul 26 11:15:29 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL338052: PR30734: Remove __kmp_ft_page_allocate() (authored by Hahnfeld, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D49802?vs=157274&id=157540#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D49802

Files:
  openmp/trunk/runtime/src/kmp.h
  openmp/trunk/runtime/src/kmp_alloc.cpp


Index: openmp/trunk/runtime/src/kmp.h
===================================================================
--- openmp/trunk/runtime/src/kmp.h
+++ openmp/trunk/runtime/src/kmp.h
@@ -129,15 +129,6 @@
 #include "ompt-internal.h"
 #endif
 
-/*Select data placement in NUMA memory */
-#define NO_FIRST_TOUCH 0
-#define FIRST_TOUCH 1 /* Exploit SGI's first touch page placement algo */
-
-/* If not specified on compile command line, assume no first touch */
-#ifndef BUILD_MEMORY
-#define BUILD_MEMORY NO_FIRST_TOUCH
-#endif
-
 // 0 - no fast memory allocation, alignment: 8-byte on x86, 16-byte on x64.
 // 3 - fast allocation using sync, non-sync free lists of any size, non-self
 // free lists of limited size.
Index: openmp/trunk/runtime/src/kmp_alloc.cpp
===================================================================
--- openmp/trunk/runtime/src/kmp_alloc.cpp
+++ openmp/trunk/runtime/src/kmp_alloc.cpp
@@ -1548,33 +1548,6 @@
   return ptr;
 } // func ___kmp_allocate
 
-#if (BUILD_MEMORY == FIRST_TOUCH)
-void *__kmp_ft_page_allocate(size_t size) {
-  void *adr, *aadr;
-
-  const int page_size = KMP_GET_PAGE_SIZE();
-
-  adr = (void *)__kmp_thread_malloc(__kmp_get_thread(),
-                                    size + page_size + KMP_PTR_SKIP);
-  if (adr == 0)
-    KMP_FATAL(OutOfHeapMemory);
-
-  /* check to see if adr is on a page boundary. */
-  if (((kmp_uintptr_t)adr & (page_size - 1)) == 0)
-    /* nothing to do if adr is already on a page boundary. */
-    aadr = adr;
-  else
-    /* else set aadr to the first page boundary in the allocated memory. */
-    aadr = (void *)(((kmp_uintptr_t)adr + page_size) & ~(page_size - 1));
-
-  /* the first touch by the owner thread. */
-  *((void **)aadr) = adr;
-
-  /* skip the memory space used for storing adr above. */
-  return (void *)((char *)aadr + KMP_PTR_SKIP);
-}
-#endif
-
 /* Allocate memory on page boundary, fill allocated memory with 0x00.
    Does not call this func directly! Use __kmp_page_allocate macro instead.
    NULL is NEVER returned, __kmp_abort() is called in case of memory allocation


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49802.157540.patch
Type: text/x-patch
Size: 2077 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20180726/38e8a9cd/attachment-0001.bin>


More information about the Openmp-commits mailing list