From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx105.postini.com [74.125.245.105]) by kanga.kvack.org (Postfix) with SMTP id 9DA326B030A for ; Wed, 14 Dec 2011 15:13:23 -0500 (EST) Received: by pbaa13 with SMTP id a13so1201171pba.14 for ; Wed, 14 Dec 2011 12:13:22 -0800 (PST) MIME-Version: 1.0 From: Laurent Chavey Date: Wed, 14 Dec 2011 12:12:41 -0800 Message-ID: Subject: question: why use vzalloc() and vzfree() in mem_cgroup_alloc() and mem_cgroup_free() Content-Type: multipart/alternative; boundary=e89a8ff1c8c0e4afd404b412ffaf Sender: owner-linux-mm@kvack.org List-ID: To: linux-mm@kvack.org Cc: LKML , laurent chavey , glommer@parallels.com --e89a8ff1c8c0e4afd404b412ffaf Content-Type: text/plain; charset=ISO-8859-1 context: While testing patches from Glauber Costa, "adding support for tcp memory allocation in kmem cgroup", we hit a BUG_ON(in_interrupt()) in vfree(). The code path in question is taken because the izeof(struct mem_cgroup) is >= PAGE_SIZE in the call to mem_cgroup_free(), Since socket may get free in an interrupt context, the combination of vzalloc(), vfree() should not be used when accounting for socket mem (unless the code is modified). question: Is there reasons why vzalloc() is used in mem_cgroup_alloc() ? . are we seeing mem fragmentations to level that fail kzalloc() or kmalloc(). . do we have empirical data that shows the allocation failure rate for kmalloc(), kzalloc() per alloc size (num pages) --e89a8ff1c8c0e4afd404b412ffaf Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
context:

While testing patches from Glauber Costa, "adding suppor= t
for tcp memory allocation=A0in kmem cgroup", w= e hit a
BUG_ON(in_interrupt()) in vfree(). The code path in questi= on
is taken because the=A0izeof(struct mem_cg= roup) is
>=3D PAGE_SIZE=A0in the call to=A0mem_cgroup_free(),=A0

Since socket may get free in an interrupt contex= t,
the combination of vzalloc(), vfree() should not be used
<= /div>
when accounting for socket mem (unless the code is modified).

question:

Is there reasons why vzalloc() is used in mem= _cgroup_alloc() ?
=A0 =A0 . are we seeing me= m fragmentations to level that fail
=A0 =A0 =A0 kzalloc() or kmalloc().=A0
= =A0 =A0 . do we have=A0empirical=A0data that shows the allocation failure
=A0 =A0 =A0 rate for kmalloc(), kzalloc() per alloc size (num pages)
=A0 =A0 =A0=A0

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