Re: mem=16MB laptop testing

Pavel Machek
2003-10-15T13:21:13Z

Hi!

> > I do not think this wants to be fixed. It should remain compatible
> > with 2.4.X, and if it is not that's a bug [and pretty dangerous & hard
> > to debug one -- if you mark something as ram which is not, you get
> > real bad data corruption].
>
> 2.4:
> static void __init limit_regions (unsigned long long size)
> {
> unsigned long long current_addr = 0;
> int i;
>
> for (i = 0; i < e820.nr_map; i++) {
> if (e820.map[i].type == E820_RAM) {
> current_addr = e820.map[i].addr + e820.map[i].size;
> if (current_addr >= size) {
> e820.map[i].size -= current_addr-size;
> e820.nr_map = i + 1;
> return;
> }
> }
> }
> }
>
> 2.5:
> static void __init limit_regions (unsigned long long size)
> {
> int i;
> unsigned long long current_size = 0;
>
> for (i = 0; i < e820.nr_map; i++) {
> if (e820.map[i].type == E820_RAM) {
> current_size += e820.map[i].size;
> if (current_size >= size) {
> e820.map[i].size -= current_size-size;
> e820.nr_map = i + 1;
> return;
> }
> }
> }
> }

Do you want to say that calculation is different, already? We should
probably make 2.5 version match 2.4 version, that's what users
expect. Who changed it and why?

Pavel

--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]