Re: __get_fre_pages problem

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, 28 Feb 2004 17:26:44 +0000 (GMT)
pankaj chauhan <chauhan_ait@yahoo.co.in> wrote:

>
>hi all , 
>
>i have a machine with 256Mb of RAM.
>
>i am using __get_free_pages{order 9} to get 2Mb memory
>( want it to be continous) in a module. i am accessing
>this memory in interrupt context..
>
>my system crashes down when i access this memory  in
>interrupt context. during allocation i check that if
>__get_free_pages fails ( pointer returned is NULL) , i
>return an error.so i hope i am using memory in the
>interrupt context only if __get_free_pages succeeded.
>
>plz tell me what may be possible problem 

Please take a look at this (grepping kernel source code is
always a good thing to do in such cases).

 * The @flags argument may be one of:
 *
 * %GFP_USER - Allocate memory on behalf of user.  May sleep.
 *
 * %GFP_KERNEL - Allocate normal kernel ram.  May sleep.
 *
 * %GFP_ATOMIC - Allocation will not sleep.  Use inside interrupt handlers.
 *
 * Additionally, the %GFP_DMA flag may be set to indicate the memory
 * must be suitable for DMA.  This can mean different things on different
 * platforms.  For example, on i386, it means that the memory must come
 * from the first 16MB.


The possible problem is clearly how you try to allocate these
pages. If you're in interrupt context you CAN'T ask for these 
with a flag GFP_KERNEL since it allows kmalloc() to sleep. And
if you try to sleep in interrupt context, you're searching for
havoc!

Regards.


- --

Angelo Dell'Aera 'buffer' 
Antifork Research, Inc.	  	http://buffer.antifork.org

PGP information in e-mail header


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAQwaGpONIzxnBXKIRAobaAJ93xFvKKwErDqul2cjas/Z11kldYQCgmFTE
/KWk6Pb+oBGy5k8SLS+dGyc=
=DfLv
-----END PGP SIGNATURE-----

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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