linux aio with mmap

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

linux aio with mmap

731 Views
silecy2016
Contributor I

using mmap64 to get ddr address,then using linux aio to write files,but the speed is very low.if not using mmap , the speed is ok!

int fd_mem;
unsigned long long ddrStart = 0x200000000ULL;
unsigned long long ddrPhyAddress = 0x200000000ULL;
unsigned long long ddrSize = 0x80000000ULL;
long unsigned int *tmp;
fd_mem = open("/dev/mem", O_RDWR | O_SYNC);
if (fd_mem < 0)
{
printf("open /dev/mem faild\n");
return -1;
}


ddrStart = (long unsigned int)mmap((void*)ddrStart, ddrSize,
PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_LOCKED | MAP_NORESERVE,
fd_mem, ddrPhyAddress);
if ((void *)ddrStart == MAP_FAILED)
{
close(fd_mem);
printf("mmap memory failed\n");
return -1;
}

0 Kudos
0 Replies