Hi Wang,

> As the program needs, it continues to invoke alloc_pages to get pages
> to use. But when the machine's free memory drops to a certain value,
> the alloc_pages will cause the system to crash.I want to ask if there
> is some mechanism to block the process of alloc_pages until there is
> enough free memory to alloc for it. Thanks!~   

The answer lies in the GFP mask that is passed to alloc_pages(). Please see 
"include/linux/gfp.h". All the flags that have 
__GFP_WAIT specified enable the kernel to put the calling process to sleep 
while waiting for memory to get free.

Thanks,

Rajat

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to