Roland Dreier <[email protected]> wrote: > > Andrew> Someone left PG_private set on this page (!) > > How does PG_private get set? Could doing a > 1 page kmalloc set it > (because we end up with a compound page)? I can only think that Brian went and set it. > Andrew> You need to decide who "owns" these pages. Once that's > Andrew> decided, it tells you who should release them. > > [... really good guide to mapping pages into userspace snipped ...] > > How about the case where one wants to map pages from > dma_alloc_coherent() into userspace? It seems one should do > get_page() in .nopage, and then the driver can do dma_free_coherent() > when the vma is released. Well, where were the pages allocated? mmap()? In that case the pages might be considered driver-owned and yes, I guess the right place to free them would be in the file's ->release() method. (Sorry to sound vague, but I haven't really worked on this stuff for a couple of years, and Hugh keeps on megachanging it). Lots of sound drivers do this sort of thing for their capture buffers - you could check them to see what (or, knowing sound drivers, what not) to do. > Or maybe it's just simpler to use vm_insert_page() in the .mmap method > and not try to be fancy with .nopage? > One would need to work out what to do with these pages when they're shared, after a fork - a ->nopage() handler would still be needed there, assuming the VMA is marked VM_DONTCOPY. Because we don't copy all the pte's on a VM_DONTCOPY vma at fork()-time. (I think we _could_, but we don't) vm_insert_page() mucks around with rmap-named functions which don't actually do rmap and sports apparently-incorrect comments wrt PageReserved(). I don't know how well-cared-for it is... - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] 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: Hugh Dickins <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Nick Piggin <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Roland Dreier <[email protected]>
- 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 <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: "Bryan O'Sullivan" <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Roland Dreier <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: "Bryan O'Sullivan" <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Andrew Morton <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: "Bryan O'Sullivan" <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Roland Dreier <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: "Bryan O'Sullivan" <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Roland Dreier <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: "Bryan O'Sullivan" <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Andrew Morton <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: "Bryan O'Sullivan" <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Andrew Morton <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Roland Dreier <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- Prev by Date: re: [PATCH] AHCI SATA vendor update from VIA
- Next by Date: Re: [PATCH] for_each_possible_cpu [1/19] defines for_each_possible_cpu
- 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):