Messages in this thread | | | Date | Tue, 15 Nov 2005 12:05:09 -0800 | From | Andrew Morton <> | Subject | Re: [PATCH 01/15] mm: poison struct page for ptlock |
| |
Hugh Dickins <hugh@veritas.com> wrote: > > On Tue, 15 Nov 2005, Andrew Morton wrote: > > > > It occurs to me that we can do the above if (__GNUC__ > 2), or whatever. > > > > That way, the only people who have a 4-byte-larger pageframe are those who > > use CONFIG_PREEMPT, NR_CPUS>=4 and gcc-2.x.y. An acceptably small > > community, I suspect. > > I can't really think of this at the moment (though the PageReserved > fixups going smoother this evening). Acceptably small community, yes. > But wouldn't it plunge us into the very mess of wrappers we were trying > to avoid with anony structunions, to handle the __GNUC__ differences?
Nope, all the changes would be constrained to the definition of struct page, and struct page is special.
struct page { ... #if __GNUC__ > 2 union { spinlock_t ptl; struct { unsigned long private; struct address_space *mapping; } } #else union { unsigned long private; spinlock_t ptl; } u; struct address_space *mapping; #endif
and
#if __GNUC__ > 2 #define page_private(page) ((page)->private) #define set_page_private(page, v) ((page)->private = (v)) #else #define page_private(page) ((page)->u.private) #define set_page_private(page, v) ((page)->u.private = (v)) #endif
Of course, adding "u." and "u.s." all over the place would be a sane solution, but we can do that later - I'm sure we'll be changing struct page again.
View the above as "a space optimisation made possible by gcc-3.x". - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |