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/
- Follow-Ups:
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: "Bryan O'Sullivan" <bos@pathscale.com>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- References:
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Roland Dreier <rdreier@cisco.com>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: "Bryan O'Sullivan" <bos@pathscale.com>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Roland Dreier <rdreier@cisco.com>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: "Bryan O'Sullivan" <bos@pathscale.com>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Andrew Morton <akpm@osdl.org>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: "Bryan O'Sullivan" <bos@pathscale.com>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Roland Dreier <rdreier@cisco.com>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: "Bryan O'Sullivan" <bos@pathscale.com>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Roland Dreier <rdreier@cisco.com>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: "Bryan O'Sullivan" <bos@pathscale.com>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Andrew Morton <akpm@osdl.org>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: "Bryan O'Sullivan" <bos@pathscale.com>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Andrew Morton <akpm@osdl.org>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Roland Dreier <rdreier@cisco.com>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Nick Piggin <nickpiggin@yahoo.com.au>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Hugh Dickins <hugh@veritas.com>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Nick Piggin <nickpiggin@yahoo.com.au>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: "Bryan O'Sullivan" <bos@pathscale.com>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- Prev by Date: Re: 2.6.16-rc6: known regressions (v2)
- Next by Date: Re: 2.6.16-rc6-rt3
- Previous by thread: Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- Next by thread: Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- Index(es):
![]() |