You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a few places (funcBIOC_OID, NPF_BufferedWrite, perhaps others), data from the user is used as input to a function that requires that the memory not be paged out until it is done being processed. To avoid page faults (as in #374), we currently allocate a new buffer from NonPagedPool and copy the user data into it. In cases where the IRP is not pended (i.e. we wait for an event to signal that it is done being processed before returning the buffer to the user), we should be able to use the user data buffer directly instead of copying it. We would need to have a MDL describing the buffer pages and to ensure that they are probed and locked so they cannot be paged out.
I believe that in the case of IRP_MJ_DEVICE_CONTROL, all our IoControl codes (in ioctls.h) specify METHOD_BUFFERED, which means that the user data has already been copied into a nonpaged buffer by the I/O manager. We may still need to create a MDL to describe the buffer, especially for NPF_BufferedWrite because we use several sections of the buffer independently.
The text was updated successfully, but these errors were encountered:
Fixed in 7d8c0a9. The I/O manager probes and locks the relevant pages for direct I/O (which we use for Read and Write. We just have to be sure not to complete the IRP before we're done with those pages (i.e. when the SendComplete handler is called).
In a few places (funcBIOC_OID, NPF_BufferedWrite, perhaps others), data from the user is used as input to a function that requires that the memory not be paged out until it is done being processed. To avoid page faults (as in #374), we currently allocate a new buffer from NonPagedPool and copy the user data into it. In cases where the IRP is not pended (i.e. we wait for an event to signal that it is done being processed before returning the buffer to the user), we should be able to use the user data buffer directly instead of copying it. We would need to have a MDL describing the buffer pages and to ensure that they are probed and locked so they cannot be paged out.
I believe that in the case of IRP_MJ_DEVICE_CONTROL, all our IoControl codes (in ioctls.h) specify METHOD_BUFFERED, which means that the user data has already been copied into a nonpaged buffer by the I/O manager. We may still need to create a MDL to describe the buffer, especially for NPF_BufferedWrite because we use several sections of the buffer independently.
The text was updated successfully, but these errors were encountered: