From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail172.messagelabs.com (mail172.messagelabs.com [216.82.254.3]) by kanga.kvack.org (Postfix) with SMTP id DFCAE90011A for ; Thu, 14 Jul 2011 02:45:49 -0400 (EDT) Message-ID: <1310625925.65469.YahooMailNeo@web162002.mail.bf1.yahoo.com> Date: Wed, 13 Jul 2011 23:45:25 -0700 (PDT) From: Pintu Agarwal Reply-To: Pintu Agarwal Subject: Memory allocation from ZONE_HIGHMEM ??? MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-235916557-1310625925=:65469" Sender: owner-linux-mm@kvack.org List-ID: To: Linux-MM , LKML --0-235916557-1310625925=:65469 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi,=0A=A0=0AI have a question regarding kernel memory allocation(using kmal= loc)=A0from ZONE_HIGHMEM zone.=0A=A0=0AI have a custom linux kernel2.6.36 r= unning on linux mobile (arm cortexA9)=0AI have two zones on my system as sh= own by buddyinfo.=0A=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A/opt/home/root # cat /proc/buddyinfo=0ANod= e 0, zone=A0=A0 Normal=A0=A0=A0=A0=A0 2=A0=A0=A0=A0 32=A0=A0=A0=A0 22=A0=A0= =A0=A0 14=A0=A0=A0=A0 12=A0=A0=A0=A0=A0 4=A0=A0=A0=A0 12=A0=A0=A0=A0=A0 3= =A0=A0=A0=A0=A0 0=A0=A0=A0=A0=A0 1=A0=A0=A0=A0 23=0ANode 0, zone=A0 HighMem= =A0=A0=A0 529=A0=A0=A0 243=A0=A0=A0 114=A0=A0=A0=A0 43=A0=A0=A0=A0 25=A0=A0= =A0=A0 23=A0=A0=A0=A0 19=A0=A0=A0=A0 19=A0=A0=A0=A0 16=A0=A0=A0=A0 14=A0=A0= =A0=A0 27=0A=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=0A=A0=0AWhen I do memory allocation using kmalloc, th= e pages are allocated from Normal zone.=0AMy=A0allocation size=A0is for=A0o= rder-10 pages =3D=A023 * 1024 * PAGE_SIZE =3D 80MB=0AIf I use more than tha= t my allocation will fail which is obvious.=0A=A0=0ABut I want to specifica= lly allocate=A0pages from ZONE_HIGHMEM instead of Normal zone.=0AHow to exp= licitly do that in kernel?=0A=A0=0AIf somebody have tried this please let m= e know.=0A=A0=0A=A0=0A=A0=0AThanks, Regards,=0APintu --0-235916557-1310625925=:65469 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,
 
I have a question regarding kernel memory alloca= tion(using kmalloc) from ZONE_HIGHMEM zone.
 
I have a custom linux kernel2.6.36 running on li= nux mobile (arm cortexA9)
I have two zones on my system as shown by buddyi= nfo.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
/opt/home/root # cat /proc/buddyinfo
Node 0, = zone   Normal      2   &n= bsp; 32     22     14  &n= bsp;  12      4     12&nb= sp;     3      0  &n= bsp;   1     23
Node 0, zone  HighMem=     529    243    114 &nb= sp;   43     25     23&nb= sp;    19     19    = 16     14     27
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 
When I do memory allocation using kmalloc, the p= ages are allocated from Normal zone.
My allocation size is for order-1= 0 pages =3D 23 * 1024 * PAGE_SIZE =3D 80MB
If I use more than that my allocation will fail = which is obvious.
 
But I want to specifically allocate pages f= rom ZONE_HIGHMEM instead of Normal zone.
How to explicitly do that in kernel?
 
If somebody have tried this please let me know.<= /div>
 
 
 
Thanks, Regards,
Pintu
 
 
--0-235916557-1310625925=:65469-- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org