* innofensive BUG and fix: area->map's size is not calculated ok
@ 2000-11-30 9:43 uaca
0 siblings, 0 replies; only message in thread
From: uaca @ 2000-11-30 9:43 UTC (permalink / raw)
To: linux-kernel
In a 2.4 kernel, mm/page_alloc.c:free_area_init_core(), in the following
assignement...
bitmap_size = size >> i;
...makes bitmap_size be the double of the needed size, this calculum
assumes that with a 512 byte map size the kernel is mapping 8*512= 4096 chunks
of memory, that is: one bit of the map is used for each chunk of memory,
and that's not true.
Really one bit of area->map is used to map two chunks of memory, so in the
example above an area->map of just 256 bytes is really needed, the other 256
bytes are _never accessed_.
So the righ thing would be to do is:
bitmap_size = size >> (i+1);
also I tested it and it works ok, so I believe I'm right...
Please CC: your replies to (I'm not subscribed to this list)
Ulisses Alonso Camaró <uaca@NOSPAM.alumni.uv.es>
PD: my nick on #kernelnewbies is despistao
Debian GNU/Linux: a dream come true
-----------------------------------------------------------------------------
"Computers are useless. They can only give answers." Pablo Picasso
---> Visita http://www.valux.org/ para saber acerca de la <---
---> Asociación Valenciana de Usuarios de Linux <---
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-11-30 10:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-30 9:43 innofensive BUG and fix: area->map's size is not calculated ok uaca
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®