lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <45AC89F7.6080306@suse.de>
Date:	Tue, 16 Jan 2007 09:16:55 +0100
From:	Gerd Hoffmann <kraxel@...e.de>
To:	David Moore <dcm@....EDU>
Cc:	Arjan van de Ven <arjan@...radead.org>,
	Bill Davidsen <davidsen@....com>,
	theSeinfeld@...rs.sourceforge.net,
	linux1394-devel@...ts.sourceforge.net,
	linux-kernel@...r.kernel.org, libdc1394-devel@...ts.sourceforge.net
Subject: Re: allocation failed: out of vmalloc space error treating and  
 VIDEO1394 IOC LISTEN CHANNEL ioctl failed problem

  Hi,

> I think you've convinced me that vmalloc is not a good choice when a
> driver needs a large buffer (many megabytes) for DMA.

Yep.  bttv used to do that long time ago, and some people used to run
into trouble because the nvidia driver used lots of vmalloc address
space ...

> In this case, we need a large ring buffer for reception of isochronous
> packets from a firewire device.  If I understand you correctly, you are
> suggesting that this buffer be obtained as followed:
> 
> 1. Application performs malloc() in user-space and mmap()s it.
> 2. Driver uses vmalloc_to_page() on every page of the malloc'ed memory
> and constructs a scatter-gather list.
> 3. Map the sg list with pci_map_sg().
> 4. Commence DMA.

video4linux drivers do this:

 (1) app opens /dev/video0
 (2) app issues some ioctls to set buffer count, format and size
 (3) app uses mmap(/dev/video0) to map the buffers.

Buffer memory is simple userspace memory, it is allocated by the nopage
handler.  Memory is pinned down by get_user_pages().

> Are there some other convenience
> functions that can be used?

Look at drivers/media/video/video-buf.c, that is the buffer management
code shared by v4l drivers.  It should at least give an idea how it
works, not sure you can actually reuse the code.  Chances are not too
bad though, it is used not only for video buffers, but also for audio
and mpeg2 data, so it could be generic enough to fit your needs too.

cheers,
  Gerd

-- 
Gerd Hoffmann <kraxel@...e.de>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