linux-mips
[Top] [All Lists]

Re: [PATCH] MIPS: Implement __read_mostly

To: Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH] MIPS: Implement __read_mostly
From: Ralf Baechle <ralf@linux-mips.org>
Date: Wed, 20 Oct 2010 20:05:34 +0100
Cc: David Daney <ddaney@caviumnetworks.com>, linux-mips@linux-mips.org
In-reply-to: <AANLkTikdRQSsLxPFtY+cav24wEkSVEQ9vCtrMEvvM3CV@mail.gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1287085009-16445-1-git-send-email-ddaney@caviumnetworks.com> <AANLkTikdRQSsLxPFtY+cav24wEkSVEQ9vCtrMEvvM3CV@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
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 :)

  Ralf

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