[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [win-pv-devel] [PATCH 2/2] Stop using contiguous memory for slabs
Slab memory does not need to be (physically) contiguous and it is much faster to use non-paged pool memory, so just used __CacheAllocate/Free() for slab memory as well as internal house-keeping structures. Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx> --- src/xenbus/cache.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/xenbus/cache.c b/src/xenbus/cache.c index 1c1f4c4..ba0177b 100644 --- a/src/xenbus/cache.c +++ b/src/xenbus/cache.c @@ -294,9 +294,6 @@ CacheCreateSlab( PXENBUS_CACHE_SLAB Slab; ULONG NumberOfBytes; ULONG Count; - LARGE_INTEGER LowAddress; - LARGE_INTEGER HighAddress; - LARGE_INTEGER Boundary; ULONG Size; LONG Index; NTSTATUS status; @@ -312,16 +309,8 @@ CacheCreateSlab( if (Cache->Count + Count > Cache->Cap) goto fail1; - LowAddress.QuadPart = 0ull; - HighAddress.QuadPart = ~0ull; - Boundary.QuadPart = 0ull; - - Slab = MmAllocateContiguousMemorySpecifyCacheNode((SIZE_T)NumberOfBytes, - LowAddress, - HighAddress, - Boundary, - MmCached, - MM_ANY_NODE_OK); + Slab = __CacheAllocate(NumberOfBytes); + ASSERT3P(Slab, ==, PAGE_ALIGN(Slab)); status = STATUS_NO_MEMORY; if (Slab == NULL) @@ -367,7 +356,7 @@ fail4: fail3: Error("fail3\n"); - MmFreeContiguousMemory(Slab); + __CacheFree(Slab); fail2: Error("fail2\n"); @@ -412,8 +401,7 @@ CacheDestroySlab( } __CacheFree(Slab->Mask); - - MmFreeContiguousMemory(Slab); + __CacheFree(Slab); } static FORCEINLINE ULONG -- 2.5.3 _______________________________________________ win-pv-devel mailing list win-pv-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/win-pv-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |