Re: question: why use vzalloc() and vzfree() in mem_cgroup_alloc() and mem_cgroup_free()

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

 



On Dec 14, 12:12 pm, Laurent Chavey <chavey@xxxxxxxxxx> 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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  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: <a href


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]