Re: [PATCH] MIPS: Implement __read_mostly

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

 



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



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux