lkml.org 
[lkml]   [2006]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 10 of 20] ipath - support for userspace apps using core driver


On Fri, 17 Mar 2006, Bryan O'Sullivan wrote:
>
> Hmm. Which of the implementations that you've seen will return
> something not backed by a struct page? On the half dozen arches I've
> looked at (i386/x86_64, powerpc, sparc64, ia64, mips), every one uses
> either kmalloc, __get_free_pages, or __alloc_pages at some point, and I
> think they all have struct pages behind them.

kmalloc may be backed by a "struct page", but the point is that it does
not honor the page _count_, and as such it is totally unsuitable for any
VM usage.

The VM relies on the page count very fundamentally, so by doing a
"get_page()" you'll tell every other user that you have a reference to a
page, and it won't be free'd until all references are gone. In contrast,
if you do a "get_page()" on something that has been allocated with
kmalloc(), the slab code will totally ignore it, and happily re-allocate
it to something else once the _original_ allocator free's it.

So kmalloc() really isn't appropriate.

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: 2009-11-18 23:46    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site