Tech Support > Microsoft Windows > Drivers > How to use a lookaside list?
How to use a lookaside list?
Posted by Omer on May 17th, 2005


Hi

Could someone please post a code sample or explain how to create a
lookaside list and use it, and when to use the paged or non paged
version of it?

Thanks!

Posted by Don Burn on May 17th, 2005


There are examples in the DDK samples. With the latest DDK take a look at
src\general\pcidrv for a good sample. You decide to use paged versus
non-paged the same way you decide for any other memory allocation, is the
memory from the list going to be accessed in cases where the driver is
running at IRQL DISPATCH_LEVEL or higher? If so use non-paged, otherwise
use paged.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply



"Omer" <Omerb99@gmail.com> wrote in message
news:1116319561.751772.125220@o13g2000cwo.googlegr oups.com...


Posted by Pavel A. on May 17th, 2005


"Omer" wrote:
Recently there was some interesting detail on this in the OSR NTDEV list.
Check it if you're subscribed.

--PA


Posted by Doron Holan [MS] on May 17th, 2005


you would use a lookaside list when you make frequent allocations and frees
of memory that are all of the same size (or if not of the same size, if you
can round up to size where you do not burn alot of unused memory).

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Omer" <Omerb99@gmail.com> wrote in message
news:1116319561.751772.125220@o13g2000cwo.googlegr oups.com...


Posted by sharon sahar on May 17th, 2005


So, lookaside list is more like a "heap manager" then a list, right ?

Posted by Maxim S. Shatskih on May 17th, 2005


No.

On frees, it preserves the blocks on the hot-reserve list, and just
detaches it back on future allocations. If the hot-reserve is over - it falls
back to usual ExAllocatePoolWithTag.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

"sharon sahar" <sharon.sahar@gmail.com> wrote in message
news:1116348662.108923.167940@g47g2000cwa.googlegr oups.com...


Posted by Omer on May 18th, 2005


so i use a single or duoble linked list and instead of allocating each
block with ExAllocatePool() i use the lookaside mechanism?

Posted by Don Burn on May 18th, 2005


Lookaside lists are not lists, they are an allocation mechanism for
allocating and freeing multiple of the same size block. If you have needs
for a dynamic environment of the same size blocks, where you do both
allocates and frees then this is a good mechanism.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply



"Omer" <Omerb99@gmail.com> wrote in message
news:1116415232.219696.279560@g47g2000cwa.googlegr oups.com...


Posted by Doron Holan [MS] on May 18th, 2005


the list part of the name refers to a list of free blocks w/in the
lookaside. this means that when you free a block back to the lookaside
list, instead of calling ExFreePool, the lookaside list inserts the block
into an internal list. when you go to allocate another block, it can pull
blocks from this list instead of calling ExAllocatePool. Furthermore, the
system knows about these lookaside lists. When the system is low on
resources, it can go into the lookaside list and grab some of the free
blocks. So, in the end a lookaside list is helpful for your perf and plays
nice with the rest of the system.

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Don Burn" <burn@stopspam.acm.org> wrote in message
news:sCFie.1301$bD5.666@fe07.lga...


Posted by Omer on May 19th, 2005


Thanks alot to you all !
Your replies were very helpful, especially the last one !