> One very couple of generic question:
a)If an ISR is called which throws out a large amount of data from the
device and this data needs to be processed in the DPC then we need to
acquire an interrupt lock to sync the DPC and ISR. Now lets say its some
huge amount of data and I acquire the interrupt lock and the processing of
the data takes some time in DPC. Then system performance is going to go
down since DPC is taking quite some time and also ISR processing is
blocked.So what is the solution for that?
If an ISR is called, it will not conflict with a DPC unless a previous
interrupt has queued a DPC. And then, only if the ISR and DPC are working
on the same data. The best synchronization is no synchronization, that
is, create a design that does not create usage conflicts. There are
enough intrinsic synchronization problems at the ISR/DPC level, such as
usage of device registers, that you should not be introducing gratuitous
synchronization problems. The first thing I’d look at for this problem is
how to avoid any need for synchronization by making sure there is no
conflict. For example, once the ISRVfills the buffer, it can request a
DPC. The ultimate outcome of this should be that the buffer is complete
and will never, ever, be reused by the ISR. If the processing exceeds the
DPC budget, you queue up a requst for a driver thread to do the processing
(whether by using a WorkItem or your own dedicated thread), and this
thread will complete the IRP. The next interrupt will act on a different
buffer. So there is no sharing, and no need for synchronization.
b)If a process in DPC is to be sync-ed with a passive level thread lets
say a readfile request then we need to acquire a spinlock shared with the
DPC .Now if the data is huge and the passive level processing (under spin
locks) is taking time then the DPC processing will spin-wait.So system
performance goes down since DPC is blocked and it will in turn block the
scheduler from executing .So wats the solution to this?
See previous discussion. There should be no need to “sync” usage of a DPC
with a passive-level thread. Why are you sharing a buffer? What size
buffers arecwe talking about here? How much processing?
joe
The problem in above two is essentially the same: Blocking a higher
priority thread to do loads of work at lower priority thread ,when the
data structure,on which work is being performed,is shared between these
two threadsHow to have a generic solution to this issue? How do drivers of high
performance/high data rate devices take care of this?
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminarsTo unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer