RE: Transfer very large amounts of data from kernel to usermode

>I’ve mapped a section between km and um. Performance is better than IOCTL
method, but many on this list poo poo this method. I’m OK with it.

If you read FltLockUserBuffer’s documentation you have:

…but rather because of the performance penalty incurred by MmGetSystemAddressForMdlSafe…

That is why the section version has better performances. But remember that device drivers can’t control the process context they are running in. If the driver is filtered and the filter driver decides to perform a context switch than the filtered driver no longer run in the issuer’s context and will not be able to map the section in the proper context. That is why the section must be named and the app should map the section on its own…

Peoples here don’t like named objects because of security concerns. And those who don’t want to use the named section must pay the penalty.

Of course if data is to be transfered by some hardware than DMA is the best option as Pavel pointed out.

I use a thread that waits on the process object in order to handle cleanup

On Fri, Apr 28, 2017, 11:52 AM wrote:

> >I’ve mapped a section between km and um. Performance is better than IOCTL
>
> method, but many on this list poo poo this method. I’m OK with it.
>
>
>
> If you read FltLockUserBuffer’s documentation you have:
>
>
>
> …but rather because of the performance penalty incurred by
> MmGetSystemAddressForMdlSafe…

>
>
>
> That is why the section version has better performances. But remember that
> device drivers can’t control the process context they are running in. If
> the driver is filtered and the filter driver decides to perform a context
> switch than the filtered driver no longer run in the issuer’s context and
> will not be able to map the section in the proper context. That is why the
> section must be named and the app should map the section on its own…
>
>
>
> Peoples here don’t like named objects because of security concerns. And
> those who don’t want to use the named section must pay the penalty.
>
>
>
> Of course if data is to be transfered by some hardware than DMA is the
> best option as Pavel pointed out.
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: <
> http://www.osronline.com/showlists.cfm?list=ntdev&gt;
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer&gt;
></http:>

Huh?

Mapping is mapping. If you don’t tear down the mappin created by MmGetSystemAddressForMdlSafe for each Request, there’s no difference in performance.

There’s not some magic way to map memory into KV address space that’s “fast” and another way that’s “slow”…

Peter
OSR
@OSRDrivers