Thomas Hellström wrote:

>Benjamin Herrenschmidt wrote:
>
>  
>
>
>Hmm, the comments to handle_pte_fault(), which is calling do_nopage 
>gives some insight..
>
> * Note the "page_table_lock". It is to protect against kswapd removing
> * pages from under us. Note that kswapd only ever _removes_ pages, never
> * adds them. As such, once we have noticed that the page is not present,
> * we can drop the lock early.
> *
> * The adding of pages is protected by the MM semaphore (which we hold),
> * so we don't need to worry about a page being suddenly been added into
> * our VM.
> *
>
>So basically when driver nopage is called we should _never_ have a valid 
>PTE.
>  
>
...Or perhaps that comment is a remnant from the time when the
mm semaphore wasn't a rw semaphore.

/Thomas




>This makes the extra check in do_nopage() after the call to driver 
>nopage() somewhat mysterious,  (but fortunate). Perhaps the intention is 
>for driver nopage() to be able to temporarily release the MM semaphore. 
>(Which would be even more fortunate).
>
>In any case, if the comments hold, we should never hit the BUG() 
>statement in io_remap_pfn_range(), but it also seems clear that the code 
>doesn't really expect ptes to be added.
>
>Taking this to the lkml for some clarification might be a good idea.
>
>On a totally different subject, the previous discussion we had about 
>having pages outside of the kernel virtual map (highmem pages) for 
>example, might be somewhat tricky with the current definition of 
>alloc_gatt_pages and free_gatt_pages, which both returns kernel virtual 
>addresses. Would be nice to have them return struct page* instead.
>
>
>/Thomas
>
>
>
>
>
>
>-------------------------------------------------------------------------
>Take Surveys. Earn Cash. Influence the Future of IT
>Join SourceForge.net's Techsay panel and you'll get the chance to share your
>opinions on IT & business topics through brief surveys -- and earn cash
>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>--
>_______________________________________________
>Dri-devel mailing list
>Dri-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/dri-devel
>  
>




-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to