Number of processing DPC objects

I didn’t find no explicit answer in books nor in electronic media, regarding
the question I have.

  1. On a multiprocessor NT platform, each processor has its own DPC queue.
    Right?
  2. Then: On each(!) DPC queue, there can be only one pending DPC object.
    Right?
  3. Then: I can (theoretically) have NumOfProcessors*2 DPC objects in
    processing, (one in DPC_queue[processor] + one currently processing on
    processor)*NumOfProcessors.
    Right?
    Thanks in advance for any info.
    Wbr Primoz

Primoz Beltram
e-mail: xxxxx@hermes.si
www: http://www.hermes.si
HERMES SoftLab, Office Nova Gorica
Erjavceva ul. 2, 5000 Nova Gorica, Slovenia
phone: (++386 5) 33 30 510, (++386 1) 58 65 710
fax: (++386 5) 33 32 656, (++386 1) 58 65 270


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

  1. correct.
  2. not sure what you meant here. Each processor dpc queue can have an
    unbounded number of dpc objects queued, but each dpc object can only be
    on one queue at a time. Easy to express in UML, not so easy to express
    in english.
  3. depends on what you meant by (2). Each dpc object can only be either
    queued or not-queued. So a single dpc object can be queued at most once.
    This holds true while a dpc routine is executing: the related dpc object
    is either queued or not queued, and it can be queued at most once. The
    dpc routines related to a single dpc object can be executing with a
    concurrency of Np where Np is the number of processors.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Primoz Beltram
Sent: Monday, October 15, 2001 6:10 AM
To: NT Developers Interest List
Subject: [ntdev] Number of processing DPC objects

I didn’t find no explicit answer in books nor in electronic media,
regarding the question I have.

  1. On a multiprocessor NT platform, each processor has its own DPC
    queue. Right?

  2. Then: On each(!) DPC queue, there can be only one pending DPC object.
    Right?

  3. Then: I can (theoretically) have NumOfProcessors*2 DPC objects in
    processing, (one in DPC_queue[processor] + one currently processing on
    processor)*NumOfProcessors.

Right?

Thanks in advance for any info.

Wbr Primoz


Primoz Beltram

e-mail: xxxxx@hermes.si

www: http://www.hermes.si

HERMES SoftLab, Office Nova Gorica

Erjavceva ul. 2, 5000 Nova Gorica, Slovenia

phone: (++386 5) 33 30 510, (++386 1) 58 65 710

fax: (++386 5) 33 32 656, (++386 1) 58 65 270



You are currently subscribed to ntdev as: xxxxx@hollistech.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Number of processing DPC objects1 - true.
2 - there can be the arbitrary number of pending DPC in each queue
3 - you can have a maximum of KeNumberProcessors DPCs running (including the same DPC running twice on 2 CPUs), and arbitrary number of DPCs queued.

Max

----- Original Message -----
From: Primoz Beltram
To: NT Developers Interest List
Sent: Monday, October 15, 2001 2:10 PM
Subject: [ntdev] Number of processing DPC objects

I didn’t find no explicit answer in books nor in electronic media, regarding the question I have.

  1. On a multiprocessor NT platform, each processor has its own DPC queue. Right?

  2. Then: On each(!) DPC queue, there can be only one pending DPC object. Right?

  3. Then: I can (theoretically) have NumOfProcessors*2 DPC objects in processing, (one in DPC_queue[processor] + one currently processing on processor)*NumOfProcessors.

Right?

Thanks in advance for any info.

Wbr Primoz


Primoz Beltram

e-mail: xxxxx@hermes.si

www: http://www.hermes.si

HERMES SoftLab, Office Nova Gorica

Erjavceva ul. 2, 5000 Nova Gorica, Slovenia

phone: (++386 5) 33 30 510, (++386 1) 58 65 710

fax: (++386 5) 33 32 656, (++386 1) 58 65 270



You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

With “only one pending DPC”, I meant “my drivers DPC object” (sorry for
inexactness). I know that there could be others drivers DPC objects in the
DPC queues. My interest is to clear how many “my drivers DPC objects” can be
in processing on a MP machine. So far it seams that point 3. is true.
Thanks.
Wbr Primoz

-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Monday, October 15, 2001 12:42 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

  1. correct.
  2. not sure what you meant here. Each processor dpc queue can have an
    unbounded number of dpc objects queued, but each dpc object can only be on
    one queue at a time. Easy to express in UML, not so easy to express in
    english.
  3. depends on what you meant by (2). Each dpc object can only be either
    queued or not-queued. So a single dpc object can be queued at most once.
    This holds true while a dpc routine is executing: the related dpc object is
    either queued or not queued, and it can be queued at most once. The dpc
    routines related to a single dpc object can be executing with a concurrency
    of Np where Np is the number of processors.
    -----Original Message-----
    From: xxxxx@lists.osr.com
    [mailto:xxxxx@lists.osr.com] On Behalf Of Primoz Beltram
    Sent: Monday, October 15, 2001 6:10 AM
    To: NT Developers Interest List
    Subject: [ntdev] Number of processing DPC objects
    I didn’t find no explicit answer in books nor in electronic media, regarding
    the question I have.
  4. On a multiprocessor NT platform, each processor has its own DPC queue.
    Right?
  5. Then: On each(!) DPC queue, there can be only one pending DPC object.
    Right?
  6. Then: I can (theoretically) have NumOfProcessors*2 DPC objects in
    processing, (one in DPC_queue[processor] + one currently processing on
    processor)*NumOfProcessors.
    Right?
    Thanks in advance for any info.
    Wbr Primoz

Primoz Beltram
e-mail: xxxxx@hermes.si
www: http://www.hermes.si http:
HERMES SoftLab, Office Nova Gorica
Erjavceva ul. 2, 5000 Nova Gorica, Slovenia
phone: (++386 5) 33 30 510, (++386 1) 58 65 710
fax: (++386 5) 33 32 656, (++386 1) 58 65 270
-----------------------------------------------

You are currently subscribed to ntdev as: xxxxx@hollistech.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</http:>

In addition to the concurrency of your dpc routine (Np) it is important to
note that there is not a 1-1 relationship between IoRequestDpc and queued
dpc objects. That is to say, as a single dpc object can be queued at most
once, an attempt to queue a dpc object that is already queued will have no
effect. An invocation of a dpc routine can therefore represent 0…*
interrupt events. Zero, as some other invocation of your dpc routine may
have consumed the interrupt event that this invocation was triggered by, and
* as some unknown number of interrupt events may have occurred before this
invocation of the dpc routine started to execute (and an unknown number of
interrupt events may occur while the dpc routine executes.) I have seen more
than one driver that find this so annoying that they turn off interrupts
from their device before requesting a dpc, and turn interrupts back on at
the end of the dpc routine. I wouldn’t recommend this approach, but it is
not uncommon.
-----Original Message-----
From: Primoz Beltram [mailto:xxxxx@hermes.si]
Sent: Monday, October 15, 2001 10:29 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

With “only one pending DPC”, I meant “my drivers DPC object” (sorry for
inexactness). I know that there could be others drivers DPC objects in the
DPC queues. My interest is to clear how many “my drivers DPC objects” can be
in processing on a MP machine. So far it seams that point 3. is true.
Thanks.
Wbr Primoz

-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Monday, October 15, 2001 12:42 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

  1. correct.
  2. not sure what you meant here. Each processor dpc queue can have an
    unbounded number of dpc objects queued, but each dpc object can only be on
    one queue at a time. Easy to express in UML, not so easy to express in
    english.
  3. depends on what you meant by (2). Each dpc object can only be either
    queued or not-queued. So a single dpc object can be queued at most once.
    This holds true while a dpc routine is executing: the related dpc object is
    either queued or not queued, and it can be queued at most once. The dpc
    routines related to a single dpc object can be executing with a concurrency
    of Np where Np is the number of processors.
    -----Original Message-----
    From: xxxxx@lists.osr.com
    [mailto:xxxxx@lists.osr.com] On Behalf Of Primoz Beltram
    Sent: Monday, October 15, 2001 6:10 AM
    To: NT Developers Interest List
    Subject: [ntdev] Number of processing DPC objects
    I didn’t find no explicit answer in books nor in electronic media, regarding
    the question I have.
  4. On a multiprocessor NT platform, each processor has its own DPC queue.
    Right?
  5. Then: On each(!) DPC queue, there can be only one pending DPC object.
    Right?
  6. Then: I can (theoretically) have NumOfProcessors*2 DPC objects in
    processing, (one in DPC_queue[processor] + one currently processing on
    processor)*NumOfProcessors.
    Right?
    Thanks in advance for any info.
    Wbr Primoz

Primoz Beltram
e-mail: xxxxx@hermes.si
www: http://www.hermes.si http:
HERMES SoftLab, Office Nova Gorica
Erjavceva ul. 2, 5000 Nova Gorica, Slovenia
phone: (++386 5) 33 30 510, (++386 1) 58 65 710
fax: (++386 5) 33 32 656, (++386 1) 58 65 270
-----------------------------------------------

You are currently subscribed to ntdev as: xxxxx@hollistech.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</http:>

MessageAny number.
Your driver can have any number of KDPC structures in device extension or other nonpaged allocations.

Max
----- Original Message -----
From: Primoz Beltram
To: NT Developers Interest List
Sent: Monday, October 15, 2001 6:28 PM
Subject: [ntdev] RE: Number of processing DPC objects

With “only one pending DPC”, I meant “my drivers DPC object” (sorry for inexactness). I know that there could be others drivers DPC objects in the DPC queues. My interest is to clear how many “my drivers DPC objects” can be in processing on a MP machine. So far it seams that point 3. is true. Thanks.

Wbr Primoz

-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Monday, October 15, 2001 12:42 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

  1. correct.

  2. not sure what you meant here. Each processor dpc queue can have an unbounded number of dpc objects queued, but each dpc object can only be on one queue at a time. Easy to express in UML, not so easy to express in english.

  3. depends on what you meant by (2). Each dpc object can only be either queued or not-queued. So a single dpc object can be queued at most once. This holds true while a dpc routine is executing: the related dpc object is either queued or not queued, and it can be queued at most once. The dpc routines related to a single dpc object can be executing with a concurrency of Np where Np is the number of processors.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Primoz Beltram
Sent: Monday, October 15, 2001 6:10 AM
To: NT Developers Interest List
Subject: [ntdev] Number of processing DPC objects

I didn’t find no explicit answer in books nor in electronic media, regarding the question I have.

  1. On a multiprocessor NT platform, each processor has its own DPC queue. Right?

  2. Then: On each(!) DPC queue, there can be only one pending DPC object. Right?

  3. Then: I can (theoretically) have NumOfProcessors*2 DPC objects in processing, (one in DPC_queue[processor] + one currently processing on processor)*NumOfProcessors.

Right?

Thanks in advance for any info.

Wbr Primoz


Primoz Beltram

e-mail: xxxxx@hermes.si

www: http://www.hermes.si

HERMES SoftLab, Office Nova Gorica

Erjavceva ul. 2, 5000 Nova Gorica, Slovenia

phone: (++386 5) 33 30 510, (++386 1) 58 65 710

fax: (++386 5) 33 32 656, (++386 1) 58 65 270



You are currently subscribed to ntdev as: xxxxx@hollistech.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Mark,
??? You may not recommend this approach but the NDIS spec does:
"MiniportISR must disable interrupts to ensure that when
MiniportHandleInterrupt runs, no information in the NIC will be overwritten
by a subsequent interrupt. ".?
In fact, either you turn off interrupts in the ISR and do the processing in
the DPC, or you?are obliged to?move some of the event?processing into the
ISR (to at least convince the card to remove the current IRQ).
From a system perspective it is much better to do the processing in the DPC.
?
Regards,
Evan
-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: 15 October 2001 15:49
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

In addition to the concurrency of your dpc routine (Np) it is important to
note that there is not a 1-1 relationship between IoRequestDpc and queued
dpc objects. That is to say, as a single dpc object can be queued at most
once, an attempt to queue a dpc object that is already queued will have no
effect. An invocation of a dpc routine can therefore represent 0…*
interrupt events. Zero, as some other invocation of your dpc routine may
have consumed the interrupt event that this invocation was triggered by, and
* as some unknown number of interrupt events may have occurred before this
invocation of the dpc routine started to execute (and an unknown number of
interrupt events may occur while the dpc routine executes.) I have seen more
than one driver that find this so annoying that they turn off interrupts
from their device before requesting a dpc, and turn interrupts back on at
the end of the dpc routine. I wouldn’t recommend this approach, but it is
not uncommon.
-----Original Message-----
From: Primoz Beltram [mailto:xxxxx@hermes.si]
Sent: Monday, October 15, 2001 10:29 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

