Re: wmb vs mmiowb

Linus Torvalds
2007-08-23T02:57:56Z

On Thu, 23 Aug 2007, Nick Piggin wrote:
>
> > Irix actually had an io_unlock() routine that did this
> > implicitly, but iirc that was shot down for Linux...
>
> Why was it shot down? Seems like a pretty good idea to me ;)

It's horrible. We'd need it for *every* single spinlock type. We have lots
of them.

So the choice is between:

- sane:

mmiowb()

followed by any of the existing "spin_unlock()" variants (plain,
_irq(), _bh(), _irqrestore())

- insane: multiply our current set of unlock primitives by two, by making
"io" versions for them all:

spin_unlock_io[_irq|_irqrestore|_bh]()

but there's actually an EVEN WORSE problem with the stupid Irix approach,
namely that it requires that the unlocker be aware of the exact details of
what happens inside the lock. If the locking is done at an outer layer,
that's not at all obvious!

In other words, Irix (once again) made a horrible and idiotic choice.

Big surprise. Irix was probably the flakiest and worst of all the
commercial proprietary unixes. No taste.

Linus