gcc/libgomp/config
Andrew Stubbs 348874f0ba libgomp: basic pinned memory on Linux
Implement the OpenMP pinned memory trait on Linux hosts using the mlock
syscall.  Pinned allocations are performed using mmap, not malloc, to ensure
that they can be unpinned safely when freed.

This implementation will work OK for page-scale allocations, and finer-grained
allocations will be implemented in a future patch.

libgomp/ChangeLog:

	* allocator.c (MEMSPACE_ALLOC): Add PIN.
	(MEMSPACE_CALLOC): Add PIN.
	(MEMSPACE_REALLOC): Add PIN.
	(MEMSPACE_FREE): Add PIN.
	(MEMSPACE_VALIDATE): Add PIN.
	(omp_init_allocator): Use MEMSPACE_VALIDATE to check pinning.
	(omp_aligned_alloc): Add pinning to all MEMSPACE_* calls.
	(omp_aligned_calloc): Likewise.
	(omp_realloc): Likewise.
	(omp_free): Likewise.
	* config/linux/allocator.c: New file.
	* config/nvptx/allocator.c (MEMSPACE_ALLOC): Add PIN.
	(MEMSPACE_CALLOC): Add PIN.
	(MEMSPACE_REALLOC): Add PIN.
	(MEMSPACE_FREE): Add PIN.
	(MEMSPACE_VALIDATE): Add PIN.
	* config/gcn/allocator.c (MEMSPACE_ALLOC): Add PIN.
	(MEMSPACE_CALLOC): Add PIN.
	(MEMSPACE_REALLOC): Add PIN.
	(MEMSPACE_FREE): Add PIN.
	* libgomp.texi: Switch pinned trait to supported.
	(MEMSPACE_VALIDATE): Add PIN.
	* testsuite/libgomp.c/alloc-pinned-1.c: New test.
	* testsuite/libgomp.c/alloc-pinned-2.c: New test.
	* testsuite/libgomp.c/alloc-pinned-3.c: New test.
	* testsuite/libgomp.c/alloc-pinned-4.c: New test.

Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
2023-12-13 14:27:07 +00:00
..
accel openmp: Add support for the 'indirect' clause in C/C++ 2023-11-07 15:44:50 +00:00
bsd Update copyright years. 2023-01-16 11:52:17 +01:00
darwin Update copyright years. 2023-01-16 11:52:17 +01:00
gcn libgomp: basic pinned memory on Linux 2023-12-13 14:27:07 +00:00
hpux Update copyright years. 2023-01-16 11:52:17 +01:00
linux libgomp: basic pinned memory on Linux 2023-12-13 14:27:07 +00:00
mingw32 Update copyright years. 2023-01-16 11:52:17 +01:00
nvptx libgomp: basic pinned memory on Linux 2023-12-13 14:27:07 +00:00
posix Update copyright years. 2023-01-16 11:52:17 +01:00
rtems Update copyright years. 2023-01-16 11:52:17 +01:00
t-aix aix: remove libgomp and libatomic archives before creating FAT archives 2020-10-11 17:30:24 -04:00