lkml.org 
[lkml]   [2005]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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/

\
 
 \ /
  Last update: 2005-11-15 21:08    [W:0.063 / U:1.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site