Paged code / data segment in filter driver

Hi everyone!

I was kind of trapped with a naive thought :slight_smile: that as long as my data /
code is never accessed/executed at IRQL higher than APC_LEVEL, I’m free to
put it into paged pool / paged code segment. I do realized (in hard way)
that this was too naive. At least code and data that participate in handling
of read IRP and fast I/O must be in nonpaged pool. Are there any other IRPs
/ Fast I/O that require filter’s code/data to be in nonpaged pool? And is
there any rule of a thumb on this matter?

TIA,

Vladimir

Paged code / data segment in filter driverSome food for thought:

  • If you have a CD-ROM and it is accessing something like video CD, your
    IOCTL handler will be called form the FSD and other KM components to satisfy
    RAW reads; these will most certainly be above PASSIVE_LEVEL.
  • My rule of thumb: If you are not PASSIVE, the code/data should be non
    pagable.
  • I would place all of the dispatch functions in non paged and then call
    functions from there that are either paged or non paged.
  • I have often used dynamic locking of paged memory (code and data) during
    execution. So, if my driver was in a certain state, I would lockdown certain
    functions and data. When my driver entered another state I unlocked those
    pages.

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Chtchetkine, Vladimir
Sent: Friday, July 07, 2000 3:16 PM
To: File Systems Developers
Subject: [ntfsd] Paged code / data segment in filter driver

Hi everyone!

I was kind of trapped with a naive thought :slight_smile: that as long as my data /
code is never accessed/executed at IRQL higher than APC_LEVEL, I’m free to
put it into paged pool / paged code segment. I do realized (in hard way)
that this was too naive. At least code and data that participate in handling
of read IRP and fast I/O must be in nonpaged pool. Are there any other IRPs
/ Fast I/O that require filter’s code/data to be in nonpaged pool? And is
there any rule of a thumb on this matter?

TIA,

Vladimir

Please don’t pin code that gets accessed at APC.

Vladimir is certainly noticing the pagefile read case - which is for
certain an instance where taking additional pagefaults is illegal.
Notice, however, that FAT (see your neighborhood IFS Kit) just handles
these in a seperate path with nonpaged code/data. This doesn’t cause us
to nonpage more than a minimal amount.

It is possible to understand when nonpaged code/data is required
(completion routines, pagingfile path and anything using spinlocks being
the clear ones). This list is certainly a good place to ask questions,
lets use it.

No IRP major entry point of a filesystem should be accessed at DPC.

-----Original Message-----
From: Jamey Kirby [mailto:xxxxx@storagecraft.com]
Sent: Friday, July 07, 2000 3:52 PM
To: File Systems Developers
Subject: [ntfsd] RE: Paged code / data segment in filter driver

Some food for thought:

  • If you have a CD-ROM and it is accessing something like video CD, your
    IOCTL handler will be called form the FSD and other KM components to
    satisfy RAW reads; these will most certainly be above PASSIVE_LEVEL.
  • My rule of thumb: If you are not PASSIVE, the code/data should be non
    pagable.
  • I would place all of the dispatch functions in non paged and then call
    functions from there that are either paged or non paged.
  • I have often used dynamic locking of paged memory (code and data)
    during execution. So, if my driver was in a certain state, I would
    lockdown certain functions and data. When my driver entered another
    state I unlocked those pages.

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Chtchetkine,
Vladimir
Sent: Friday, July 07, 2000 3:16 PM
To: File Systems Developers
Subject: [ntfsd] Paged code / data segment in filter driver

Hi everyone!

I was kind of trapped with a naive thought :slight_smile: that as long as my data /
code is never accessed/executed at IRQL higher than APC_LEVEL, I’m free
to put it into paged pool / paged code segment. I do realized (in hard
way) that this was too naive. At least code and data that participate in
handling of read IRP and fast I/O must be in nonpaged pool. Are there
any other IRPs / Fast I/O that require filter’s code/data to be in
nonpaged pool? And is there any rule of a thumb on this matter?

TIA,

Vladimir

Paged code / data segment in filter driver>fast I/O must be in nonpaged
pool. Are there any other IRPs / Fast I/O that

FASTFAT’s FastIo routines are all paged.

Max