RE: memory allocation when allocating pages

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

 



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 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