With “only one pending DPC”, I meant “my drivers DPC object” (sorry for
inexactness). I know that there could be others drivers DPC objects in the
DPC queues. My interest is to clear how many “my drivers DPC objects” can be
in processing on a MP machine. So far it seams that point 3. is true.
Thanks.
Wbr Primoz
?
-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Monday, October 15, 2001 12:42 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects
?

  1. correct.
  2. not sure what you meant here. Each processor dpc queue can have an
    unbounded number of dpc objects queued, but each dpc object can only be on
    one queue at a time. Easy to express in UML, not so easy to express in
    english.
  3. depends on what you meant by (2). Each dpc object can only be either
    queued or not-queued. So a single dpc object can be queued at most once.
    This holds true while a dpc routine is executing: the related dpc object is
    either queued or not queued, and it can be queued at most once. The dpc
    routines related to a single dpc object can be executing with a concurrency
    of Np where Np is the number of processors.
    -----Original Message-----
    From: xxxxx@lists.osr.com
    [mailto:xxxxx@lists.osr.com] On Behalf Of Primoz Beltram
    Sent: Monday, October 15, 2001 6:10 AM
    To: NT Developers Interest List
    Subject: [ntdev] Number of processing DPC objects
    I didn’t find no explicit answer in books nor in electronic media, regarding
    the question I have.
  4. On a multiprocessor NT platform, each processor has its own DPC queue.
    Right?
  5. Then: On each(!) DPC queue, there can be only one pending DPC object.
    Right?
  6. Then: I can (theoretically) have NumOfProcessors*2 DPC objects in
    processing, (one in DPC_queue[processor] + one currently processing on
    processor)*NumOfProcessors.
    Right?
    Thanks in advance for any info.
    Wbr Primoz

You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


Primoz Beltram
e-mail: xxxxx@hermes.si
www: http://www.hermes.si
HERMES SoftLab, Office Nova Gorica
Erjavceva ul. 2, 5000 Nova Gorica, Slovenia
phone: (++386 5) 33 30 510, (++386 1) 58 65 710
fax:?? (++386 5) 33 32 656, (++386 1) 58 65 270


You are currently subscribed to ntdev as: xxxxx@hollistech.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@eicon.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Yeah sure, scsiport does the same thing to its miniports. It is simple, so
is system queuing of irps, but it does not allow for the highest possible
performance as it increases the serialization of the driver.
-----Original Message-----
From: Evan Lloyd [mailto:xxxxx@eicon.com]
Sent: Tuesday, October 16, 2001 4:55 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

Mark,
You may not recommend this approach but the NDIS spec does:
"MiniportISR must disable interrupts to ensure that when
MiniportHandleInterrupt runs, no information in the NIC will be overwritten
by a subsequent interrupt. ".
In fact, either you turn off interrupts in the ISR and do the processing in
the DPC, or you are obliged to move some of the event processing into the
ISR (to at least convince the card to remove the current IRQ).
From a system perspective it is much better to do the processing in the DPC.

Regards,
Evan
-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: 15 October 2001 15:49
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

In addition to the concurrency of your dpc routine (Np) it is important to
note that there is not a 1-1 relationship between IoRequestDpc and queued
dpc objects. That is to say, as a single dpc object can be queued at most
once, an attempt to queue a dpc object that is already queued will have no
effect. An invocation of a dpc routine can therefore represent 0…*
interrupt events. Zero, as some other invocation of your dpc routine may
have consumed the interrupt event that this invocation was triggered by, and
* as some unknown number of interrupt events may have occurred before this
invocation of the dpc routine started to execute (and an unknown number of
interrupt events may occur while the dpc routine executes.) I have seen more
than one driver that find this so annoying that they turn off interrupts
from their device before requesting a dpc, and turn interrupts back on at
the end of the dpc routine. I wouldn’t recommend this approach, but it is
not uncommon.
-----Original Message-----
From: Primoz Beltram [mailto:xxxxx@hermes.si]
Sent: Monday, October 15, 2001 10:29 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

With “only one pending DPC”, I meant “my drivers DPC object” (sorry for
inexactness). I know that there could be others drivers DPC objects in the
DPC queues. My interest is to clear how many “my drivers DPC objects” can be
in processing on a MP machine. So far it seams that point 3. is true.
Thanks.
Wbr Primoz

-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Monday, October 15, 2001 12:42 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

  1. correct.
  2. not sure what you meant here. Each processor dpc queue can have an
    unbounded number of dpc objects queued, but each dpc object can only be on
    one queue at a time. Easy to express in UML, not so easy to express in
    english.
  3. depends on what you meant by (2). Each dpc object can only be either
    queued or not-queued. So a single dpc object can be queued at most once.
    This holds true while a dpc routine is executing: the related dpc object is
    either queued or not queued, and it can be queued at most once. The dpc
    routines related to a single dpc object can be executing with a concurrency
    of Np where Np is the number of processors.
    -----Original Message-----
    From: xxxxx@lists.osr.com
    [mailto:xxxxx@lists.osr.com] On Behalf Of Primoz Beltram
    Sent: Monday, October 15, 2001 6:10 AM
    To: NT Developers Interest List
    Subject: [ntdev] Number of processing DPC objects
    I didn’t find no explicit answer in books nor in electronic media, regarding
    the question I have.
  4. On a multiprocessor NT platform, each processor has its own DPC queue.
    Right?
  5. Then: On each(!) DPC queue, there can be only one pending DPC object.
    Right?
  6. Then: I can (theoretically) have NumOfProcessors*2 DPC objects in
    processing, (one in DPC_queue[processor] + one currently processing on
    processor)*NumOfProcessors.
    Right?
    Thanks in advance for any info.
    Wbr Primoz
    — You are currently subscribed to ntdev as: xxxxx@stratus.com To
    unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Primoz Beltram
e-mail: xxxxx@hermes.si
www: http://www.hermes.si http:
HERMES SoftLab, Office Nova Gorica
Erjavceva ul. 2, 5000 Nova Gorica, Slovenia
phone: (++386 5) 33 30 510, (++386 1) 58 65 710
fax: (++386 5) 33 32 656, (++386 1) 58 65 270
-----------------------------------------------

You are currently subscribed to ntdev as: xxxxx@hollistech.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@eicon.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</http:>

I agree.

But I think the right approach would be disable the interrupt from ISR - as
soon as you recognize the interrupt -, save the device register values in
some data structure (may be device extension), Queue the DPC and then enable
the interrupt once again.

  • Vipul
    -----Original Message-----
    From: Evan Lloyd [mailto:xxxxx@eicon.com]
    Sent: Tuesday, October 16, 2001 1:55 AM
    To: NT Developers Interest List
    Subject: [ntdev] RE: Number of processing DPC objects

Mark,
You may not recommend this approach but the NDIS spec does:
"MiniportISR must disable interrupts to ensure that when
MiniportHandleInterrupt runs, no information in the NIC will be overwritten
by a subsequent interrupt. ".
In fact, either you turn off interrupts in the ISR and do the processing in
the DPC, or you are obliged to move some of the event processing into the
ISR (to at least convince the card to remove the current IRQ).
From a system perspective it is much better to do the processing in the DPC.

Regards,
Evan
-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: 15 October 2001 15:49
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

In addition to the concurrency of your dpc routine (Np) it is important to
note that there is not a 1-1 relationship between IoRequestDpc and queued
dpc objects. That is to say, as a single dpc object can be queued at most
once, an attempt to queue a dpc object that is already queued will have no
effect. An invocation of a dpc routine can therefore represent 0…*
interrupt events. Zero, as some other invocation of your dpc routine may
have consumed the interrupt event that this invocation was triggered by, and
* as some unknown number of interrupt events may have occurred before this
invocation of the dpc routine started to execute (and an unknown number of
interrupt events may occur while the dpc routine executes.) I have seen more
than one driver that find this so annoying that they turn off interrupts
from their device before requesting a dpc, and turn interrupts back on at
the end of the dpc routine. I wouldn’t recommend this approach, but it is
not uncommon.
-----Original Message-----
From: Primoz Beltram [mailto:xxxxx@hermes.si]
Sent: Monday, October 15, 2001 10:29 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

With “only one pending DPC”, I meant “my drivers DPC object” (sorry for
inexactness). I know that there could be others drivers DPC objects in the
DPC queues. My interest is to clear how many “my drivers DPC objects” can be
in processing on a MP machine. So far it seams that point 3. is true.
Thanks.
Wbr Primoz

-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Monday, October 15, 2001 12:42 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

  1. correct.
  2. not sure what you meant here. Each processor dpc queue can have an
    unbounded number of dpc objects queued, but each dpc object can only be on
    one queue at a time. Easy to express in UML, not so easy to express in
    english.
  3. depends on what you meant by (2). Each dpc object can only be either
    queued or not-queued. So a single dpc object can be queued at most once.
    This holds true while a dpc routine is executing: the related dpc object is
    either queued or not queued, and it can be queued at most once. The dpc
    routines related to a single dpc object can be executing with a concurrency
    of Np where Np is the number of processors.
    -----Original Message-----
    From: xxxxx@lists.osr.com
    [mailto:xxxxx@lists.osr.com] On Behalf Of Primoz Beltram
    Sent: Monday, October 15, 2001 6:10 AM
    To: NT Developers Interest List
    Subject: [ntdev] Number of processing DPC objects
    I didn’t find no explicit answer in books nor in electronic media, regarding
    the question I have.
  4. On a multiprocessor NT platform, each processor has its own DPC queue.
    Right?
  5. Then: On each(!) DPC queue, there can be only one pending DPC object.
    Right?
  6. Then: I can (theoretically) have NumOfProcessors*2 DPC objects in
    processing, (one in DPC_queue[processor] + one currently processing on
    processor)*NumOfProcessors.
    Right?
    Thanks in advance for any info.
    Wbr Primoz
    — You are currently subscribed to ntdev as: xxxxx@fvc.com To unsubscribe
    send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Primoz Beltram
e-mail: xxxxx@hermes.si
www: http://www.hermes.si http:
HERMES SoftLab, Office Nova Gorica
Erjavceva ul. 2, 5000 Nova Gorica, Slovenia
phone: (++386 5) 33 30 510, (++386 1) 58 65 710
fax: (++386 5) 33 32 656, (++386 1) 58 65 270
-----------------------------------------------

You are currently subscribed to ntdev as: xxxxx@hollistech.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@eicon.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</http:>

If you do as suggested by Evan and if your hardware has N independent IO
channels, then you are essentially serializing access to what would
otherwise be concurrent data paths. For example I have a plx9054 pci device
I fool around with at home. It has, at a minimum, two independent DMA
channels. Using the disable-in-isr enable-in-dpc approach achieves almost
exactly half the throughput of the deserialized dpc approach, up to some
level of saturation where either channel is able to consume all the
bandwidth by itself. (To be clearer, the effect is most noticeable where
small transfers are performed and DMA setup time is the dominant factor. For
large transfers the DMA transfer operation itself dominates and the setup
time and serialization is not terribly important.) I agree with Vipul that
the ISR ought to record the state, queue the dpc, and then re-enable the
next interrupt. Generally this is not a lot of extra processing in the ISR -
read some data, store it somewhere, and it allows for parallel performance
on MP platforms for your driver lower edge.
-----Original Message-----
From: Vipul Jain [mailto:xxxxx@fvc.com]
Sent: Tuesday, October 16, 2001 12:31 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

I agree.

But I think the right approach would be disable the interrupt from ISR - as
soon as you recognize the interrupt -, save the device register values in
some data structure (may be device extension), Queue the DPC and then enable
the interrupt once again.

  • Vipul
    -----Original Message-----
    From: Evan Lloyd [mailto:xxxxx@eicon.com]
    Sent: Tuesday, October 16, 2001 1:55 AM
    To: NT Developers Interest List
    Subject: [ntdev] RE: Number of processing DPC objects

Mark,
You may not recommend this approach but the NDIS spec does:
"MiniportISR must disable interrupts to ensure that when
MiniportHandleInterrupt runs, no information in the NIC will be overwritten
by a subsequent interrupt. ".
In fact, either you turn off interrupts in the ISR and do the processing in
the DPC, or you are obliged to move some of the event processing into the
ISR (to at least convince the card to remove the current IRQ).
From a system perspective it is much better to do the processing in the DPC.

Regards,
Evan
-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: 15 October 2001 15:49
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

In addition to the concurrency of your dpc routine (Np) it is important to
note that there is not a 1-1 relationship between IoRequestDpc and queued
dpc objects. That is to say, as a single dpc object can be queued at most
once, an attempt to queue a dpc object that is already queued will have no
effect. An invocation of a dpc routine can therefore represent 0…*
interrupt events. Zero, as some other invocation of your dpc routine may
have consumed the interrupt event that this invocation was triggered by, and
* as some unknown number of interrupt events may have occurred before this
invocation of the dpc routine started to execute (and an unknown number of
interrupt events may occur while the dpc routine executes.) I have seen more
than one driver that find this so annoying that they turn off interrupts
from their device before requesting a dpc, and turn interrupts back on at
the end of the dpc routine. I wouldn’t recommend this approach, but it is
not uncommon.
-----Original Message-----
From: Primoz Beltram [mailto:xxxxx@hermes.si]
Sent: Monday, October 15, 2001 10:29 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

With “only one pending DPC”, I meant “my drivers DPC object” (sorry for
inexactness). I know that there could be others drivers DPC objects in the
DPC queues. My interest is to clear how many “my drivers DPC objects” can be
in processing on a MP machine. So far it seams that point 3. is true.
Thanks.
Wbr Primoz

