Re: get_user_pages returns fewer pages than requested

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi...

Sorry for this late reply..
Hi Mulyadi,

Thanks for your reply.
Few more questions though:

In 1. you stated that I might be asking more than the available free
pages; I'm currently testing on a RedHat enterpise WS4 x86_64 edition
(2.6.9-55) running on a HP xw9400 (Dual AMD Opteron with 4GB system
RAM). If I'm asking more than the available free pages, would that mean
I'm asking to lock (by means of get_user_pages) more than the still
available physical system RAM ?

I believe so. How much free pages you have at that time anyway? "free" command could tell I think... or check /proc/meminfo.
I don't know how linux x86_64 handles the memory that is reserved for
the kernel.

Neither do I. However let's focus on how many free pages you really have when you hit that case...
With regards to 2. I don't know much about VMA's... But in my case I
don't have to handle any VMA's; I guess this is done internally.
This is what I currently do:
 - I get a virtual address to a buffer (+size) from user space
 - I get the pages list via get_user_pages
 - I than have dma_map_sg providing me the scatterlist for these pages,
which I will pass through to my hardware device
So during this I have no control over VMA's

Hm... are you doing somekind of vector I/O (also known as scatter gatter I/O)? And these pages are used for DMA operation? In this case, are you sure it's really get_user_pages' error or error during DMA operations?
In 3. exceeding the max linear address of user space would mean I try to
allocate a buffer that's bigger than 4GB ?

Since I don't have any real experience with 64 bit system, I don't know how big the maximum linear address for user space. But probably bigger than 3GB...
One more thing, it is quite hard to debug this issue, because it's hard
to reproduce it.
Hm, so this thing doesn't happen all the time? OK then, perhaps we can take a look on your source code?
Would there be any way to log the state of the mem management if this
occurs ? Meaning, can I write an error handler that will log interesting
information about the mem managenment ?
I hardly remember anything that is useful for memory management debugging. But please go directly inside "Kernel hacking" menu during kernel configuration (make menuconfig or make xconfig). I slightly remember there are things like slab debugging, stack utilization debugging and so on. Please read the accompanying help texts (press "h" while highligthing the related item).


regards,

Mulyadi.


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux