Author: cmihail Date: Sun Aug 7 23:41:51 2011 New Revision: 53134
URL: http://svn.reactos.org/svn/reactos?rev=53134&view=rev Log: [TCPIP] - Use lookaside lists for the TDI_BUCKET data when allocating. This should provide a speed boost.
Modified: branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/event.c branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/tcp.c
Modified: branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/event.c URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/lib/driver... ============================================================================== --- branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/event.c [iso-8859-1] (original) +++ branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/event.c [iso-8859-1] Sun Aug 7 23:41:51 2011 @@ -30,6 +30,8 @@ "TIME_WAIT" };
+extern NPAGED_LOOKASIDE_LIST TdiBucketLookasideList; + static VOID BucketCompletionWorker(PVOID Context) @@ -43,7 +45,7 @@
DereferenceObject(Bucket->AssociatedEndpoint);
- ExFreePoolWithTag(Bucket, TDI_BUCKET_TAG); + ExFreeToNPagedLookasideList(&TdiBucketLookasideList, Bucket); }
VOID
Modified: branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/tcp.c URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/lib/driver... ============================================================================== --- branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] (original) +++ branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] Sun Aug 7 23:41:51 2011 @@ -23,6 +23,8 @@
#include "rosip.h"
+NPAGED_LOOKASIDE_LIST TdiBucketLookasideList; + VOID NTAPI DisconnectTimeoutDpc(PKDPC Dpc, PVOID DeferredContext, @@ -85,8 +87,8 @@ PCONNECTION_ENDPOINT TCPAllocateConnectionEndpoint( PVOID ClientContext ) { PCONNECTION_ENDPOINT Connection = (PCONNECTION_ENDPOINT) - ExAllocatePoolWithTag(NonPagedPool, sizeof(CONNECTION_ENDPOINT), - CONN_ENDPT_TAG); + ExAllocatePoolWithTag(NonPagedPool, sizeof(CONNECTION_ENDPOINT), CONN_ENDPT_TAG); + if (!Connection) return Connection;
@@ -196,6 +198,14 @@ { return Status; } + + ExInitializeNPagedLookasideList(&TdiBucketLookasideList, + NULL, + NULL, + 0, + sizeof(TDI_BUCKET), + TDI_BUCKET_TAG, + 0);
/* Initialize our IP library */ LibIPInitialize(); @@ -218,6 +228,8 @@ { if (!TCPInitialized) return STATUS_SUCCESS; + + ExDeleteNPagedLookasideList(&TdiBucketLookasideList);
LibIPShutdown();
@@ -348,7 +360,7 @@ { connaddr.addr = RemoteAddress.Address.IPv4Address;
- Bucket = ExAllocatePoolWithTag( NonPagedPool, sizeof(*Bucket), TDI_BUCKET_TAG ); + Bucket = ExAllocateFromNPagedLookasideList(&TdiBucketLookasideList); if (!Bucket) { UnlockObject(Connection, OldIrql); @@ -418,13 +430,13 @@ }
/* We couldn't complete the request now because we need to wait for outstanding I/O */ - Bucket = ExAllocatePoolWithTag(NonPagedPool, sizeof(*Bucket), TDI_BUCKET_TAG); + Bucket = ExAllocateFromNPagedLookasideList(&TdiBucketLookasideList); if (!Bucket) { UnlockObject(Connection, OldIrql); return STATUS_NO_MEMORY; } - + Bucket->Request.RequestNotifyObject = (PVOID)Complete; Bucket->Request.RequestContext = Context;
@@ -487,7 +499,7 @@ {
/* Freed in TCPSocketState */ - Bucket = ExAllocatePoolWithTag(NonPagedPool, sizeof(*Bucket), TDI_BUCKET_TAG); + Bucket = ExAllocateFromNPagedLookasideList(&TdiBucketLookasideList); if (!Bucket) { TI_DbgPrint(DEBUG_TCP,("[IP, TCPReceiveData] Failed to allocate bucket\n")); @@ -546,7 +558,7 @@ if (Status == STATUS_PENDING) { /* Freed in TCPSocketState */ - Bucket = ExAllocatePoolWithTag( NonPagedPool, sizeof(*Bucket), TDI_BUCKET_TAG ); + Bucket = ExAllocateFromNPagedLookasideList(&TdiBucketLookasideList); if (!Bucket) { UnlockObject(Connection, OldIrql); @@ -660,7 +672,7 @@ if( Bucket->Request.RequestContext == Irp ) { RemoveEntryList( &Bucket->Entry ); - ExFreePoolWithTag( Bucket, TDI_BUCKET_TAG ); + ExFreeToNPagedLookasideList(&TdiBucketLookasideList, Bucket); Found = TRUE; break; }