lkml.org 
[lkml]   [2009]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/8] Use vmalloc for large cgroups pidlist allocations
On Thu, 20 Aug 2009, Jonathan Corbet wrote:

> On Thu, 20 Aug 2009 14:14:00 -0700
> Andrew Morton <akpm@linux-foundation.org> wrote:
>
> > Hang on. Isn't this why Dave just wrote and I just rush-merged
> > lib/flex_array.c?
> >
> > Was that code evaluated for this application and judged unsuitable? If so,
> > for what reason?
>
> Should it be helpful: I wrote an overview of the flex_array API here:
>
> http://lwn.net/Articles/345273/
>
> I could format it up for addition to Documentation/ if people want.
>

It's definitely helpful for this use case, flex array can store 261,632
pid_t's on 64 bit.

Instead of reallocating new memory when the pidlist becomes smaller, it
would then be sufficient to simply shrink the flex array by freeing parts
members that are newly unused (which also avoids the oom possibility in
pidlist_resize()).

flex_array_shrink(struct flex_array *) would require element poisoning
when an element is cleared, but that's probably not far off anyways
because it has additional advantages such as preventing flex_array_get()
on an element that has not been put.


\
 
 \ /
  Last update: 2009-08-21 00:59    [W:0.062 / U:1.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site