Caching of Kernel memory improves speed of copy from Kernel to User space memory. Caching is enabled while creating Kernel memory in driver. MmAllocatePagesForMdlEx is used with caching option - MmCached; instead of MmAllocatePagesForMdl
Shared Memory copy is slow
John Paul Kannampilly
1
Reputation point
Memory is created on Kernal space using MmAllocatePagesForMdl() in Kernel driver. It is mapped to user space using MmMapLockedPagesSpecifyCache and shared with process in user space using custom IOCTL enums via DeviceIoControl calls. Memcpy from this mapped memory to another memory location in User space is taking ~20 milliseconds for 190Kb. Copy of same memory allocated in user space is taking 0 millisecond.
Is there a way to speed-up the copy operation?