lkml.org 
[lkml]   [2003]   [Nov]   [15]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateFri, 14 Nov 2003 22:26:49 -0800 (PST)
FromLinus Torvalds <>
SubjectRe: Mysterious driver-related oops in vm system
On 15 Nov 2003, Steve Holland wrote:
> 
nopage():
>   v_addr =  BoardData[board].dma_virt_addr + (address - vma->vm_start);
>   page = virt_to_page(v_addr);
>   get_page (page);
>   return (page);

You can't do single-page memory management once you've already allocated 
the board data as one big memory allocation.

In short: remove the "get_page()", since the thing that keeps the pages in 
memory is actually the "pci_alloc_consistent()". 

To make sure that the swapout logic doesn't try to touch these pages 
as "normal" pages either, you should mark them all reserved.

Then, in the release() function you should unmark the pages, and finally 
do the pci_free_consistent() on the area.

We really should have helper functions to do that. Right now every driver 
that wants to do this needs to have its own logic for it (sound drivers 
use "snd_malloc_pages()" that does it for them etc etc).

			Linus

-
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/

\
 
 \ /
  Last update: 2005-03-22 12:58    [from the cache]
©2003-2008