-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Monday, October 15, 2001 12:42 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

  1. correct.
  2. not sure what you meant here. Each processor dpc queue can have an
    unbounded number of dpc objects queued, but each dpc object can only be on
    one queue at a time. Easy to express in UML, not so easy to express in
    english.
  3. depends on what you meant by (2). Each dpc object can only be either
    queued or not-queued. So a single dpc object can be queued at most once.
    This holds true while a dpc routine is executing: the related dpc object is
    either queued or not queued, and it can be queued at most once. The dpc
    routines related to a single dpc object can be executing with a concurrency
    of Np where Np is the number of processors.
    -----Original Message-----
    From: xxxxx@lists.osr.com
    [mailto:xxxxx@lists.osr.com] On Behalf Of Primoz Beltram
    Sent: Monday, October 15, 2001 6:10 AM
    To: NT Developers Interest List
    Subject: [ntdev] Number of processing DPC objects
    I didn’t find no explicit answer in books nor in electronic media, regarding
    the question I have.
  4. On a multiprocessor NT platform, each processor has its own DPC queue.
    Right?
  5. Then: On each(!) DPC queue, there can be only one pending DPC object.
    Right?
  6. Then: I can (theoretically) have NumOfProcessors*2 DPC objects in
    processing, (one in DPC_queue[processor] + one currently processing on
    processor)*NumOfProcessors.
    Right?
    Thanks in advance for any info.
    Wbr Primoz
    — You are currently subscribed to ntdev as: xxxxx@fvc.com To unsubscribe
    send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Primoz Beltram
e-mail: xxxxx@hermes.si
www: http://www.hermes.si http:
HERMES SoftLab, Office Nova Gorica
Erjavceva ul. 2, 5000 Nova Gorica, Slovenia
phone: (++386 5) 33 30 510, (++386 1) 58 65 710
fax: (++386 5) 33 32 656, (++386 1) 58 65 270
-----------------------------------------------

You are currently subscribed to ntdev as: xxxxx@hollistech.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@eicon.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</http:>

Perfectly agree to Mark. I have also used the plx9080 chip in the similar
fashion.

  • Vipul
    -----Original Message-----
    From: Roddy, Mark [mailto:xxxxx@stratus.com]
    Sent: Tuesday, October 16, 2001 9:57 AM
    To: NT Developers Interest List
    Subject: [ntdev] RE: Number of processing DPC objects

If you do as suggested by Evan and if your hardware has N independent IO
channels, then you are essentially serializing access to what would
otherwise be concurrent data paths. For example I have a plx9054 pci device
I fool around with at home. It has, at a minimum, two independent DMA
channels. Using the disable-in-isr enable-in-dpc approach achieves almost
exactly half the throughput of the deserialized dpc approach, up to some
level of saturation where either channel is able to consume all the
bandwidth by itself. (To be clearer, the effect is most noticeable where
small transfers are performed and DMA setup time is the dominant factor. For
large transfers the DMA transfer operation itself dominates and the setup
time and serialization is not terribly important.) I agree with Vipul that
the ISR ought to record the state, queue the dpc, and then re-enable the
next interrupt. Generally this is not a lot of extra processing in the ISR -
read some data, store it somewhere, and it allows for parallel performance
on MP platforms for your driver lower edge.
-----Original Message-----
From: Vipul Jain [mailto:xxxxx@fvc.com]
Sent: Tuesday, October 16, 2001 12:31 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

I agree.

But I think the right approach would be disable the interrupt from ISR - as
soon as you recognize the interrupt -, save the device register values in
some data structure (may be device extension), Queue the DPC and then enable
the interrupt once again.

  • Vipul
    -----Original Message-----
    From: Evan Lloyd [mailto:xxxxx@eicon.com]
    Sent: Tuesday, October 16, 2001 1:55 AM
    To: NT Developers Interest List
    Subject: [ntdev] RE: Number of processing DPC objects

Mark,
You may not recommend this approach but the NDIS spec does:
"MiniportISR must disable interrupts to ensure that when
MiniportHandleInterrupt runs, no information in the NIC will be overwritten
by a subsequent interrupt. ".
In fact, either you turn off interrupts in the ISR and do the processing in
the DPC, or you are obliged to move some of the event processing into the
ISR (to at least convince the card to remove the current IRQ).
From a system perspective it is much better to do the processing in the DPC.

Regards,
Evan
-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: 15 October 2001 15:49
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

In addition to the concurrency of your dpc routine (Np) it is important to
note that there is not a 1-1 relationship between IoRequestDpc and queued
dpc objects. That is to say, as a single dpc object can be queued at most
once, an attempt to queue a dpc object that is already queued will have no
effect. An invocation of a dpc routine can therefore represent 0…*
interrupt events. Zero, as some other invocation of your dpc routine may
have consumed the interrupt event that this invocation was triggered by, and
* as some unknown number of interrupt events may have occurred before this
invocation of the dpc routine started to execute (and an unknown number of
interrupt events may occur while the dpc routine executes.) I have seen more
than one driver that find this so annoying that they turn off interrupts
from their device before requesting a dpc, and turn interrupts back on at
the end of the dpc routine. I wouldn’t recommend this approach, but it is
not uncommon.
-----Original Message-----
From: Primoz Beltram [mailto:xxxxx@hermes.si]
Sent: Monday, October 15, 2001 10:29 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

With “only one pending DPC”, I meant “my drivers DPC object” (sorry for
inexactness). I know that there could be others drivers DPC objects in the
DPC queues. My interest is to clear how many “my drivers DPC objects” can be
in processing on a MP machine. So far it seams that point 3. is true.
Thanks.
Wbr Primoz

-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Monday, October 15, 2001 12:42 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

  1. correct.
  2. not sure what you meant here. Each processor dpc queue can have an
    unbounded number of dpc objects queued, but each dpc object can only be on
    one queue at a time. Easy to express in UML, not so easy to express in
    english.
  3. depends on what you meant by (2). Each dpc object can only be either
    queued or not-queued. So a single dpc object can be queued at most once.
    This holds true while a dpc routine is executing: the related dpc object is
    either queued or not queued, and it can be queued at most once. The dpc
    routines related to a single dpc object can be executing with a concurrency
    of Np where Np is the number of processors.
    -----Original Message-----
    From: xxxxx@lists.osr.com
    [mailto:xxxxx@lists.osr.com] On Behalf Of Primoz Beltram
    Sent: Monday, October 15, 2001 6:10 AM
    To: NT Developers Interest List
    Subject: [ntdev] Number of processing DPC objects
    I didn’t find no explicit answer in books nor in electronic media, regarding
    the question I have.
  4. On a multiprocessor NT platform, each processor has its own DPC queue.
    Right?
  5. Then: On each(!) DPC queue, there can be only one pending DPC object.
    Right?
  6. Then: I can (theoretically) have NumOfProcessors*2 DPC objects in
    processing, (one in DPC_queue[processor] + one currently processing on
    processor)*NumOfProcessors.
    Right?
    Thanks in advance for any info.
    Wbr Primoz
    — You are currently subscribed to ntdev as: xxxxx@fvc.com To unsubscribe
    send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Primoz Beltram
e-mail: xxxxx@hermes.si
www: http://www.hermes.si http:
HERMES SoftLab, Office Nova Gorica
Erjavceva ul. 2, 5000 Nova Gorica, Slovenia
phone: (++386 5) 33 30 510, (++386 1) 58 65 710
fax: (++386 5) 33 32 656, (++386 1) 58 65 270
-----------------------------------------------

You are currently subscribed to ntdev as: xxxxx@hollistech.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@eicon.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@fvc.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</http:>

MessageHaving worked with devices that queue “interrupt events”, and generate an interrupt on
each “interrupt event”, the disable-in-isr enable-in-dpc approach works well if the DPC drains
the “interrupt event” queue. In this way, you get to amortize the interrupt overhead across
multiple “interrupt events”.

Mark, if the DMA setup time is so critical, why do this in the DPC instead of the ISR?
(I guess I object to this philosophy that says you should do the least possible in the
ISR being carried to the extreme where you move time critical code out of the ISR to
a DPC, even if the overhead of that code is small compared to the ISR overhead.)

Also, in your example, I’m confused by your description. If the two DMA channels are
independent, but share an interrupt, and you have a single CPU, what’s the difference
between (ISR=>DPC=>sched DMA=>EnableInt Then ISR=>DPC->sched DMA)
and two independent DPCs that may be queued at the same time? Or were you failing to
check to see if the other DMA channel is ready in the DPC and servicing it before
enabling the interrupt?

With multiple CPUs, this whole question becomes more interesting. The APIC will
run the ISRs on different CPUs, which isn’t always a win, since each ISR has to
drag the dirty cache between the CPUs. I’ve found that locking an ISR (and therefore
the DPC) to a CPU using interrupt affinity often yields better performance than
letting interrupts randomly select the CPU.

-DH

----- Original Message -----
From: Roddy, Mark
To: NT Developers Interest List
Sent: Tuesday, October 16, 2001 12:56 PM
Subject: [ntdev] RE: Number of processing DPC objects

If you do as suggested by Evan and if your hardware has N independent IO channels, then you are essentially serializing access to what would otherwise be concurrent data paths. For example I have a plx9054 pci device I fool around with at home. It has, at a minimum, two independent DMA channels. Using the disable-in-isr enable-in-dpc approach achieves almost exactly half the throughput of the deserialized dpc approach, up to some level of saturation where either channel is able to consume all the bandwidth by itself. (To be clearer, the effect is most noticeable where small transfers are performed and DMA setup time is the dominant factor. For large transfers the DMA transfer operation itself dominates and the setup time and serialization is not terribly important.) I agree with Vipul that the ISR ought to record the state, queue the dpc, and then re-enable the next interrupt. Generally this is not a lot of extra processing in the ISR - read some data, store it somewhere, and it allows for parallel performance on MP platforms for your driver lower edge.
-----Original Message-----
From: Vipul Jain [mailto:xxxxx@fvc.com]
Sent: Tuesday, October 16, 2001 12:31 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

I agree.

But I think the right approach would be disable the interrupt from ISR - as soon as you recognize the interrupt -, save the device register values in some data structure (may be device extension), Queue the DPC and then enable the interrupt once again.

  • Vipul
    -----Original Message-----
    From: Evan Lloyd [mailto:xxxxx@eicon.com]
    Sent: Tuesday, October 16, 2001 1:55 AM
    To: NT Developers Interest List
    Subject: [ntdev] RE: Number of processing DPC objects

Mark,
You may not recommend this approach but the NDIS spec does:
"MiniportISR must disable interrupts to ensure that when MiniportHandleInterrupt runs, no information in the NIC will be overwritten by a subsequent interrupt. ".
In fact, either you turn off interrupts in the ISR and do the processing in the DPC, or you are obliged to move some of the event processing into the ISR (to at least convince the card to remove the current IRQ).
From a system perspective it is much better to do the processing in the DPC.

Regards,
Evan
-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: 15 October 2001 15:49
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

In addition to the concurrency of your dpc routine (Np) it is important to note that there is not a 1-1 relationship between IoRequestDpc and queued dpc objects. That is to say, as a single dpc object can be queued at most once, an attempt to queue a dpc object that is already queued will have no effect. An invocation of a dpc routine can therefore represent 0…* interrupt events. Zero, as some other invocation of your dpc routine may have consumed the interrupt event that this invocation was triggered by, and * as some unknown number of interrupt events may have occurred before this invocation of the dpc routine started to execute (and an unknown number of interrupt events may occur while the dpc routine executes.) I have seen more than one driver that find this so annoying that they turn off interrupts from their device before requesting a dpc, and turn interrupts back on at the end of the dpc routine. I wouldn’t recommend this approach, but it is not uncommon.
-----Original Message-----
From: Primoz Beltram [mailto:xxxxx@hermes.si]
Sent: Monday, October 15, 2001 10:29 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

With “only one pending DPC”, I meant “my drivers DPC object” (sorry for inexactness). I know that there could be others drivers DPC objects in the DPC queues. My interest is to clear how many “my drivers DPC objects” can be in processing on a MP machine. So far it seams that point 3. is true. Thanks.

Wbr Primoz

-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Monday, October 15, 2001 12:42 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

  1. correct.

  2. not sure what you meant here. Each processor dpc queue can have an unbounded number of dpc objects queued, but each dpc object can only be on one queue at a time. Easy to express in UML, not so easy to express in english.

  3. depends on what you meant by (2). Each dpc object can only be either queued or not-queued. So a single dpc object can be queued at most once. This holds true while a dpc routine is executing: the related dpc object is either queued or not queued, and it can be queued at most once. The dpc routines related to a single dpc object can be executing with a concurrency of Np where Np is the number of processors.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Primoz Beltram
Sent: Monday, October 15, 2001 6:10 AM
To: NT Developers Interest List
Subject: [ntdev] Number of processing DPC objects

I didn’t find no explicit answer in books nor in electronic media, regarding the question I have.

  1. On a multiprocessor NT platform, each processor has its own DPC queue. Right?

  2. Then: On each(!) DPC queue, there can be only one pending DPC object. Right?

  3. Then: I can (theoretically) have NumOfProcessors*2 DPC objects in processing, (one in DPC_queue[processor] + one currently processing on processor)*NumOfProcessors.

Right?

Thanks in advance for any info.

Wbr Primoz

— You are currently subscribed to ntdev as: xxxxx@fvc.com To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com -----------------------------------------------

Primoz Beltram

e-mail: xxxxx@hermes.si

www: http://www.hermes.si

HERMES SoftLab, Office Nova Gorica

