>1. Why will the FSD involve Cache Manager for NON CACHED I/O?
This has been discussed here for many times, briefly - because nothing prevents it from doing this, e.g. NTFS uses cache for processing non-cached requests for some types of files.
- A case where the FSD can involve Cache manager in a Non Cached I/O is that the file is also cached by the chache manager. So, even if i make a non cached request, it will have to update the cache too… Right?
Hmmm, e.g. NTFS always uses Cache Manager for processing requests to compressed files, so it doesn’t update data in the cache - it uses the cache to retrieve data.
- What if I open my log file in DriverEntry itself and lock it. Then if i issue Non Cached I/O on it in a Paging I/O path ( to a mapped file of course ). Why will it involve the cache manager?
Nothing changes. Mapping a file will involve Memory Manager and the same problems as with the Cache Manager. Cache Manager uses mapped file, so Cache Manager is a client of Memory Manager.
But you can use non paged memory for logging or lock several pages of the memory mapping the file. For example you can create a thread which will lock memory mapping the file and unlock already used memory and lock a new chunk asynchronously acording to the system load. Also you can create a blend of using locked pages or Paged Pool( for ordinary data streams, but be careful with the amount of used memory ) or NonPagePool( for any type of file ) when it is unsafe to write in the log file and write in the log file when it is safe to do this.
- Can i issue a Paging I/O request to my log file and escape from all this trouble?
Yes when the TopLevelIrp is NULL. But issuing a Paging IO request is a challenge. If the TopLevelIrp is not NULL then you do not have choice - use either pages locked in advance or use PagedPool or NonPaged Pool( for any type of file ).
–
Slava Imameyev, xxxxx@hotmail.com
“Kernel Developer” wrote in message news:xxxxx@ntfsd…
Thanks Slava!
You said:
“because you do not know the synchronization model( lock hierarchy etc. ) used
by the underlying FSD” and NON CACHED I/O doesn’t mean that the Cache Manager
won’t be used, only PAGING I/O provides this guarantee."
1. Why will the FSD involve Cache Manager for NON CACHED I/O?
2. A case where the FSD can involve Cache manager in a Non Cached I/O is that the file is also cached by the chache manager. So, even if i make a non cached request, it will have to update the cache too… Right?
3. What if I open my log file in DriverEntry itself and lock it. Then if i issue Non Cached I/O on it in a Paging I/O path ( to a mapped file of course ). Why will it involve the cache manager?
4. Can i issue a Paging I/O request to my log file and escape from all this trouble?
Thanks!
-K. Dev.