[dm-devel] [patch] fix allocator for exception cache

Dave Olien dmo at osdl.org
Wed Jun 2 21:58:07 UTC 2004


Here's a trivial patch to the allocator for the exception_cache.
I've been playing with creating a 100gigabyte logical volume,
creating a snapshot, then, runing mkfs.ext2 on the origin volume.
This creates approximately 1,316,000 exceptions.

With the original code, My system hangs completely, as all of the
NOIO memory gets consumed (this is a 16-gigabyte 8 processor system).
The system is unuseable.

Changing the allocator makes things better.  The original allocator
doesn't really make sense.  The GFP_NOIO allocation should never fail.
It'll just block forever.  So the original code that looked for failure
and then calls kmem_cache_alloc(GFP_ATOMIC) seems backwards.

I think some other scheme is needed for allocationg exceptions
I don't know yet what that new scheme would be.

diff -ur linux-2.6.7-rc2-udm1-original/drivers/md/dm-snap.c linux-2.6.7-rc2-udm1-patched/drivers/md/dm-snap.c
--- linux-2.6.7-rc2-udm1-original/drivers/md/dm-snap.c	2004-06-02 14:08:05.000000000 -0700
+++ linux-2.6.7-rc2-udm1-patched/drivers/md/dm-snap.c	2004-06-02 14:16:58.000000000 -0700
@@ -264,9 +264,9 @@
 {
 	struct exception *e;
 
-	e = kmem_cache_alloc(exception_cache, GFP_NOIO);
+	e = kmem_cache_alloc(exception_cache, GFP_ATOMIC);
 	if (!e)
-		e = kmem_cache_alloc(exception_cache, GFP_ATOMIC);
+		e = kmem_cache_alloc(exception_cache, GFP_NOIO);
 
 	return e;
 }



More information about the dm-devel mailing list