[UBI UBIFS] replace vmalloc with kmalloc

Artem Bityutskiy dedekind1 at gmail.com
Sun Aug 9 01:35:32 EDT 2009


On Fri, 2009-08-07 at 23:28 +0800, JiSheng Zhang wrote:
> Adrian Hunter <adrian.hunter at nokia.com> wrote:
> > 
> > vmalloc allows large (> 128KiB) buffers, but kmalloc doesn't.
> > So we presently have no choice but to use vmalloc.
> 
> But vmalloced buffer can't be easily passed to DMA, is there better choice?

We use vmalloc-ed buffers is when we need to do something with whole
eraseblocks, which may be 128KiB, or even 256KiB. So in general, we
cannot just s/kmalloc/vmalloc/. We should invent something trickier.

You should probably think about some generic way to solve problems like
this. May be some MTD-specific library could be created. You could
implement something like the flexible arrays, but with DMA stuff in mind
(e.g., adding a parameter which specifies allocation order, because for
DMA you may want to allocate more than one physically contiguous page).
Or you may even improve the existing flexible arrays to suit your needs.
Take a look here:
http://lwn.net/Articles/345273/

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)




More information about the linux-mtd mailing list