[lkml]   [2001]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] More ioctls for VIA sound driver, Flash 5 now fixed
Jeff Garzik wrote:
> So, the preferred allocation algorithm would be:
> if (OSS fragment size <= PAGE_SIZE)
> allocate chan->pgtbl[] in PAGE_SIZE chunks
> else
> allocate chan->pgtbl[] in oss_frag_size chunks
> Another key thing to rememeber is that pci_alloc_consistent usually
> returns a -minimum- of one page, so it's useless to allocate less than
> that, without switching the entire driver to the pci_pool_xxx API.

Another limitation, I just remembered: Each scatter-gather buffer must
be a multiple of PAGE_SIZE (actually probably PAGE_CACHE_SIZE), in order
for mmap(2) support (via_mm_nopage) to work properly.

I would also like to point out that mmap support via
vm_operations_struct::nopage is also unique and new, and was suggested
by Linus as a much better mmap(2) approach than other drivers, which
using remap_page_range [a method which requires the one-big-buffer
allocation approach].


Jeff Garzik | Only so many songs can be sung
Building 1024 | with two lips, two lungs, and one tongue.
MandrakeSoft | - nomeansno

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:11    [W:0.038 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site