Re: [PATCH] mm: fix boundary checking in free_bootmem_core

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andi Kleen
Date: Thursday, March 13, 2008 - 2:59 pm

On Thursday 13 March 2008 02:22:40 Andrew Morton wrote:

Concrete examples?

If that happens it's really just a problem that the bootmem API
is wrong. I was always annoyed by the hardcoded NODE_DATA(0)s in
free_bootmem. 

I would suggest if that happens you just fix free_bootmem to search
for the correct node instead of hardcoding 0 and then eliminate
free_bootmem_node() everywhere and replace it with free_bootmem()

I'm confused by the example. AFAIK there is no memory freeing in either
gart nor swiotlb. At least there wasn't until very recently.


I think you should just kill free_bootmem_node() and replace it everywhere
with your improved free_bootmem()



That seems unrelated?


I don't really like this silent return without error value.
There should be a BUG() or something for someone passing addresses
outside any node. This check should be probably in the caller.


I'm not sure for what these other changes are needed?  Just adding the
initial range check should be enough.

If you want to fix something else unrelated please do separate patches.

-Andi

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] mm: fix boundary checking in free_bootmem_core, Andi Kleen, (Thu Mar 13, 2:59 pm)
Re: [PATCH] mm: fix boundary checking in free_bootmem_core, Andrew Morton, (Fri Mar 21, 12:44 pm)
Re: [PATCH] mm: fix boundary checking in free_bootmem_core, Thomas Gleixner, (Fri Mar 21, 2:54 pm)