On Wednesday 11 June 2008 15:13, Paul Mackerras wrote:But this is a case where you really should be scared, so FUD is completely appropriate. At least, I don't see how it is at all worse than FUD about how much slower everything will be with stronger ordering, and how nobody will be able to do anything about it. In reality, for most devices it will not be measurable, and for some like network or disk might use a bit of a tweak in one or two fastpaths. If the driver author honestly does not know the code well enough to say whether a particular ordering is allowed or not, then it should just not be allowed. Anyway, what do I win if I give you a concrete example? I found one in the first file I picked out of my grep: drivers/net/s2io.c if (test_and_set_bit(__S2IO_STATE_LINK_TASK, &(nic->state))) { /* The card is being reset, no point doing anything */ goto out_unlock; } ... val64 = readq(&bar0->adapter_control); val64 |= ADAPTER_LED_ON; writeq(val64, &bar0->adapter_control); s2io_link(nic, LINK_UP); } else { if (CARDS_WITH_FAULTY_LINK_INDICATORS(nic->device_type, subid)) { val64 = readq(&bar0->gpio_control); val64 &= ~GPIO_CTRL_GPIO_0; writeq(val64, &bar0->gpio_control); val64 = readq(&bar0->gpio_control); } /* turn off LED */ val64 = readq(&bar0->adapter_control); val64 = val64 &(~ADAPTER_LED_ON); writeq(val64, &bar0->adapter_control); s2io_link(nic, LINK_DOWN); } clear_bit(__S2IO_STATE_LINK_TASK, &(nic->state)); Now I can't say definitively that this is going to be wrong on powerpc, because I don't know the code well enough. But I'd be 90% sure that the unlock is not supposed to be visible to other CPUs before the writeqs are queued to the card. On x86 it wouldn't be. If the relaxed writel and explicit barriers are not well documented and well understood, then they should not be used. And if the memory ordering issues are not well understood, then it should be done with locking and strongly ordered IO accessors. *You* don't have to watch it, the maintainer does. And if they can't understand the barriers, then it should not be converted to use them. Unless you want to take over maintainership. And if you do, then you should be watching all changes that go into it. And with the strongly ordered scheme, there is much smaller set of gotchas again, and it behaves the same as the x86 it was developed on, and you don't get confused by the list of rules: IO access is either strongly ordered or weakly ordered. --
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| Tarkan Erimer | Re: Slow DOWN, please!!! |
git: | |
| Kevin Ballard | Re: git on MacOSX and files with decomposed utf-8 file names |
| Jakub Narebski | Re: VCS comparison table |
| David | User's mailing list? And multiple cherry pick |
| Ken Pratt | pack operation is thrashing my server |
| Gerrit Renker | [PATCH 03/37] dccp: List management for new feature negotiation |
| Jiri Olsa | [PATCH] net: fix race in the receive/select |
| Jarek Poplawski | [PATCH take 2] pkt_sched: Protect gen estimators under est_lock. |
| Rick Jones | Re: RFC: Nagle latency tuning |
| Richard Stallman | Real men don't attack straw men |
| list-obsd-misc | Re: low-MHz server |
| Luca Corti | Re: About Xen: maybe a reiterative question but .. |
| Jerome Santos | sshd.config and AllowUsers |
