[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 2.5.52-mm2



> Actually, just looking at mmzone.h, I have to say "ick".  The
> non-NUMA case seems unnecessarily overdone.  eg:
>
># define page_to_pfn(page)
> 	((page - page_zone(page)->zone_mem_map) +
> page_zone(page)->zone_start_pfn)
>
> Ouch.  Why can't we have the good old `page - mem_map' here?

Ummm .... mmzone.h:

#ifdef CONFIG_DISCONTIGMEM
....
#define page_to_pfn(page)       ((page - page_zone(page)->zone_mem_map) + 
page_zone(page)->zone_start_pfn)
....
#endif /* CONFIG_DISCONTIGMEM */

page.h:

#ifndef CONFIG_DISCONTIGMEM
#define page_to_pfn(page)       ((unsigned long)((page) - mem_map))
#endif /* !CONFIG_DISCONTIGMEM */


I'll admit the file obfuscation hides this from being easy to read, but
i'm not stupid enough to screw things up *that* badly. Well, not most
of the time ;-) Want me to reshuffle things around so that the same defines
end up in the same file, and people have a hope in hell of reading it?
If I do that, it'll probably be based on the struct page breakout patch,
and making these things all static inlines, so people stop blowing their
own feet off.

M.

PS. cscope is cool ;-)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/