[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <460236CE.1030303@slax.org>
Date: Thu, 22 Mar 2007 08:57:02 +0100
From: Tomas M <tomas@...x.org>
To: linux-kernel@...r.kernel.org
Subject: max_loop limit
Hello,
this is my first code submitted to kernel, I hope you won't hate it.
This 4-lines-change patch adds support for nearly two-times more loop
devices. Explanation follows:
The maximum amount of loop devices has been 255 for many years, while
there is a lot of space for more. The maximum depends on max memory
available from kmalloc(), which is usually 128KB, but can be increased
in some cases.
It would be better to support thousands of loop devices of course, but
the change could be more complicated (perhaps replace kmalloc by
vmalloc). This four lines change is just simple and sufficient, without
any need for kmalloc replacement.
I only removed the test if (max_loop > 255), so now we support much more
loop devices then before, without ANY OTHER CHANGE to the code.
Information: The maximum max_loop is 455 if kmalloc can allocate 128KB,
so the amount is nearly doubled without any significant change to kernel
code. The maximum could be even bigger I guess, it probably depends on:
NR_CPUS, MAX_NUMNODES, CONFIG_MMU and CONFIG_LARGE_ALLOCS.
If kmalloc can't allocate enough RAM, loop is simply unloaded.
Thank you for your consideration.
I hope you will like it and you will include it in kernel.
Or, if not, maybe this patch will start some debate regarding
the current insufficient limit of 255 loop devices.
Tomas M
slax.org
View attachment "loop.c.diff" of type "text/x-patch" (1862 bytes)
Powered by blists - more mailing lists