Re: [patch] x86, pat: fix free_memtype() for legacy 1MB range

From: Ingo Molnar
Date: Wed Jan 14 2009 - 14:17:03 EST



* Suresh Siddha <suresh.b.siddha@xxxxxxxxx> wrote:

> - is_range_ram = pagerange_is_ram(start, end);
> - if (is_range_ram == 1)
> - return free_ram_pages_type(start, end);
> - else if (is_range_ram < 0)
> - return -EINVAL;
> + /*
> + * For legacy reasons, some parts of the physical address range in the
> + * legacy 1MB region is treated as non-RAM (even when listed as RAM in
> + * the e820 tables). So we will track the memory attributes of this
> + * legacy 1MB region using the linear memtype_list always.
> + */
> + if (end >= ISA_END_ADDRESS) {
> + is_range_ram = pagerange_is_ram(start, end);
> + if (is_range_ram == 1)
> + return free_ram_pages_type(start, end);
> + else if (is_range_ram < 0)
> + return -EINVAL;
> + }

this logic is now repeated in an open-coded way in two places in pat.c.
Could you please send another delta patch that consolidates them into a
single helper function, which is used both in free_memtype() and
reserve_memtype()?

Thanks,

Ingo
--
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/