gcc/libgomp/config/gcn
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
..
affinity-fmt.c Update copyright years. 2023-01-16 11:52:17 +01:00
allocator.c libgomp: basic pinned memory on Linux 2023-12-13 14:27:07 +00:00
bar.c Update copyright years. 2023-01-16 11:52:17 +01:00
bar.h Update copyright years. 2023-01-16 11:52:17 +01:00
doacross.h Update copyright years. 2023-01-16 11:52:17 +01:00
icv-device.c Update copyright years. 2023-01-16 11:52:17 +01:00
libgomp-gcn.h amdgcn, libgomp: low-latency allocator 2023-12-06 16:48:57 +00:00
oacc-target.c Update copyright years. 2023-01-16 11:52:17 +01:00
simple-bar.h Update copyright years. 2023-01-16 11:52:17 +01:00
target.c libgomp: Honor OpenMP's nteams-var ICV as upper limit on num teams [PR109875] 2023-05-21 20:37:15 +02:00
task.c Update copyright years. 2023-01-16 11:52:17 +01:00
team.c amdgcn, libgomp: low-latency allocator 2023-12-06 16:48:57 +00:00
teams.c Update copyright years. 2023-01-16 11:52:17 +01:00
time.c Update copyright years. 2023-01-16 11:52:17 +01:00