Re: 2.1.111: IDE DMA disabled?

Linus Torvalds (torvalds@transmeta.com)
Sun, 26 Jul 1998 11:25:09 -0700 (PDT)


On Sun, 26 Jul 1998, Alan Cox wrote:
>
> > Personally, I never understood why DMA was enabled by default anyway. As
> > far as I can tell the only sane thing is to have it always disabled by
> > default, and enable it with hdparm.
>
> Its a factor of 10 speedup in effective throughput. It was turned on by
> the BIOS - which may have configured aspects of the firmware we don't even
> know about for DMA only operation.

BUT THERE HAVE BEEN REPORTS OF CORRUPTION WITH IDE-DMA FOR TOO LONG, AND
WE'RE READYING FOR A STABLE RELEASE!

I don't buy into the BIOS argument. I've heard it before, and it sounds
completely bogus to me. If you're running Win3.11, the BIOS will have done
the same thing, and I know win3.11 doesn't use DMA in its native driver.
And I bet they tested that configuration. In short, whoever came up with
the argument that "if the BIOS tells us that it can do DMA, we must follow
that" is just out to lunch or is trying to reach for any reason to keep it
enabled.

The argument is proven false by the fact that people who saw corruption
with DMA on didn't see it with DMA off. In short, my counter-argument is
that we _know_ that DMA is unsafe. Rather than wild and idle speculation,
we have FACTS. And when it comes to fact vs wild speculation, I'll go with
the facts any day.

Quite frankly, as long as the IDE driver defaults to DMA on when
configured with IDEDMA, the IDEDMA thing won't be visible by default. I
categorically refuse to have an option that is known to cause various
silent corruptions. It was fine in a development series, but sorry, it's
no longer acceptable.

And yes, Alan, it's trivial to get 10 times throughput improvement by
being buggy. I can calculate PI to 20 billion digits in less than two
seconds if I'm not required to actually get the right answer. Does that
make my computer a supercomputer?

For people who care about performance, there already _is_ a DMA flag to
hdparm, and you should be able to enable it from your /etc/rc.d scripts by
just running hdparm.

For people that don't know about these corruption issues, the _only_ sane
default is to leave the DMA code turned off. Unless you have some way of
categorically making sure that it is absolutely safe to turn on, and so
far I haven't heard of any (a white-list is probably the best answer, but
I'd argue for keeping the white-list in user space where it belongs, and
just have a script in rc.d to parse the BIOS/PCI information).

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html