lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <daec6a41-d318-4142-a3e1-14b8af64af66@b14g2000prn.googlegroups.com>
Date:	Wed, 14 Dec 2011 16:52:50 -0800 (PST)
From:	Chris Snook <csnook@...gle.com>
To:	Kernel-team <kernel-team@...gle.com>
Cc:	Laurent Chavey <chavey@...gle.com>, linux-mm@...ck.org,
	LKML <linux-kernel@...r.kernel.org>, glommer@...allels.com
Subject: Re: question: why use vzalloc() and vzfree() in mem_cgroup_alloc()
 and mem_cgroup_free()

On Dec 14, 12:12 pm, Laurent Chavey <chavey@...gle.com> wrote:
> 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(),

Still, or again? A cursory search turns up this patch:

https://lkml.org/lkml/2010/9/27/147

but I don't have handy any further information about how it fared.

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

Agreed, but why does socket freeing cause struct mem_cgroup to be
freed? I think I'm missing something about the kmem cgroup
implementation.

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

Laziness? Last I checked, OpenAFS still called vmalloc() in the
pageout path, which is a no-no of similar magnitude, because handling
the failure properly is difficult to code and even more difficult to
test, and nobody is seeing machines deadlock often enough to justify
the development effort.

If we're having significant failures in allocating two consecutive
pages, we'll probably have other problems too, but there are
conditions where being able to vzalloc that could save you. I suspect
they're less common than conditions where vzalloc in interrupt context
would burn you, but I have no empirical data to support that.

-- Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