Relation between DISPATCH_LEVEL and page faults.

What does the following sentence actually mean.
“Code executing at or above DISPATCH_LEVEL must not cause page faults.”
Anand.

Actually means there are certain functions in your driver code which run at
IRQL … at or above DISPATCH_LEVEL (e.g StartIo, DpcForISr, ISR etc)… You
should take care that you don’t write any code there which try to access
page resourses …(eg accessing registry allocating memory in Paged Pool etc)

If you do such things then it would create page faults and ud get BSOD …

U’ll understand and get more in details if you read some books in Device
Driver Programming (Windows 2000 DD programming by Art baker is a good book
to start with)

–Arup

-----Original Message-----
From: Anand [mailto:xxxxx@lambenttek.com]
Sent: Thursday, August 01, 2002 11:53 AM
To: NT Developers Interest List
Subject: [ntdev] Relation between DISPATCH_LEVEL and page faults.

What does the following sentence actually mean.
“Code executing at or above DISPATCH_LEVEL must not cause page faults.”
Anand.


You are currently subscribed to ntdev as: xxxxx@quark.co.in
To unsubscribe send a blank email to %%email.unsub%%

You should use non paged memory while your code is running “at/above”
Dispatch level.

>> actually mean.

You must touch only locked or nonpaged memory at IRQL > DISPATCH.

----- Original Message -----
From: “Anand”
To: “NT Developers Interest List”
Sent: Thursday, August 01, 2002 9:23 AM
Subject: [ntdev] Relation between DISPATCH_LEVEL and page faults.

> What does the following sentence actually mean.
> “Code executing at or above DISPATCH_LEVEL must not cause page faults.”
> Anand.
>
> —
> You are currently subscribed to ntdev as: xxxxx@rdsor.ro
> To unsubscribe send a blank email to %%email.unsub%%
>

also you must not call functions which require being run at <
DISPATCH_LEVEL as they could generate a page fault (or the code for them
could be paged out).

-----Original Message-----
From: Dan Partelly [mailto:xxxxx@rdsor.ro]
Sent: Thursday, August 01, 2002 2:46 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Relation between DISPATCH_LEVEL and page faults.

> actually mean.

You must touch only locked or nonpaged memory at IRQL > DISPATCH.

----- Original Message -----
From: “Anand”
To: “NT Developers Interest List”
Sent: Thursday, August 01, 2002 9:23 AM
Subject: [ntdev] Relation between DISPATCH_LEVEL and page faults.

> What does the following sentence actually mean.
> “Code executing at or above DISPATCH_LEVEL must not cause page
faults.”
> Anand.
>
> —
> You are currently subscribed to ntdev as: xxxxx@rdsor.ro To
> unsubscribe send a blank email to %%email.unsub%%
>


You are currently subscribed to ntdev as: xxxxx@microsoft.com To
unsubscribe send a blank email to %%email.unsub%%

> What does the following sentence actually mean.

“Code executing at or above DISPATCH_LEVEL must not cause page
faults.”

Touching anything paged (code inside #pragma code_seg(“PAGE”), the
similar global variables, and memory allocated from paged pool) on
DISPATCH_LEVEL meands BSOD IRQL_NOT_LESS_OR_EQUAL.

This is because inpage operation requires a wait for IO to complete,
and you cannot wait on DISPATCH_LEVEL.

Max

This can be an insidious problem because simply acquiring a spinlock will
raise your IRQL. This is why you must limit the code/data you protect with
a spinlock.

  • Joel

“Maxim S. Shatskih” wrote in message
news:xxxxx@ntdev…
>
> > What does the following sentence actually mean.
> > “Code executing at or above DISPATCH_LEVEL must not cause page
> faults.”
>
> Touching anything paged (code inside #pragma code_seg(“PAGE”), the
> similar global variables, and memory allocated from paged pool) on
> DISPATCH_LEVEL meands BSOD IRQL_NOT_LESS_OR_EQUAL.
>
> This is because inpage operation requires a wait for IO to complete,
> and you cannot wait on DISPATCH_LEVEL.
>
> Max
>
>
>
>
>