Re: [patch] [bugfix] loop.c

From: Jiri Kosina
Date: Fri Mar 23 2007 - 10:19:01 EST


On Fri, 23 Mar 2007, Tomas M wrote:

> This is a bugfix for loop.c block driver, as it currently allocates more
> memory then it needs, without any further use.
> If 'max_loop=255' parameter is given, the loop.c driver allocates this
> amount of memory:
> kmalloc(max_loop * sizeof(struct loop_device))
> But in this case, (max_loop * sizeof) is greater than 65536, and thus kmalloc
> must allocate the next bigger size (which is 128KB of RAM).

Which is very unlikely to work after some time of uptime, as the memory
will be too fragmented to successfully kmalloc(128k). I guess that the
code should be rather rewritten not to allocate such large contignuous
chunks of memory through kmalloc().

--
Jiri Kosina
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/