Erjavceva ul. 2, 5000 Nova Gorica, Slovenia

phone: (++386 5) 33 30 510, (++386 1) 58 65 710

fax: (++386 5) 33 32 656, (++386 1) 58 65 270



You are currently subscribed to ntdev as: xxxxx@hollistech.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@eicon.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@syssoftsol.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

I don’t understand the intention here.? Why "save the device register values
"?
The device already has convenient registers that store the state.

  1. In the? ISR disable interrupts from the device and queue your DPC.
    ??? (No need to mess with anything else.)
  2. In the DPC, service all outstanding requests (on all active channels!)
  3. When no further attention requests active on the device, enable
    interrupts.
    ?
    There is no?serialisation effect, because all outstanding events are
    serviced
    before device interrupts are enabled again.? You also reduce interrupt
    service
    overhead?by sometimes catching requests from several channels with one IRQ.
    ?
    From this design perspective (which I take to be Microsoft’s) then the only
    problem would be a device that does not allow you to disable the interrupt
    without other state changes -?dismally poor?Hardware design!
    ?
    Using this approach with an IBM SSA PCI card, I got over 3000 disk
    accesses per second, and 100 Mega-bytes per second data rate.
    (i.e. as much as the hardware/OS limits would allow in 1998).
    This card used a plx series PCI interface which was probably a 9054,
    although I can’t be certain at this remove.
    -----Original Message-----
    From: Roddy, Mark [mailto:xxxxx@stratus.com]
    Sent: 16 October 2001 17:57
    To: NT Developers Interest List
    Subject: [ntdev] RE: Number of processing DPC objects

If you do as suggested by Evan and if your hardware has N independent IO
channels, then you are essentially serializing access to what would
otherwise be concurrent data paths. For example I have a plx9054 pci device
I fool around with at home. It has, at a minimum, two independent DMA
channels. Using the disable-in-isr enable-in-dpc approach achieves almost
exactly half the throughput of the deserialized dpc approach, up to some
level of saturation where either channel is able to consume all the
bandwidth by itself. (To be clearer, the effect is most noticeable where
small transfers are performed and DMA setup time is the dominant factor. For
large transfers the DMA transfer operation itself dominates and the setup
time and serialization is not terribly important.)? I agree with Vipul that
the ISR ought to record the state, queue the dpc, and then re-enable the
next interrupt. Generally this is not a lot of extra processing in the ISR -
read some data, store it somewhere, and it allows for parallel performance
on MP platforms for your driver lower edge.
-----Original Message-----
From: Vipul Jain [mailto:xxxxx@fvc.com]
Sent: Tuesday, October 16, 2001 12:31 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

I agree.
?
But I think the right approach would be disable the interrupt from ISR - as
soon as you recognize the interrupt -, save the device register values in
some data structure (may be device extension), Queue the DPC and then enable
the interrupt once again.
?

  • Vipul
    -----Original Message-----
    From: Evan Lloyd [mailto:xxxxx@eicon.com]
    Sent: Tuesday, October 16, 2001 1:55 AM
    To: NT Developers Interest List
    Subject: [ntdev] RE: Number of processing DPC objects

Mark,
??? You may not recommend this approach but the NDIS spec does:
"MiniportISR must disable interrupts to ensure that when
MiniportHandleInterrupt runs, no information in the NIC will be overwritten
by a subsequent interrupt. ".?
In fact, either you turn off interrupts in the ISR and do the processing in
the DPC, or you?are obliged to?move some of the event?processing into the
ISR (to at least convince the card to remove the current IRQ).
From a system perspective it is much better to do the processing in the DPC.
?
Regards,
Evan
-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: 15 October 2001 15:49
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

In addition to the concurrency of your dpc routine (Np) it is important to
note that there is not a 1-1 relationship between IoRequestDpc and queued
dpc objects. That is to say, as a single dpc object can be queued at most
once, an attempt to queue a dpc object that is already queued will have no
effect. An invocation of a dpc routine can therefore represent 0…*
interrupt events. Zero, as some other invocation of your dpc routine may
have consumed the interrupt event that this invocation was triggered by, and
* as some unknown number of interrupt events may have occurred before this
invocation of the dpc routine started to execute (and an unknown number of
interrupt events may occur while the dpc routine executes.) I have seen more
than one driver that find this so annoying that they turn off interrupts
from their device before requesting a dpc, and turn interrupts back on at
the end of the dpc routine. I wouldn’t recommend this approach, but it is
not uncommon.
-----Original Message-----
From: Primoz Beltram [mailto:xxxxx@hermes.si]
Sent: Monday, October 15, 2001 10:29 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

With “only one pending DPC”, I meant “my drivers DPC object” (sorry for
inexactness). I know that there could be others drivers DPC objects in the
DPC queues. My interest is to clear how many “my drivers DPC objects” can be
in processing on a MP machine. So far it seams that point 3. is true.
Thanks.
Wbr Primoz
?
-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Monday, October 15, 2001 12:42 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects
?

  1. correct.
  2. not sure what you meant here. Each processor dpc queue can have an
    unbounded number of dpc objects queued, but each dpc object can only be on
    one queue at a time. Easy to express in UML, not so easy to express in
    english.
  3. depends on what you meant by (2). Each dpc object can only be either
    queued or not-queued. So a single dpc object can be queued at most once.
    This holds true while a dpc routine is executing: the related dpc object is
    either queued or not queued, and it can be queued at most once. The dpc
    routines related to a single dpc object can be executing with a concurrency
    of Np where Np is the number of processors.
    -----Original Message-----
    From: xxxxx@lists.osr.com
    [mailto:xxxxx@lists.osr.com] On Behalf Of Primoz Beltram
    Sent: Monday, October 15, 2001 6:10 AM
    To: NT Developers Interest List
    Subject: [ntdev] Number of processing DPC objects
    I didn’t find no explicit answer in books nor in electronic media, regarding
    the question I have.
  4. On a multiprocessor NT platform, each processor has its own DPC queue.
    Right?
  5. Then: On each(!) DPC queue, there can be only one pending DPC object.
    Right?
  6. Then: I can (theoretically) have NumOfProcessors*2 DPC objects in
    processing, (one in DPC_queue[processor] + one currently processing on
    processor)*NumOfProcessors.
    Right?
    Thanks in advance for any info.
    Wbr Primoz
    — You are currently subscribed to ntdev as: xxxxx@fvc.com To unsubscribe
    send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


Primoz Beltram
e-mail: xxxxx@hermes.si
www: http://www.hermes.si
HERMES SoftLab, Office Nova Gorica
Erjavceva ul. 2, 5000 Nova Gorica, Slovenia
phone: (++386 5) 33 30 510, (++386 1) 58 65 710
fax:?? (++386 5) 33 32 656, (++386 1) 58 65 270


You are currently subscribed to ntdev as: xxxxx@hollistech.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@eicon.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@eicon.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Register values may have to be saved depending on the hardware. But I agree
that in many cases nothing needs to be done. I still insist that there is a
serialization effect if I can have two processors concurrently performing
DMA setups my way, while you can only serialize DMA setups. However Dave
Harvey insists that this effect is minimal and overridden by cache conflict
issues. He is probably right. The testing I did used a plx9054 with two
fully independent DMA channels. I used two DPC objects and thus essentially
I had two separate virtual devices that happened to share an interrupt and
an interrupt status register, but little else. The measurements I gathered
indicated that when the devices were transferring small packets - e.g.
network sized packets of 1-4k, things were much faster decoupled on two
processors rather than serialized on one. For large transfers - e.g. disk
sized packets it made no difference.
-----Original Message-----
From: Evan Lloyd [mailto:xxxxx@eicon.com]
Sent: Wednesday, October 17, 2001 6:02 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

I don’t understand the intention here. Why "save the device register values
"?
The device already has convenient registers that store the state.

  1. In the ISR disable interrupts from the device and queue your DPC.
    (No need to mess with anything else.)
  2. In the DPC, service all outstanding requests (on all active channels!)
  3. When no further attention requests active on the device, enable
    interrupts.

There is no serialisation effect, because all outstanding events are
serviced
before device interrupts are enabled again. You also reduce interrupt
service
overhead by sometimes catching requests from several channels with one IRQ.

From this design perspective (which I take to be Microsoft’s) then the only
problem would be a device that does not allow you to disable the interrupt
without other state changes - dismally poor Hardware design!

Using this approach with an IBM SSA PCI card, I got over 3000 disk
accesses per second, and 100 Mega-bytes per second data rate.
(i.e. as much as the hardware/OS limits would allow in 1998).
This card used a plx series PCI interface which was probably a 9054,
although I can’t be certain at this remove.
-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: 16 October 2001 17:57
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

If you do as suggested by Evan and if your hardware has N independent IO
channels, then you are essentially serializing access to what would
otherwise be concurrent data paths. For example I have a plx9054 pci device
I fool around with at home. It has, at a minimum, two independent DMA
channels. Using the disable-in-isr enable-in-dpc approach achieves almost
exactly half the throughput of the deserialized dpc approach, up to some
level of saturation where either channel is able to consume all the
bandwidth by itself. (To be clearer, the effect is most noticeable where
small transfers are performed and DMA setup time is the dominant factor. For
large transfers the DMA transfer operation itself dominates and the setup
time and serialization is not terribly important.) I agree with Vipul that
the ISR ought to record the state, queue the dpc, and then re-enable the
next interrupt. Generally this is not a lot of extra processing in the ISR -
read some data, store it somewhere, and it allows for parallel performance
on MP platforms for your driver lower edge.
-----Original Message-----
From: Vipul Jain [mailto:xxxxx@fvc.com]
Sent: Tuesday, October 16, 2001 12:31 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

I agree.

But I think the right approach would be disable the interrupt from ISR - as
soon as you recognize the interrupt -, save the device register values in
some data structure (may be device extension), Queue the DPC and then enable
the interrupt once again.

  • Vipul
    -----Original Message-----
    From: Evan Lloyd [mailto:xxxxx@eicon.com]
    Sent: Tuesday, October 16, 2001 1:55 AM
    To: NT Developers Interest List
    Subject: [ntdev] RE: Number of processing DPC objects

Mark,
You may not recommend this approach but the NDIS spec does:
"MiniportISR must disable interrupts to ensure that when
MiniportHandleInterrupt runs, no information in the NIC will be overwritten
by a subsequent interrupt. ".
In fact, either you turn off interrupts in the ISR and do the processing in
the DPC, or you are obliged to move some of the event processing into the
ISR (to at least convince the card to remove the current IRQ).
From a system perspective it is much better to do the processing in the DPC.

Regards,
Evan
-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: 15 October 2001 15:49
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

In addition to the concurrency of your dpc routine (Np) it is important to
note that there is not a 1-1 relationship between IoRequestDpc and queued
dpc objects. That is to say, as a single dpc object can be queued at most
once, an attempt to queue a dpc object that is already queued will have no
effect. An invocation of a dpc routine can therefore represent 0…*
interrupt events. Zero, as some other invocation of your dpc routine may
have consumed the interrupt event that this invocation was triggered by, and
* as some unknown number of interrupt events may have occurred before this
invocation of the dpc routine started to execute (and an unknown number of
interrupt events may occur while the dpc routine executes.) I have seen more
than one driver that find this so annoying that they turn off interrupts
from their device before requesting a dpc, and turn interrupts back on at
the end of the dpc routine. I wouldn’t recommend this approach, but it is
not uncommon.
-----Original Message-----
From: Primoz Beltram [mailto:xxxxx@hermes.si]
Sent: Monday, October 15, 2001 10:29 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

With “only one pending DPC”, I meant “my drivers DPC object” (sorry for
inexactness). I know that there could be others drivers DPC objects in the
DPC queues. My interest is to clear how many “my drivers DPC objects” can be
in processing on a MP machine. So far it seams that point 3. is true.
Thanks.
Wbr Primoz

-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Monday, October 15, 2001 12:42 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

  1. correct.
  2. not sure what you meant here. Each processor dpc queue can have an
    unbounded number of dpc objects queued, but each dpc object can only be on
    one queue at a time. Easy to express in UML, not so easy to express in
    english.
  3. depends on what you meant by (2). Each dpc object can only be either
    queued or not-queued. So a single dpc object can be queued at most once.
    This holds true while a dpc routine is executing: the related dpc object is
    either queued or not queued, and it can be queued at most once. The dpc
    routines related to a single dpc object can be executing with a concurrency
    of Np where Np is the number of processors.
    -----Original Message-----
    From: xxxxx@lists.osr.com
    [mailto:xxxxx@lists.osr.com] On Behalf Of Primoz Beltram
    Sent: Monday, October 15, 2001 6:10 AM
    To: NT Developers Interest List
    Subject: [ntdev] Number of processing DPC objects
    I didn’t find no explicit answer in books nor in electronic media, regarding
    the question I have.
  4. On a multiprocessor NT platform, each processor has its own DPC queue.
    Right?
  5. Then: On each(!) DPC queue, there can be only one pending DPC object.
    Right?
  6. Then: I can (theoretically) have NumOfProcessors*2 DPC objects in
    processing, (one in DPC_queue[processor] + one currently processing on
    processor)*NumOfProcessors.
    Right?
    Thanks in advance for any info.
    Wbr Primoz
    — You are currently subscribed to ntdev as: xxxxx@fvc.com To unsubscribe
    send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com — You are currently
    subscribed to ntdev as: xxxxx@stratus.com To unsubscribe send a blank
    email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Primoz Beltram
