403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.217.33
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/sysutils/roct/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/sysutils/roct/files/patch-src_fmm.c
--- src/fmm.c.orig	2018-11-19 01:35:23 UTC
+++ src/fmm.c
@@ -37,7 +37,9 @@
 #include <sys/time.h>
 #include <errno.h>
 #include <pci/pci.h>
+#ifdef __linux__
 #include <numaif.h>
+#endif
 #ifndef MPOL_F_STATIC_NODES
 /* Bug in numaif.h, this should be defined in there. Definition copied
  * from linux/mempolicy.h.
@@ -1207,7 +1209,9 @@ static void *fmm_allocate_host_gpu(uint32_t node_id, u
 	if (!flags.ui32.NonPaged && svm.userptr_for_paged_mem) {
 		const unsigned int bits_per_long = sizeof(unsigned long) * 8;
 		unsigned long node_mask[node_id / bits_per_long + 1];
+#ifdef __linux__
 		int mode = MPOL_F_STATIC_NODES;
+#endif
 
 		/* Allocate address space */
 		pthread_mutex_lock(&aperture->fmm_mutex);
@@ -1219,10 +1223,12 @@ static void *fmm_allocate_host_gpu(uint32_t node_id, u
 		/* Bind to NUMA node */
 		memset(node_mask, 0, sizeof(node_mask));
 		node_mask[node_id / bits_per_long] = 1UL << (node_id % bits_per_long);
+#ifdef __linux__
 		mode |= flags.ui32.NoSubstitute ? MPOL_BIND : MPOL_PREFERRED;
 		if (mbind(mem, MemorySizeInBytes, mode, node_mask, node_id+1, 0))
 			pr_warn("Failed to set NUMA policy for %lu pages at %p\n",
 				MemorySizeInBytes >> 12, mem);
+#endif
 
 		/* Map anonymous pages */
 		if (mmap(mem, MemorySizeInBytes, PROT_READ | PROT_WRITE,
@@ -1334,7 +1340,9 @@ static void __fmm_release(void *address, manageable_ap
 	if (address >= dgpu_shared_aperture_base &&
 	    address <= dgpu_shared_aperture_limit) {
 		/* Reset NUMA policy */
+#ifdef __linux__
 		mbind(address, object->size, MPOL_DEFAULT, NULL, 0, 0);
+#endif
 		munmap_and_reserve_address(address, object->size);
 	}
 

Youez - 2016 - github.com/yon3zu
LinuXploit