Re: [PATCH 10 of 20] ipath - support for userspace apps using coredriver

From: Nick Piggin
Date: Fri Mar 17 2006 - 17:25:44 EST

Bryan O'Sullivan wrote:
On Fri, 2006-03-17 at 08:28 -0800, Linus Torvalds wrote:

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.

That's fine. We're not calling dma_free_coherent until after the page
count goes back down to one (the driver is once again the only user).

And that's probably fine too (provided you can somehow be sure that
you're getting compound pages, which you currently can't) - you're
essentially doing your own refcounting then. However in that case you
do need to ensure get_user_pages can't operate on your mapping (use
VM_IO), because that can hijack the page lifetime (ie. hold a ref
even after all mappings have gone).

But this doesn't seem germane to what Nick brought up, anyway.

Well kmalloc is one of the possible problems I saw, but there may be
others too (eg. ioremap).

SUSE Labs, Novell Inc.
Send instant messages to your online friends -
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at