[Top] [All Lists]

Re: [PATCH] MIPS: Implement __read_mostly

To: Geert Uytterhoeven <>
Subject: Re: [PATCH] MIPS: Implement __read_mostly
From: Ralf Baechle <>
Date: Wed, 20 Oct 2010 20:05:34 +0100
Cc: David Daney <>,
In-reply-to: <>
Original-recipient: rfc822;
References: <> <>
User-agent: Mutt/1.5.21 (2010-09-15)
On Sat, Oct 16, 2010 at 10:04:59AM +0200, Geert Uytterhoeven wrote:

> > -const unsigned long mips_io_port_base __read_mostly = -1;
> > +const unsigned long mips_io_port_base = -1;
> >  EXPORT_SYMBOL(mips_io_port_base);
> Ugh. So as soon as someone implements MMU protection for the read-only data
> section, it'll break silently?

That's not the only failure mode.  A const might be replicated by a compiler
for example into multiple small data sections or by loading the rodata
into multiple NUMA nodes.  The later hits IP27 but that one got potencially
many PCI busses anyway, so mips_io_port_base was always problematic.  From
the time I put this optimization hack in it was clear that I was gaming
GCC and sooner or later it was going to blow up.  It's held for like a
decade so I got my money's worth :)


<Prev in Thread] Current Thread [Next in Thread>