Re: Buffer management in the zr36067 driver
"Ronald S. Bultje" <[email protected]> Sat, 9 Jun 2007 15:16:21 -0400
| Newsgroups | gmane.comp.video.mjpeg.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, On 6/9/07, Jean Delvare <[email protected]> wrote: > > The xfs code uses a 128 kB limit, too. From LDD3, about kmalloc: > "If your code is to be completely portable, it cannot count on being > able to allocate anything larger than 128 KB." _If hardcoded_. The maximum order seems to be 10 on x86_64. This is 4 MB. Even if we > can't get that, being able to get 512 kB or 1 MB would be a significant > improvement over the current situation. Maybe we can even get 2 or 4 MB > if we preallocate the buffers on driver load. Arguably, this can be > seen as a waste of kernel memory, so maybe this should be an option > rather than the default. [..] > I believe that the driver should not hard-code a memory limit value. > Instead, it should always try kmalloc (or __get_free_pages), and it > should fallback to other methods (get_high_mem, bigphys_area) only if > kmalloc fails. What do you think? > [..] > Without CONFIG_BIGPHYS_AREA (default), the driver uses get_high_mem() > to allocate large buffers, which looks like a gross, totally unsafe > hack to me. And it doesn't work for me at least, the largest amount I > manage to get is 32 kB. Does this really work for anyone? I'm surprised > it was even accepted into the kernel tree. Shouldn't we remove this > from the driver? All yes. Other v4l drivers (bttv, cx88) use a helper module called video-buf. > The header comment says it implements non-contiguous, PCI-DMA-able > buffers for video drivers. Couldn't this be used in the zr36067 driver > as well? No, it's non-contiguous, and thus useless for us. The whole base design is around that, unfortunately. Ronald ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Mjpeg-developer mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mjpeg-developer