Peter,
Yes, you are correct. In any method you are incurring a context switch
because initially you run in an arbitrary kernel thread context, which
blocks, waiting for a user mode thread to perform work for it then back
again. So, yes, there is always this context switch.
The approach I am referring to will only eliminate the Irp processing
incurred in both directions, the IOCtl calls along with the Irp completion
from kernel mode, when a request is to be processed in user mode. As many
have pointed out, most implementations suffer greater performance loss
because of what they are doing in user mode with the request, compared to
the actual mechanism used to communicate the request to user mode. I am
referring here to a well written interface.
I have found that implementing the communication layer using the well known
inverted call model along with a shared memory region for processing large,
for varying sizes of large, buffers is architecturally the least complex
while minimizing buffer copies.
Pete
Kernel Drivers
Windows Filesystem and Device Driver Consulting
www.KernelDrivers.com
(303)546-0300
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Peter Wieland
Sent: Wednesday, September 07, 2005 10:34 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Kernel Mode Vs User mode DLLs
i can see how that might get rid of the cost of moving the data to and from
user-mode to process it, but how would it remove the cost of context
switches? If you’re in kernel and you want user-mode code to run you need
to switch to a thread that’s in user-mode (costing you a context switch).
-p
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Peter Scott
Sent: Wednesday, September 07, 2005 8:49 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Kernel Mode Vs User mode DLLs
You can remove the context switches by implementing it as a shared memory
region instead of context passed through Irps.
Pete
Kernel Drivers
Windows Filesystem and Device Driver Consulting
www.KernelDrivers.com
(303)546-0300
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Developer
Sent: Wednesday, September 07, 2005 9:04 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Kernel Mode Vs User mode DLLs
Most of the solutions take this approach: The filtering algorithm runs in
user-mode, *always*. The kernel-mode component intercepts interesting FSD
calls, and routes them to the user-mode app.
Yes I know, I have rad it, the inverted call approach, right? But for a
system that is performance crytical, is this a good solution? Every time
shifting from kernel mode to user getting the job done and coming back…
This lets you do whatever
crazy validation logic you want in user-mode, and keeps the kernel-mode
component as simple as possible. The kernel-mode component implements
mechanism; the user-mode component implements policy.
— Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 You are currently subscribed to
ntdev as: unknown lmsubst tag argument: ‘’ To unsubscribe send a blank email
to xxxxx@lists.osr.com
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com