get_user_pages question
Hi,
I have been tryin to use get_user_pages() on malloced memory and get the list of pages but it does not work as I expected:
1. malloc a buffer in user space
2. issue ioctl, invoke get_user_pages() and save the page descriptors I obtained.
3. at a later time, issue another ioctl, invoke get_user_pages() again and save another copy of the page descriptors.
4. Compare the two lists of page descriptors. They're not all the same.
Apparently some pages were discarded and the subsequent page fault brought a new page. I expected the original page to be in the swap cache and get the old page again. I repeated the experiment but before the first ioctl I wrote something to all the pages but got the same results. I used 2.4.21-4 (RH AS 3.0).
Can anyone clarify?
thanks
Eli
Quoted 6 lines
Apparently some pages were discarded and the subsequent page fault brought a new page. I expected the original page to be in the swap cache and get the old page again. I repeated the experiment but before the first ioctl I wrote something to all the pages but got the same results. I used 2.4.21-4 (RH AS 3.0).
I still have grave doubts about what you try to do... is this the code at openib.org ? or is there some other URL where the code is visible ?
Quoted 9 lines · Arjan van de Ven
Quoted 3 lines
I used 2.4.21-4 (RH AS 3.0).
I still have grave doubts about what you try to do... is this the code at openib.org ? or is there some other URL where the code is visible ?
It's not in openib since I am not using it since it is not doing what I need. The code in openib calls sys_mlock to lock the pages in the process's address spcae. In my latst description I meant that the two calls to get_user_pages were made on the same buffer.