e-mail: xxxxx@hermes.si
www: http://www.hermes.si http:
HERMES SoftLab, Office Nova Gorica
Erjavceva ul. 2, 5000 Nova Gorica, Slovenia
phone: (++386 5) 33 30 510, (++386 1) 58 65 710
fax: (++386 5) 33 32 656, (++386 1) 58 65 270
-----------------------------------------------

You are currently subscribed to ntdev as: xxxxx@hollistech.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@eicon.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@eicon.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</http:>

MessageA good way:

  • have an “interrupt cause flags” variable in the device extension.
  • in your ISR, read the interrupt status from the device to this variable, then queue a DPC.
  • write a SynchronizeExecution callback which will copy the variable to the location specified as a parameter, then zero the variable.
  • your DPC must be (conceptually):
    {
    for(;:wink:
    {
    ULONG InterruptCause;
    KeSynchronizeExecution(YourCallback, &InterruptCause);
    if( InterruptCause == 0 )
    break;
    // Parse nonzero InterruptCause and service each cause separately here

    }
    }

This will work fine on SMP, even in the case if the same DPC is scheduled to several CPUs and if the ISR will interrupt the DPC itself.
This does not require the hardware ability of disabling interrupts.

Max

----- Original Message -----
From: Evan Lloyd
To: NT Developers Interest List
Sent: Wednesday, October 17, 2001 2:02 PM
Subject: [ntdev] RE: Number of processing DPC objects

I don’t understand the intention here. Why "save the device register values "?
The device already has convenient registers that store the state.

  1. In the ISR disable interrupts from the device and queue your DPC.
    (No need to mess with anything else.)
  2. In the DPC, service all outstanding requests (on all active channels!)
  3. When no further attention requests active on the device, enable interrupts.

There is no serialisation effect, because all outstanding events are serviced
before device interrupts are enabled again. You also reduce interrupt service
overhead by sometimes catching requests from several channels with one IRQ.

From this design perspective (which I take to be Microsoft’s) then the only
problem would be a device that does not allow you to disable the interrupt
without other state changes - dismally poor Hardware design!

Using this approach with an IBM SSA PCI card, I got over 3000 disk
accesses per second, and 100 Mega-bytes per second data rate.
(i.e. as much as the hardware/OS limits would allow in 1998).
This card used a plx series PCI interface which was probably a 9054,
although I can’t be certain at this remove.
-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: 16 October 2001 17:57
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

If you do as suggested by Evan and if your hardware has N independent IO channels, then you are essentially serializing access to what would otherwise be concurrent data paths. For example I have a plx9054 pci device I fool around with at home. It has, at a minimum, two independent DMA channels. Using the disable-in-isr enable-in-dpc approach achieves almost exactly half the throughput of the deserialized dpc approach, up to some level of saturation where either channel is able to consume all the bandwidth by itself. (To be clearer, the effect is most noticeable where small transfers are performed and DMA setup time is the dominant factor. For large transfers the DMA transfer operation itself dominates and the setup time and serialization is not terribly important.) I agree with Vipul that the ISR ought to record the state, queue the dpc, and then re-enable the next interrupt. Generally this is not a lot of extra processing in the ISR - read some data, store it somewhere, and it allows for parallel performance on MP platforms for your driver lower edge.
-----Original Message-----
From: Vipul Jain [mailto:xxxxx@fvc.com]
Sent: Tuesday, October 16, 2001 12:31 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

I agree.

But I think the right approach would be disable the interrupt from ISR - as soon as you recognize the interrupt -, save the device register values in some data structure (may be device extension), Queue the DPC and then enable the interrupt once again.

  • Vipul
    -----Original Message-----
    From: Evan Lloyd [mailto:xxxxx@eicon.com]
    Sent: Tuesday, October 16, 2001 1:55 AM
    To: NT Developers Interest List
    Subject: [ntdev] RE: Number of processing DPC objects

Mark,
You may not recommend this approach but the NDIS spec does:
"MiniportISR must disable interrupts to ensure that when MiniportHandleInterrupt runs, no information in the NIC will be overwritten by a subsequent interrupt. ".
In fact, either you turn off interrupts in the ISR and do the processing in the DPC, or you are obliged to move some of the event processing into the ISR (to at least convince the card to remove the current IRQ).
From a system perspective it is much better to do the processing in the DPC.

Regards,
Evan
-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: 15 October 2001 15:49
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

In addition to the concurrency of your dpc routine (Np) it is important to note that there is not a 1-1 relationship between IoRequestDpc and queued dpc objects. That is to say, as a single dpc object can be queued at most once, an attempt to queue a dpc object that is already queued will have no effect. An invocation of a dpc routine can therefore represent 0…* interrupt events. Zero, as some other invocation of your dpc routine may have consumed the interrupt event that this invocation was triggered by, and * as some unknown number of interrupt events may have occurred before this invocation of the dpc routine started to execute (and an unknown number of interrupt events may occur while the dpc routine executes.) I have seen more than one driver that find this so annoying that they turn off interrupts from their device before requesting a dpc, and turn interrupts back on at the end of the dpc routine. I wouldn’t recommend this approach, but it is not uncommon.
-----Original Message-----
From: Primoz Beltram [mailto:xxxxx@hermes.si]
Sent: Monday, October 15, 2001 10:29 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

With “only one pending DPC”, I meant “my drivers DPC object” (sorry for inexactness). I know that there could be others drivers DPC objects in the DPC queues. My interest is to clear how many “my drivers DPC objects” can be in processing on a MP machine. So far it seams that point 3. is true. Thanks.

Wbr Primoz

-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Monday, October 15, 2001 12:42 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

  1. correct.

  2. not sure what you meant here. Each processor dpc queue can have an unbounded number of dpc objects queued, but each dpc object can only be on one queue at a time. Easy to express in UML, not so easy to express in english.

  3. depends on what you meant by (2). Each dpc object can only be either queued or not-queued. So a single dpc object can be queued at most once. This holds true while a dpc routine is executing: the related dpc object is either queued or not queued, and it can be queued at most once. The dpc routines related to a single dpc object can be executing with a concurrency of Np where Np is the number of processors.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Primoz Beltram
Sent: Monday, October 15, 2001 6:10 AM
To: NT Developers Interest List
Subject: [ntdev] Number of processing DPC objects

I didn’t find no explicit answer in books nor in electronic media, regarding the question I have.

  1. On a multiprocessor NT platform, each processor has its own DPC queue. Right?

  2. Then: On each(!) DPC queue, there can be only one pending DPC object. Right?

  3. Then: I can (theoretically) have NumOfProcessors*2 DPC objects in processing, (one in DPC_queue[processor] + one currently processing on processor)*NumOfProcessors.

Right?

Thanks in advance for any info.

Wbr Primoz

— You are currently subscribed to ntdev as: xxxxx@fvc.com To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com — You are currently subscribed to ntdev as: xxxxx@storagecraft.com To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com -----------------------------------------------

Primoz Beltram

e-mail: xxxxx@hermes.si

www: http://www.hermes.si

HERMES SoftLab, Office Nova Gorica

Erjavceva ul. 2, 5000 Nova Gorica, Slovenia

phone: (++386 5) 33 30 510, (++386 1) 58 65 710

fax: (++386 5) 33 32 656, (++386 1) 58 65 270



You are currently subscribed to ntdev as: xxxxx@hollistech.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@eicon.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@eicon.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

I don’t have much recent experience with this, but if a DPC will drain the
interrupt queue, the ISR itself can just table the interrupt and ready the
hardware for another interrupt, right ? All the ISR has to do is to queue
the interrupts, and the DPC will drain the queue when it gets dispatched.
No need to disable-in-isr, unless your hardware has special needs; here I
tend to agree with Mark, it may be a long time between the disable-in-isr
and the enable-in-dpc, you may lose more peripheral bandwidth than you’re
willing to. I like to look at ISRs as hardware handlers, and DPC as OS
babysitters - the ISR is short and sweet, gets enough information to get
going and resets the hardware for the next one, while the DPC picks up what
the ISR enqueued and passes it up to the OS at the speed the OS is willing
to take it.

This reminds me of the Sperry DCP, it had a central processor and multiple
peripheral processors. The peripheral processors would handle all
interrupts, and the pp program would enqueue the request into a hardware
queue in shared memory. That queue would have been previously “armed” so
that a new request into the queue would cause a “software attention item” to
be enqueued into yet another queue, typically, an OS dispatch queue. So, The
pp enqueuing an interrupt item would automatically schedule the
corresponding dpc, all by hardware. The dpc, when dispatched, would empty
the interrupt queue and pass each item up to the OS. In between the time the
first interrupt arived and the time the dpc got activated, other interrupts
could come down that same queue, the pp would handle the hardware
transparent to the dpc and to the os. I remember that when the Sperry
Monitor product was developed, the real-time executive’s dispatcher loop had
precisely 15 machine instructions.

But they don’t make them like that anymore. :slight_smile:

Another thing: if DMA setup is so critical, how about a common-buffer
strategy ? You may be able to keep a single DMA transaction alive for a long
time, switching buffers if necessary. In our ICD, for example, we had three
or more DMA buffers, sometimes in high throughput conditions we’d have as
much as 32Mb or more worth of active DMA buffering between our OpenGL
renderer and the graphics chip. Also, with the Pentium SIMD extensions,
moving data can be done quite fast, so even if you have to shuffle data
buffers around, it may still be a feasible proposition.

Alberto.

-----Original Message-----
From: Dave Harvey [mailto:xxxxx@syssoftsol.com]
Sent: Tuesday, October 16, 2001 10:32 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

Having worked with devices that queue “interrupt events”, and generate an
interrupt on
each “interrupt event”, the disable-in-isr enable-in-dpc approach works well
if the DPC drains
the “interrupt event” queue. In this way, you get to amortize the interrupt
overhead across
multiple “interrupt events”.

Mark, if the DMA setup time is so critical, why do this in the DPC instead
of the ISR?
(I guess I object to this philosophy that says you should do the least
possible in the
ISR being carried to the extreme where you move time critical code out of
the ISR to
a DPC, even if the overhead of that code is small compared to the ISR
overhead.)

Also, in your example, I’m confused by your description. If the two DMA
channels are
independent, but share an interrupt, and you have a single CPU, what’s the
difference
between (ISR=>DPC=>sched DMA=>EnableInt Then ISR=>DPC->sched DMA)
and two independent DPCs that may be queued at the same time? Or were you
failing to
check to see if the other DMA channel is ready in the DPC and servicing it
before
enabling the interrupt?

With multiple CPUs, this whole question becomes more interesting. The APIC
will
run the ISRs on different CPUs, which isn’t always a win, since each ISR has
to
drag the dirty cache between the CPUs. I’ve found that locking an ISR (and
therefore
the DPC) to a CPU using interrupt affinity often yields better performance
than
letting interrupts randomly select the CPU.

-DH

----- Original Message -----
From: Roddy, mailto:xxxxx Mark
To: NT Developers mailto:xxxxx Interest List
Sent: Tuesday, October 16, 2001 12:56 PM
Subject: [ntdev] RE: Number of processing DPC objects

If you do as suggested by Evan and if your hardware has N independent IO
channels, then you are essentially serializing access to what would
otherwise be concurrent data paths. For example I have a plx9054 pci device
I fool around with at home. It has, at a minimum, two independent DMA
channels. Using the disable-in-isr enable-in-dpc approach achieves almost
exactly half the throughput of the deserialized dpc approach, up to some
level of saturation where either channel is able to consume all the
bandwidth by itself. (To be clearer, the effect is most noticeable where
small transfers are performed and DMA setup time is the dominant factor. For
large transfers the DMA transfer operation itself dominates and the setup
time and serialization is not terribly important.) I agree with Vipul that
the ISR ought to record the state, queue the dpc, and then re-enable the
next interrupt. Generally this is not a lot of extra processing in the ISR -
read some data, store it somewhere, and it allows for parallel performance
on MP platforms for your driver lower edge.
-----Original Message-----
From: Vipul Jain [mailto:xxxxx@fvc.com]
Sent: Tuesday, October 16, 2001 12:31 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

I agree.

But I think the right approach would be disable the interrupt from ISR - as
soon as you recognize the interrupt -, save the device register values in
some data structure (may be device extension), Queue the DPC and then enable
the interrupt once again.

- Vipul
-----Original Message-----
From: Evan Lloyd [mailto:xxxxx@eicon.com]
Sent: Tuesday, October 16, 2001 1:55 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

Mark,
You may not recommend this approach but the NDIS spec does:
"MiniportISR must disable interrupts to ensure that when
MiniportHandleInterrupt runs, no information in the NIC will be overwritten
by a subsequent interrupt. ".
In fact, either you turn off interrupts in the ISR and do the processing in
the DPC, or you are obliged to move some of the event processing into the
ISR (to at least convince the card to remove the current IRQ).
From a system perspective it is much better to do the processing in the DPC.

Regards,
Evan
-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: 15 October 2001 15:49
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

In addition to the concurrency of your dpc routine (Np) it is important to
note that there is not a 1-1 relationship between IoRequestDpc and queued
dpc objects. That is to say, as a single dpc object can be queued at most
once, an attempt to queue a dpc object that is already queued will have no
effect. An invocation of a dpc routine can therefore represent 0…
interrupt events. Zero, as some other invocation of your dpc routine may
have consumed the interrupt event that this invocation was triggered by, and
as some unknown number of interrupt events may have occurred before this
invocation of the dpc routine started to execute (and an unknown number of
interrupt events may occur while the dpc routine executes.) I have seen more
than one driver that find this so annoying that they turn off interrupts
from their device before requesting a dpc, and turn interrupts back on at
the end of the dpc routine. I wouldn’t recommend this approach, but it is
not uncommon.
-----Original Message-----
From: Primoz Beltram [mailto:xxxxx@hermes.si]
Sent: Monday, October 15, 2001 10:29 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

With “only one pending DPC”, I meant “my drivers DPC object” (sorry for
inexactness). I know that there could be others drivers DPC objects in the
DPC queues. My interest is to clear how many “my drivers DPC objects” can be
in processing on a MP machine. So far it seams that point 3. is true.
Thanks.
Wbr Primoz

-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Monday, October 15, 2001 12:42 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

1. correct.
2. not sure what you meant here. Each processor dpc queue can have an
unbounded number of dpc objects queued, but each dpc object can only be on
one queue at a time. Easy to express in UML, not so easy to express in
english.
3. depends on what you meant by (2). Each dpc object can only be either
queued or not-queued. So a single dpc object can be queued at most once.
This holds true while a dpc routine is executing: the related dpc object is
either queued or not queued, and it can be queued at most once. The dpc
routines related to a single dpc object can be executing with a concurrency
of Np where Np is the number of processors.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Primoz Beltram
Sent: Monday, October 15, 2001 6:10 AM
To: NT Developers Interest List
Subject: [ntdev] Number of processing DPC objects
I didn’t find no explicit answer in books nor in electronic media, regarding
the question I have.
1. On a multiprocessor NT platform, each processor has its own DPC queue.
Right?
2. Then: On each(!) DPC queue, there can be only one pending DPC object.
Right?
3. Then: I can (theoretically) have NumOfProcessors*2 DPC objects in
processing, (one in DPC_queue[processor] + one currently processing on
processor)*NumOfProcessors.
Right?
Thanks in advance for any info.
Wbr Primoz
— You are currently subscribed to ntdev as: xxxxx@fvc.com To unsubscribe
send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
-----------------------------------------------
Primoz Beltram
e-mail: xxxxx@hermes.si
www: http://www.hermes.si http:
HERMES SoftLab, Office Nova Gorica
Erjavceva ul. 2, 5000 Nova Gorica, Slovenia
phone: (++386 5) 33 30 510, (++386 1) 58 65 710
fax: (++386 5) 33 32 656, (++386 1) 58 65 270
-----------------------------------------------

You are currently subscribed to ntdev as: xxxxx@hollistech.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@eicon.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@syssoftsol.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</http:></mailto:xxxxx></mailto:xxxxx>

Message
----- Original Message -----
From: Roddy, Mark
To: NT Developers Interest List
Sent: Wednesday, October 17, 2001 9:18 AM
Subject: [ntdev] RE: Number of processing DPC objects

Register values may have to be saved depending on the hardware. But I agree that in many cases nothing needs to be done. I still insist that there is a serialization effect if I can have two processors concurrently performing DMA setups my way, while you can only serialize DMA setups. However Dave Harvey insists that this effect is minimal and overridden by cache conflict issues. He is probably right. The testing I did used a plx9054 with two fully independent DMA channels. I used two DPC objects and thus essentially I had two separate virtual devices that happened to share an interrupt and an interrupt status register, but little else. The measurements I gathered indicated that when the devices were transferring small packets - e.g. network sized packets of 1-4k, things were much faster decoupled on two processors rather than serialized on one. For large transfers - e.g. disk sized packets it made no difference.
What you really wanted here is to have a different interrupt for each channel, and have each channel have an affinity to one CPU.
-DH
-----Original Message-----
From: Evan Lloyd [mailto:xxxxx@eicon.com]
Sent: Wednesday, October 17, 2001 6:02 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

I don’t understand the intention here. Why "save the device register values "?
The device already has convenient registers that store the state.

  1. In the ISR disable interrupts from the device and queue your DPC.
    (No need to mess with anything else.)
  2. In the DPC, service all outstanding requests (on all active channels!)
  3. When no further attention requests active on the device, enable interrupts.

There is no serialisation effect, because all outstanding events are serviced
before device interrupts are enabled again. You also reduce interrupt service
overhead by sometimes catching requests from several channels with one IRQ.

From this design perspective (which I take to be Microsoft’s) then the only
problem would be a device that does not allow you to disable the interrupt
without other state changes - dismally poor Hardware design!

Using this approach with an IBM SSA PCI card, I got over 3000 disk
accesses per second, and 100 Mega-bytes per second data rate.
(i.e. as much as the hardware/OS limits would allow in 1998).
This card used a plx series PCI interface which was probably a 9054,
although I can’t be certain at this remove.
-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: 16 October 2001 17:57
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

If you do as suggested by Evan and if your hardware has N independent IO channels, then you are essentially serializing access to what would otherwise be concurrent data paths. For example I have a plx9054 pci device I fool around with at home. It has, at a minimum, two independent DMA channels. Using the disable-in-isr enable-in-dpc approach achieves almost exactly half the throughput of the deserialized dpc approach, up to some level of saturation where either channel is able to consume all the bandwidth by itself. (To be clearer, the effect is most noticeable where small transfers are performed and DMA setup time is the dominant factor. For large transfers the DMA transfer operation itself dominates and the setup time and serialization is not terribly important.) I agree with Vipul that the ISR ought to record the state, queue the dpc, and then re-enable the next interrupt. Generally this is not a lot of extra processing in the ISR - read some data, store it somewhere, and it allows for parallel performance on MP platforms for your driver lower edge.
-----Original Message-----
From: Vipul Jain [mailto:xxxxx@fvc.com]
Sent: Tuesday, October 16, 2001 12:31 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

I agree.

But I think the right approach would be disable the interrupt from ISR - as soon as you recognize the interrupt -, save the device register values in some data structure (may be device extension), Queue the DPC and then enable the interrupt once again.

  • Vipul
    -----Original Message-----
    From: Evan Lloyd [mailto:xxxxx@eicon.com]
    Sent: Tuesday, October 16, 2001 1:55 AM
    To: NT Developers Interest List
    Subject: [ntdev] RE: Number of processing DPC objects

Mark,
You may not recommend this approach but the NDIS spec does:
"MiniportISR must disable interrupts to ensure that when MiniportHandleInterrupt runs, no information in the NIC will be overwritten by a subsequent interrupt. ".
In fact, either you turn off interrupts in the ISR and do the processing in the DPC, or you are obliged to move some of the event processing into the ISR (to at least convince the card to remove the current IRQ).
From a system perspective it is much better to do the processing in the DPC.

Regards,
Evan
-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: 15 October 2001 15:49
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

In addition to the concurrency of your dpc routine (Np) it is important to note that there is not a 1-1 relationship between IoRequestDpc and queued dpc objects. That is to say, as a single dpc object can be queued at most once, an attempt to queue a dpc object that is already queued will have no effect. An invocation of a dpc routine can therefore represent 0…* interrupt events. Zero, as some other invocation of your dpc routine may have consumed the interrupt event that this invocation was triggered by, and * as some unknown number of interrupt events may have occurred before this invocation of the dpc routine started to execute (and an unknown number of interrupt events may occur while the dpc routine executes.) I have seen more than one driver that find this so annoying that they turn off interrupts from their device before requesting a dpc, and turn interrupts back on at the end of the dpc routine. I wouldn’t recommend this approach, but it is not uncommon.
-----Original Message-----
From: Primoz Beltram [mailto:xxxxx@hermes.si]
Sent: Monday, October 15, 2001 10:29 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

With “only one pending DPC”, I meant “my drivers DPC object” (sorry for inexactness). I know that there could be others drivers DPC objects in the DPC queues. My interest is to clear how many “my drivers DPC objects” can be in processing on a MP machine. So far it seams that point 3. is true. Thanks.

Wbr Primoz

-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Monday, October 15, 2001 12:42 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

  1. correct.

  2. not sure what you meant here. Each processor dpc queue can have an unbounded number of dpc objects queued, but each dpc object can only be on one queue at a time. Easy to express in UML, not so easy to express in english.

  3. depends on what you meant by (2). Each dpc object can only be either queued or not-queued. So a single dpc object can be queued at most once. This holds true while a dpc routine is executing: the related dpc object is either queued or not queued, and it can be queued at most once. The dpc routines related to a single dpc object can be executing with a concurrency of Np where Np is the number of processors.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Primoz Beltram
Sent: Monday, October 15, 2001 6:10 AM
To: NT Developers Interest List
Subject: [ntdev] Number of processing DPC objects

I didn’t find no explicit answer in books nor in electronic media, regarding the question I have.

  1. On a multiprocessor NT platform, each processor has its own DPC queue. Right?

  2. Then: On each(!) DPC queue, there can be only one pending DPC object. Right?

  3. Then: I can (theoretically) have NumOfProcessors*2 DPC objects in processing, (one in DPC_queue[processor] + one currently processing on processor)*NumOfProcessors.

Right?

Thanks in advance for any info.

Wbr Primoz

— You are currently subscribed to ntdev as: xxxxx@fvc.com To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com — You are currently subscribed to ntdev as: xxxxx@stratus.com To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com -----------------------------------------------

Primoz Beltram

e-mail: xxxxx@hermes.si

www: http://www.hermes.si

HERMES SoftLab, Office Nova Gorica

Erjavceva ul. 2, 5000 Nova Gorica, Slovenia

phone: (++386 5) 33 30 510, (++386 1) 58 65 710

fax: (++386 5) 33 32 656, (++386 1) 58 65 270



You are currently subscribed to ntdev as: xxxxx@hollistech.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@eicon.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@eicon.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@syssoftsol.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

----- Original Message -----
From: “Vipul Jain”
To: “'Dave Harvey '”
Sent: Wednesday, October 17, 2001 1:15 AM
Subject: RE: [ntdev] RE: Number of processing DPC objects

> >> Difference between (ISR=>DPC=>sched DMA=>EnableInt Then ISR=>DPC->sched
> DMA) and two independent DPCs that may be queued at the same time?
>
> In case of (ISR=>DPC=>sched DMA=>EnableInt Then ISR=>DPC->sched DMA) we are
> completely disabling the device from generating the interrupt till we
> re-enable the interrupt in device. That means if two DMA channels are
> working indepedently, we are blocking both of them from generating
> interrupts. That means both of the channels are working in a serial manner
> which may increase the latency.
>
> In case of two independent DPCs that may be queued at the same time - Most
> probably chances are that the two independent channels will not interrupt at
> the same time. In ISR disable the interrupt, find out which DMA channel
> caused the interrupt, queue the DPC correspond to that particular channel,
> enable the interrupt in ISR itself. Now if the other DMA channel cause
> interrupt we can still handle it because its not disabled. In this case both
> of the DMA channels are working in indepedent fashion.
>
> >> If the DMA setup time is so critical, why do this in the DPC
> instead of the ISR?
> Because the driver may needs to do some other job before setting up another
> round of DMA. For eaxample driver may need to complete an IRP for the last
> DMA buffer before it can start next DMA. I won’t suggest completing IRP in
> ISR …:-
If you were worried about preformance, you could have the ISR level have
info on two DMAs: the one in progress, and the next one.

In the ISR you’d start the next DMA, then start a DPC that would complete the
IRP for the previous one. Therefore your device wouldn’t have to wait for the
DPC to be scheduled to start the next operation.
-DH

>
> - Vipul
>
>
> -----Original Message-----
> From: Dave Harvey
> To: NT Developers Interest List
> Sent: 10/16/2001 7:31 PM
> Subject: [ntdev] RE: Number of processing DPC objects
>
> Having worked with devices that queue “interrupt events”, and generate
> an interrupt on
> each “interrupt event”, the disable-in-isr enable-in-dpc approach works
> well if the DPC drains
> the “interrupt event” queue. In this way, you get to amortize the
> interrupt overhead across
> multiple “interrupt events”.
>
> Mark, if the DMA setup time is so critical, why do this in the DPC
> instead of the ISR?
> (I guess I object to this philosophy that says you should do the least
> possible in the
> ISR being carried to the extreme where you move time critical code out
> of the ISR to
> a DPC, even if the overhead of that code is small compared to the ISR
> overhead.)
>
> Also, in your example, I’m confused by your description. If the two DMA
> channels are
> independent, but share an interrupt, and you have a single CPU, what’s
> the difference
> between (ISR=>DPC=>sched DMA=>EnableInt Then ISR=>DPC->sched DMA)
> and two independent DPCs that may be queued at the same time? Or were
> you failing to
> check to see if the other DMA channel is ready in the DPC and servicing
> it before
> enabling the interrupt?
>
> With multiple CPUs, this whole question becomes more interesting. The
> APIC will
> run the ISRs on different CPUs, which isn’t always a win, since each ISR
> has to
> drag the dirty cache between the CPUs. I’ve found that locking an ISR
> (and therefore
> the DPC) to a CPU using interrupt affinity often yields better
> performance than
> letting interrupts randomly select the CPU.
>
>
> -DH
>
> ----- Original Message -----
> From: Roddy, mailto:xxxxx Mark
> To: NT Developers Interest List mailto:xxxxx
> Sent: Tuesday, October 16, 2001 12:56 PM
> Subject: [ntdev] RE: Number of processing DPC objects
>
> If you do as suggested by Evan and if your hardware has N independent IO
> channels, then you are essentially serializing access to what would
> otherwise be concurrent data paths. For example I have a plx9054 pci
> device I fool around with at home. It has, at a minimum, two independent
> DMA channels. Using the disable-in-isr enable-in-dpc approach achieves
> almost exactly half the throughput of the deserialized dpc approach, up
> to some level of saturation where either channel is able to consume all
> the bandwidth by itself. (To be clearer, the effect is most noticeable
> where small transfers are performed and DMA setup time is the dominant
> factor. For large transfers the DMA transfer operation itself dominates
> and the setup time and serialization is not terribly important.) I
> agree with Vipul that the ISR ought to record the state, queue the dpc,
> and then re-enable the next interrupt. Generally this is not a lot of
> extra processing in the ISR - read some data, store it somewhere, and it
> allows for parallel performance on MP platforms for your driver lower
> edge.
> -----Original Message-----
> From: Vipul Jain [mailto:xxxxx@fvc.com]
> Sent: Tuesday, October 16, 2001 12:31 PM
> To: NT Developers Interest List
> Subject: [ntdev] RE: Number of processing DPC objects
>
>
> I agree.
>
> But I think the right approach would be disable the interrupt from ISR -
> as soon as you recognize the interrupt -, save the device register
> values in some data structure (may be device extension), Queue the DPC
> and then enable the interrupt once again.
>
> - Vipul
> -----Original Message-----
> From: Evan Lloyd [mailto:xxxxx@eicon.com]
> Sent: Tuesday, October 16, 2001 1:55 AM
> To: NT Developers Interest List
> Subject: [ntdev] RE: Number of processing DPC objects
>
>
> Mark,
> You may not recommend this approach but the NDIS spec does:
> "MiniportISR must disable interrupts to ensure that when
> MiniportHandleInterrupt runs, no information in the NIC will be
> overwritten by a subsequent interrupt. ".
> In fact, either you turn off interrupts in the ISR and do the processing
> in the DPC, or you are obliged to move some of the event processing into
> the ISR (to at least convince the card to remove the current IRQ).
> >From a system perspective it is much better to do the processing in the
> DPC.
>
> Regards,
> Evan
> -----Original Message-----
> From: Roddy, Mark [mailto:xxxxx@stratus.com]
> Sent: 15 October 2001 15:49
> To: NT Developers Interest List
> Subject: [ntdev] RE: Number of processing DPC objects
>
>
> In addition to the concurrency of your dpc routine (Np) it is important
> to note that there is not a 1-1 relationship between IoRequestDpc and
> queued dpc objects. That is to say, as a single dpc object can be queued
> at most once, an attempt to queue a dpc object that is already queued
> will have no effect. An invocation of a dpc routine can therefore
> represent 0…* interrupt events. Zero, as some other invocation of your
> dpc routine may have consumed the interrupt event that this invocation
> was triggered by, and * as some unknown number of interrupt events may
> have occurred before this invocation of the dpc routine started to
> execute (and an unknown number of interrupt events may occur while the
> dpc routine executes.) I have seen more than one driver that find this
> so annoying that they turn off interrupts from their device before
> requesting a dpc, and turn interrupts back on at the end of the dpc
> routine. I wouldn’t recommend this approach, but it is not uncommon.
> -----Original Message-----
> From: Primoz Beltram [mailto:xxxxx@hermes.si]
> Sent: Monday, October 15, 2001 10:29 AM
> To: NT Developers Interest List
> Subject: [ntdev] RE: Number of processing DPC objects
>
>
> With “only one pending DPC”, I meant “my drivers DPC object” (sorry for
> inexactness). I know that there could be others drivers DPC objects in
> the DPC queues. My interest is to clear how many “my drivers DPC
> objects” can be in processing on a MP machine. So far it seams that
> point 3. is true. Thanks.
> Wbr Primoz
>
> -----Original Message-----
> From: Mark Roddy [mailto:xxxxx@hollistech.com]
> Sent: Monday, October 15, 2001 12:42 PM
> To: NT Developers Interest List
> Subject: [ntdev] RE: Number of processing DPC objects
>
> 1. correct.
> 2. not sure what you meant here. Each processor dpc queue can have an
> unbounded number of dpc objects queued, but each dpc object can only be
> on one queue at a time. Easy to express in UML, not so easy to express
> in english.
> 3. depends on what you meant by (2). Each dpc object can only be either
> queued or not-queued. So a single dpc object can be queued at most once.
> This holds true while a dpc routine is executing: the related dpc object
> is either queued or not queued, and it can be queued at most once. The
> dpc routines related to a single dpc object can be executing with a
> concurrency of Np where Np is the number of processors.
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Primoz Beltram
> Sent: Monday, October 15, 2001 6:10 AM
> To: NT Developers Interest List
> Subject: [ntdev] Number of processing DPC objects
> I didn’t find no explicit answer in books nor in electronic media,
> regarding the question I have.
> 1. On a multiprocessor NT platform, each processor has its own DPC
> queue. Right?
> 2. Then: On each(!) DPC queue, there can be only one pending DPC object.
> Right?
> 3. Then: I can (theoretically) have NumOfProcessors*2 DPC objects in
> processing, (one in DPC_queue[processor] + one currently processing on
> processor)*NumOfProcessors.
> Right?
> Thanks in advance for any info.
> Wbr Primoz
> — You are currently subscribed to ntdev as: xxxxx@fvc.com To
> unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> -----------------------------------------------
> Primoz Beltram
> e-mail: xxxxx@hermes.si
> www: http://www.hermes.si http:
> HERMES SoftLab, Office Nova Gorica
> Erjavceva ul. 2, 5000 Nova Gorica, Slovenia
> phone: (++386 5) 33 30 510, (++386 1) 58 65 710
> fax: (++386 5) 33 32 656, (++386 1) 58 65 270
> -----------------------------------------------
> —
> You are currently subscribed to ntdev as: xxxxx@hollistech.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> —
> You are currently subscribed to ntdev as: xxxxx@hermes.si
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> —
> You are currently subscribed to ntdev as: xxxxx@stratus.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> —
> You are currently subscribed to ntdev as: xxxxx@eicon.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> —
> You are currently subscribed to ntdev as: xxxxx@stratus.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> —
> You are currently subscribed to ntdev as: xxxxx@syssoftsol.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> —
> You are currently subscribed to ntdev as: xxxxx@fvc.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</http:></mailto:xxxxx></mailto:xxxxx>

Take a look at “X DMA - Extreme DMA for performance”, an article in The NT
Insider published by OSR. It has a lot of insight on this for Windows 2000,
and with a little bit of creative thinking, also for NT4.

Gary G. Little
Staff Engineer
Broadband Storage, Inc.
xxxxx@broadstor.com

-----Original Message-----
From: Dave Harvey [mailto:xxxxx@syssoftsol.com]
Sent: Wednesday, October 17, 2001 6:04 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

----- Original Message -----
From: “Vipul Jain”
To: “'Dave Harvey '”
Sent: Wednesday, October 17, 2001 1:15 AM
Subject: RE: [ntdev] RE: Number of processing DPC objects

> >> Difference between (ISR=>DPC=>sched DMA=>EnableInt Then ISR=>DPC->sched
> DMA) and two independent DPCs that may be queued at the same time?
>
> In case of (ISR=>DPC=>sched DMA=>EnableInt Then ISR=>DPC->sched DMA) we
are
> completely disabling the device from generating the interrupt till we
> re-enable the interrupt in device. That means if two DMA channels are
> working indepedently, we are blocking both of them from generating
> interrupts. That means both of the channels are working in a serial manner
> which may increase the latency.
>
> In case of two independent DPCs that may be queued at the same time - Most
> probably chances are that the two independent channels will not interrupt
at
> the same time. In ISR disable the interrupt, find out which DMA channel
> caused the interrupt, queue the DPC correspond to that particular channel,
> enable the interrupt in ISR itself. Now if the other DMA channel cause
> interrupt we can still handle it because its not disabled. In this case
both
> of the DMA channels are working in indepedent fashion.
>
> >> If the DMA setup time is so critical, why do this in the DPC
> instead of the ISR?
> Because the driver may needs to do some other job before setting up
another
> round of DMA. For eaxample driver may need to complete an IRP for the last
> DMA buffer before it can start next DMA. I won’t suggest completing IRP in
> ISR …:-
If you were worried about preformance, you could have the ISR level have
info on two DMAs: the one in progress, and the next one.

In the ISR you’d start the next DMA, then start a DPC that would complete
the
IRP for the previous one. Therefore your device wouldn’t have to wait for
the
DPC to be scheduled to start the next operation.
-DH

>
> - Vipul
>
>
> -----Original Message-----
> From: Dave Harvey
> To: NT Developers Interest List
> Sent: 10/16/2001 7:31 PM
> Subject: [ntdev] RE: Number of processing DPC objects
>
> Having worked with devices that queue “interrupt events”, and generate
> an interrupt on
> each “interrupt event”, the disable-in-isr enable-in-dpc approach works
> well if the DPC drains
> the “interrupt event” queue. In this way, you get to amortize the
> interrupt overhead across
> multiple “interrupt events”.
>
> Mark, if the DMA setup time is so critical, why do this in the DPC
> instead of the ISR?
> (I guess I object to this philosophy that says you should do the least
> possible in the
> ISR being carried to the extreme where you move time critical code out
> of the ISR to
> a DPC, even if the overhead of that code is small compared to the ISR
> overhead.)
>
> Also, in your example, I’m confused by your description. If the two DMA
> channels are
> independent, but share an interrupt, and you have a single CPU, what’s
> the difference
> between (ISR=>DPC=>sched DMA=>EnableInt Then ISR=>DPC->sched DMA)
> and two independent DPCs that may be queued at the same time? Or were
> you failing to
> check to see if the other DMA channel is ready in the DPC and servicing
> it before
> enabling the interrupt?
>
> With multiple CPUs, this whole question becomes more interesting. The
> APIC will
> run the ISRs on different CPUs, which isn’t always a win, since each ISR
> has to
> drag the dirty cache between the CPUs. I’ve found that locking an ISR
> (and therefore
> the DPC) to a CPU using interrupt affinity often yields better
> performance than
> letting interrupts randomly select the CPU.
>
>
> -DH
>
> ----- Original Message -----
> From: Roddy, mailto:xxxxx Mark
> To: NT Developers Interest List mailto:xxxxx
> Sent: Tuesday, October 16, 2001 12:56 PM
> Subject: [ntdev] RE: Number of processing DPC objects
>
> If you do as suggested by Evan and if your hardware has N independent IO
> channels, then you are essentially serializing access to what would
> otherwise be concurrent data paths. For example I have a plx9054 pci
> device I fool around with at home. It has, at a minimum, two independent
> DMA channels. Using the disable-in-isr enable-in-dpc approach achieves
> almost exactly half the throughput of the deserialized dpc approach, up
> to some level of saturation where either channel is able to consume all
> the bandwidth by itself. (To be clearer, the effect is most noticeable
> where small transfers are performed and DMA setup time is the dominant
> factor. For large transfers the DMA transfer operation itself dominates
> and the setup time and serialization is not terribly important.) I
> agree with Vipul that the ISR ought to record the state, queue the dpc,
> and then re-enable the next interrupt. Generally this is not a lot of
> extra processing in the ISR - read some data, store it somewhere, and it
> allows for parallel performance on MP platforms for your driver lower
> edge.
> -----Original Message-----
> From: Vipul Jain [mailto:xxxxx@fvc.com]
> Sent: Tuesday, October 16, 2001 12:31 PM
> To: NT Developers Interest List
> Subject: [ntdev] RE: Number of processing DPC objects
>
>
> I agree.
>
> But I think the right approach would be disable the interrupt from ISR -
> as soon as you recognize the interrupt -, save the device register
> values in some data structure (may be device extension), Queue the DPC
> and then enable the interrupt once again.
>
> - Vipul
> -----Original Message-----
> From: Evan Lloyd [mailto:xxxxx@eicon.com]
> Sent: Tuesday, October 16, 2001 1:55 AM
> To: NT Developers Interest List
> Subject: [ntdev] RE: Number of processing DPC objects
>
>
> Mark,
> You may not recommend this approach but the NDIS spec does:
> "MiniportISR must disable interrupts to ensure that when
> MiniportHandleInterrupt runs, no information in the NIC will be
> overwritten by a subsequent interrupt. ".
> In fact, either you turn off interrupts in the ISR and do the processing
> in the DPC, or you are obliged to move some of the event processing into
> the ISR (to at least convince the card to remove the current IRQ).
> >From a system perspective it is much better to do the processing in the
> DPC.
>
> Regards,
> Evan
> -----Original Message-----
> From: Roddy, Mark [mailto:xxxxx@stratus.com]
> Sent: 15 October 2001 15:49
> To: NT Developers Interest List
> Subject: [ntdev] RE: Number of processing DPC objects
>
>
> In addition to the concurrency of your dpc routine (Np) it is important
> to note that there is not a 1-1 relationship between IoRequestDpc and
> queued dpc objects. That is to say, as a single dpc object can be queued
> at most once, an attempt to queue a dpc object that is already queued
> will have no effect. An invocation of a dpc routine can therefore
> represent 0…* interrupt events. Zero, as some other invocation of your
> dpc routine may have consumed the interrupt event that this invocation
> was triggered by, and * as some unknown number of interrupt events may
> have occurred before this invocation of the dpc routine started to
> execute (and an unknown number of interrupt events may occur while the
> dpc routine executes.) I have seen more than one driver that find this
> so annoying that they turn off interrupts from their device before
> requesting a dpc, and turn interrupts back on at the end of the dpc
> routine. I wouldn’t recommend this approach, but it is not uncommon.
> -----Original Message-----
> From: Primoz Beltram [mailto:xxxxx@hermes.si]
> Sent: Monday, October 15, 2001 10:29 AM
> To: NT Developers Interest List
> Subject: [ntdev] RE: Number of processing DPC objects
>
>
> With “only one pending DPC”, I meant “my drivers DPC object” (sorry for
> inexactness). I know that there could be others drivers DPC objects in
> the DPC queues. My interest is to clear how many “my drivers DPC
> objects” can be in processing on a MP machine. So far it seams that
> point 3. is true. Thanks.
> Wbr Primoz
>
> -----Original Message-----
> From: Mark Roddy [mailto:xxxxx@hollistech.com]
> Sent: Monday, October 15, 2001 12:42 PM
> To: NT Developers Interest List
> Subject: [ntdev] RE: Number of processing DPC objects
>
> 1. correct.
> 2. not sure what you meant here. Each processor dpc queue can have an
> unbounded number of dpc objects queued, but each dpc object can only be
> on one queue at a time. Easy to express in UML, not so easy to express
> in english.
> 3. depends on what you meant by (2). Each dpc object can only be either
> queued or not-queued. So a single dpc object can be queued at most once.
> This holds true while a dpc routine is executing: the related dpc object
> is either queued or not queued, and it can be queued at most once. The
> dpc routines related to a single dpc object can be executing with a
> concurrency of Np where Np is the number of processors.
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Primoz Beltram
> Sent: Monday, October 15, 2001 6:10 AM
> To: NT Developers Interest List
> Subject: [ntdev] Number of processing DPC objects
> I didn’t find no explicit answer in books nor in electronic media,
> regarding the question I have.
> 1. On a multiprocessor NT platform, each processor has its own DPC
> queue. Right?
> 2. Then: On each(!) DPC queue, there can be only one pending DPC object.
> Right?
> 3. Then: I can (theoretically) have NumOfProcessors*2 DPC objects in
> processing, (one in DPC_queue[processor] + one currently processing on
> processor)*NumOfProcessors.
> Right?
> Thanks in advance for any info.
> Wbr Primoz
> — You are currently subscribed to ntdev as: xxxxx@fvc.com To
> unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> -----------------------------------------------
> Primoz Beltram
> e-mail: xxxxx@hermes.si
> www: http://www.hermes.si http:
> HERMES SoftLab, Office Nova Gorica
> Erjavceva ul. 2, 5000 Nova Gorica, Slovenia
> phone: (++386 5) 33 30 510, (++386 1) 58 65 710
> fax: (++386 5) 33 32 656, (++386 1) 58 65 270
> -----------------------------------------------
> —
> You are currently subscribed to ntdev as: xxxxx@hollistech.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> —
> You are currently subscribed to ntdev as: xxxxx@hermes.si
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> —
> You are currently subscribed to ntdev as: xxxxx@stratus.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> —
> You are currently subscribed to ntdev as: xxxxx@eicon.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> —
> You are currently subscribed to ntdev as: xxxxx@stratus.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> —
> You are currently subscribed to ntdev as: xxxxx@syssoftsol.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> —
> You are currently subscribed to ntdev as: xxxxx@fvc.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@broadstor.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</http:></mailto:xxxxx></mailto:xxxxx>

Message
----- Original Message -----
From: Moreira, Alberto
To: NT Developers Interest List
Sent: Wednesday, October 17, 2001 11:44 AM
Subject: [ntdev] RE: Number of processing DPC objects

I don’t have much recent experience with this, but if a DPC will drain the interrupt queue, the ISR itself can just table the interrupt and ready the hardware for another interrupt, right ? All the ISR has to do is to queue the interrupts, and the DPC will drain the queue when it gets dispatched. No need to disable-in-isr, unless your hardware has special needs; here I tend to agree with Mark, it may be a long time between the disable-in-isr and the enable-in-dpc, you may lose more peripheral bandwidth than you’re willing to. I like to look at ISRs as hardware
Except that each of those interrupts incurs additional overhead.

Actually, the disable-in-isr and the enable-in-dpc crowd is really asking for the ISR to occur at DISPATCH_LEVEL. If we could get that, there would be no point in scheduling the DPC at all, we could do all the work in the ISR. Since the ISR wouldn’t run as often, we’d have less interrupts (assuming hardware queuing). The only point in having a higher level ISR than DISPATCH_LEVEL is if you actually do something to the device in the ISR beyond ACK’ing the interrupt (or your OS/hardware doesn’t let you control this).

-DH
handlers, and DPC as OS babysitters - the ISR is short and sweet, gets enough information to get going and resets the hardware for the next one, while the DPC picks up what the ISR enqueued and passes it up to the OS at the speed the OS is willing to take it.

This reminds me of the Sperry DCP, it had a central processor and multiple peripheral processors. The peripheral processors would handle all interrupts, and the pp program would enqueue the request into a hardware queue in shared memory. That queue would have been previously “armed” so that a new request into the queue would cause a “software attention item” to be enqueued into yet another queue, typically, an OS dispatch queue. So, The pp enqueuing an interrupt item would automatically schedule the corresponding dpc, all by hardware. The dpc, when dispatched, would empty the interrupt queue and pass each item up to the OS. In between the time the first interrupt arived and the time the dpc got activated, other interrupts could come down that same queue, the pp would handle the hardware transparent to the dpc and to the os. I remember that when the Sperry Monitor product was developed, the real-time executive’s dispatcher loop had precisely 15 machine instructions.

But they don’t make them like that anymore. :slight_smile:

Another thing: if DMA setup is so critical, how about a common-buffer strategy ? You may be able to keep a single DMA transaction alive for a long time, switching buffers if necessary. In our ICD, for example, we had three or more DMA buffers, sometimes in high throughput conditions we’d have as much as 32Mb or more worth of active DMA buffering between our OpenGL renderer and the graphics chip. Also, with the Pentium SIMD extensions, moving data can be done quite fast, so even if you have to shuffle data buffers around, it may still be a feasible proposition.

Alberto.

-----Original Message-----
From: Dave Harvey [mailto:xxxxx@syssoftsol.com]
Sent: Tuesday, October 16, 2001 10:32 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

Having worked with devices that queue “interrupt events”, and generate an interrupt on
each “interrupt event”, the disable-in-isr enable-in-dpc approach works well if the DPC drains
the “interrupt event” queue. In this way, you get to amortize the interrupt overhead across
multiple “interrupt events”.

Mark, if the DMA setup time is so critical, why do this in the DPC instead of the ISR?
(I guess I object to this philosophy that says you should do the least possible in the
ISR being carried to the extreme where you move time critical code out of the ISR to
a DPC, even if the overhead of that code is small compared to the ISR overhead.)

Also, in your example, I’m confused by your description. If the two DMA channels are
independent, but share an interrupt, and you have a single CPU, what’s the difference
between (ISR=>DPC=>sched DMA=>EnableInt Then ISR=>DPC->sched DMA)
and two independent DPCs that may be queued at the same time? Or were you failing to
check to see if the other DMA channel is ready in the DPC and servicing it before
enabling the interrupt?

With multiple CPUs, this whole question becomes more interesting. The APIC will
run the ISRs on different CPUs, which isn’t always a win, since each ISR has to
drag the dirty cache between the CPUs. I’ve found that locking an ISR (and therefore
the DPC) to a CPU using interrupt affinity often yields better performance than
letting interrupts randomly select the CPU.

-DH

----- Original Message -----
From: Roddy, Mark
To: NT Developers Interest List
Sent: Tuesday, October 16, 2001 12:56 PM
Subject: [ntdev] RE: Number of processing DPC objects

If you do as suggested by Evan and if your hardware has N independent IO channels, then you are essentially serializing access to what would otherwise be concurrent data paths. For example I have a plx9054 pci device I fool around with at home. It has, at a minimum, two independent DMA channels. Using the disable-in-isr enable-in-dpc approach achieves almost exactly half the throughput of the deserialized dpc approach, up to some level of saturation where either channel is able to consume all the bandwidth by itself. (To be clearer, the effect is most noticeable where small transfers are performed and DMA setup time is the dominant factor. For large transfers the DMA transfer operation itself dominates and the setup time and serialization is not terribly important.) I agree with Vipul that the ISR ought to record the state, queue the dpc, and then re-enable the next interrupt. Generally this is not a lot of extra processing in the ISR - read some data, store it somewhere, and it allows for parallel performance on MP platforms for your driver lower edge.
-----Original Message-----
From: Vipul Jain [mailto:xxxxx@fvc.com]
Sent: Tuesday, October 16, 2001 12:31 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

I agree.

But I think the right approach would be disable the interrupt from ISR - as soon as you recognize the interrupt -, save the device register values in some data structure (may be device extension), Queue the DPC and then enable the interrupt once again.

  • Vipul
    -----Original Message-----
    From: Evan Lloyd [mailto:xxxxx@eicon.com]
    Sent: Tuesday, October 16, 2001 1:55 AM
    To: NT Developers Interest List
    Subject: [ntdev] RE: Number of processing DPC objects

Mark,
You may not recommend this approach but the NDIS spec does:
"MiniportISR must disable interrupts to ensure that when MiniportHandleInterrupt runs, no information in the NIC will be overwritten by a subsequent interrupt. ".
In fact, either you turn off interrupts in the ISR and do the processing in the DPC, or you are obliged to move some of the event processing into the ISR (to at least convince the card to remove the current IRQ).
From a system perspective it is much better to do the processing in the DPC.

Regards,
Evan
-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: 15 October 2001 15:49
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

In addition to the concurrency of your dpc routine (Np) it is important to note that there is not a 1-1 relationship between IoRequestDpc and queued dpc objects. That is to say, as a single dpc object can be queued at most once, an attempt to queue a dpc object that is already queued will have no effect. An invocation of a dpc routine can therefore represent 0…* interrupt events. Zero, as some other invocation of your dpc routine may have consumed the interrupt event that this invocation was triggered by, and * as some unknown number of interrupt events may have occurred before this invocation of the dpc routine started to execute (and an unknown number of interrupt events may occur while the dpc routine executes.) I have seen more than one driver that find this so annoying that they turn off interrupts from their device before requesting a dpc, and turn interrupts back on at the end of the dpc routine. I wouldn’t recommend this approach, but it is not uncommon.
-----Original Message-----
From: Primoz Beltram [mailto:xxxxx@hermes.si]
Sent: Monday, October 15, 2001 10:29 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

With “only one pending DPC”, I meant “my drivers DPC object” (sorry for inexactness). I know that there could be others drivers DPC objects in the DPC queues. My interest is to clear how many “my drivers DPC objects” can be in processing on a MP machine. So far it seams that point 3. is true. Thanks.

Wbr Primoz

-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Monday, October 15, 2001 12:42 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Number of processing DPC objects

  1. correct.

  2. not sure what you meant here. Each processor dpc queue can have an unbounded number of dpc objects queued, but each dpc object can only be on one queue at a time. Easy to express in UML, not so easy to express in english.

  3. depends on what you meant by (2). Each dpc object can only be either queued or not-queued. So a single dpc object can be queued at most once. This holds true while a dpc routine is executing: the related dpc object is either queued or not queued, and it can be queued at most once. The dpc routines related to a single dpc object can be executing with a concurrency of Np where Np is the number of processors.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Primoz Beltram
Sent: Monday, October 15, 2001 6:10 AM
To: NT Developers Interest List
Subject: [ntdev] Number of processing DPC objects

I didn’t find no explicit answer in books nor in electronic media, regarding the question I have.

  1. On a multiprocessor NT platform, each processor has its own DPC queue. Right?

  2. Then: On each(!) DPC queue, there can be only one pending DPC object. Right?

  3. Then: I can (theoretically) have NumOfProcessors*2 DPC objects in processing, (one in DPC_queue[processor] + one currently processing on processor)*NumOfProcessors.

Right?

Thanks in advance for any info.

Wbr Primoz

— You are currently subscribed to ntdev as: xxxxx@fvc.com To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com -----------------------------------------------

Primoz Beltram

e-mail: xxxxx@hermes.si

www: http://www.hermes.si

HERMES SoftLab, Office Nova Gorica

Erjavceva ul. 2, 5000 Nova Gorica, Slovenia

phone: (++386 5) 33 30 510, (++386 1) 58 65 710

fax: (++386 5) 33 32 656, (++386 1) 58 65 270



You are currently subscribed to ntdev as: xxxxx@hollistech.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@hermes.si
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@eicon.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@syssoftsol.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are currently subscribed to ntdev as: xxxxx@syssoftsol.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com