Welcome! Log In Create A New Profile

Advanced

What would prevent get_user_pages_fast from pinning all pages

Posted by afalanga 
What would prevent get_user_pages_fast from pinning all pages
January 16, 2015 12:43PM
Hello,

This is my first post into this forum. I hope this is the right forum. Given the title, the question might be better in the Memory Management Forum. That forum appears to be overrun by meaningless prattle so I shall ask here. Besides, this all has to do with a device driver: sg. I'll try to be as succinct as possible.

I have need to transfer to disks, via single SCSI Write16 or Write10, etc., large amounts of data. Presently, I think the number to be no larger than 128mb. I have been able to modify the sg driver I/O vector size to the point that each vector is 4mb. When doing so, I can transfer as much as 8mb. However, when I try to double this, I get EFAULT returned (Bad Address). I've been able to trace the call as follows:

sg.c:sg_start_req() --> blk_rq_map_user_iov()
blk-map.c:blk_rq_map_user_iov() --> bio_map_user_iov()
boi.c:bio_map_user_iov() --> __bio_map_user_iov()
bio.c:__bio_map_user_iov() --> get_user_pages_fast()

get_user_pages_fast() returns a number less than the number of pages requested for pinning. The function __bio_map_user_iov() considers this an impassible error and returns EFAULT. Can anyone explain to me why get_user_pages_fast() would not be able to pin all requested pages?

This is my first venture this deep into the kernel. I would like to understand the process that I'm looking at. However, for some strange reason, it appears that descriptive, and otherwise helpful, variable names are shunned in the kernel source code. Therefore, deciphering what is happening is made much more difficult. Any help is greatly appreciated.

Thanks.
Presently, I think the number to be no larger than 128mb. I have been able to modify the sg driver I/O vector size to the point that each vector is 4mb. When doing so, I can transfer as much as 8mb. run 3
Author:

Your Email:


Subject:


Spam prevention:
Please, solve the mathematical question and enter the answer in the input field below. This is for blocking bots that try to post this form automatically.
Question: how much is 19 plus 10?
Message: