ExAllocateFromPagedLookasideList

I am using ExAllocateFromPagedLookasideList on Windows 2000 to allocate
memory. It appears this doesnt work, or i am misunderstanding what it is
suppose to be doing. I have a structure which is allocated for every io.
To minimize the number of allocs and frees i do, i wanted to have a
lookaside list, but it appears to just call alloc/free most of time. I put
in a call to print each time the alloc actually occurs, and it appears that
it never extends the depth of the tree. I can generate 100’s of MB
concurrently and it stays at 4 and i get a bunch of messages in my log file
saying i alloced and freed memory. I have not tried hard coding the depth
as the documentation says not to do that. Any one have any hints?

Here is how i initialize it.

ExInitializePagedLookasideList(&Node,DEBUG_ALLOC,NULL,0,sizeof(tNode),NODETA
G,0);

Here is a dump from when i have 8 outstanding io’s.

1: kd> !strct PAGED_LOOKASIDE_LIST Node
struct _PAGED_LOOKASIDE_LIST (sizeof=104)
+00 struct _GENERAL_LOOKASIDE L
+00 union _SLIST_HEADER ListHead
+00 uint64 Alignment = 00dc000000000000
+00 struct _SINGLE_LIST_ENTRY Next
+00 struct _SINGLE_LIST_ENTRY *Next = 00000000
+04 uint16 Depth = 0000
+06 uint16 Sequence = 00dc
+08 uint16 Depth = 0004
+0a uint16 MaximumDepth = 0100
+0c uint32 TotalAllocates = 000000e5
+10 uint32 AllocateMisses = 00000077
+10 uint32 AllocateHits = 00000077
+14 uint32 TotalFrees = 0000006e
+18 uint32 FreeMisses = 00000000
+18 uint32 FreeHits = 00000000
+1c int32 Type = 00000001
+20 uint32 Tag = 50536e6f
+24 uint32 Size = 00000020
+28 function *Allocate = F74CEB60
+2c function *Free = 80469F42
+30 struct _LIST_ENTRY ListEntry
+30 struct _LIST_ENTRY *Flink = F74184F0
+34 struct _LIST_ENTRY *Blink = F7502380
+38 uint32 LastTotalAllocates = 000000e5
+3c uint32 LastAllocateMisses = 00000077
+3c uint32 LastAllocateHits = 00000077
+40 uint32 Future[2] = 00000000 00000000
… …
+48 struct _FAST_MUTEX Lock
+48 int32 Count = 00000001
+4c struct _KTHREAD *Owner = 00000000
+50 uint32 Contention = 00000000
+54 struct _KEVENT Event
+54 struct _DISPATCHER_HEADER Header
+54 byte Type = 01 .
+55 byte Absolute = 00 .
+56 byte Size = 04 .
+57 byte Inserted = 00 .
+58 int32 SignalState = 00000000
+5c struct _LIST_ENTRY WaitListHead
+5c struct _LIST_ENTRY *Flink = F7502414
+60 struct _LIST_ENTRY *Blink = F7502414
+64 uint32 OldIrql = 00000000

rob


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 am using ExAllocateFromPagedLookasideList on Windows 2000 to allocate

memory. It appears this doesnt work, or i am misunderstanding what it is
suppose to be doing.

At my last check (probably NT 4.0 SP 5), it does not work as one would
expect. Even though you specify the lookaside list size, it seems to treat
this as a maximum, not a strict list size, and it changes the size
dynamically over time. Thus, if you allocate a LOT within a short period,
it will use your list size, but if your allocations are spread out over
time, it really won’t do very much caching.

This is described fairly well in an article in The NT Insider called, of
all things, “NT 4.0 (SP3) Lookaside Lists Appear to be Broken”:
http://www.osr.com/ntinsider/1997/broken.htm


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