Re: Does pci_alloc_consisent really need to zero memory?

David S. Miller (davem@redhat.com)
Thu, 30 May 2002 03:54:07 -0700 (PDT)


From: Emmanuel Michon <emmanuel_michon@realmagic.fr>
Date: 30 May 2002 13:05:26 +0200

"David S. Miller" <davem@redhat.com> writes:

> I'd rather see a patch to DMA-mapping.txt that specifies the memory
> returned is zeroed out, as this is what every implementation appears
> to do.

What was the idea when writing the code that zeroes memory? It seems
so useless.

Because 9 out of 10 drivers where I had to change virt_to_bus
into the portable pci_alloc_consistent were using get_free_pages()
which zeros things out for you.

I do actually remember that many of those instances in fact did
depend on the memory being zero'd for them, they weren't using the
"zero the pages too" variant instead of __get_free_pages()
gratuitously.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/