Re: [PATCH v2] cgroups: make cftype.unregister_event()void-returning
From: KAMEZAWA Hiroyuki
Date: Mon May 10 2010 - 02:33:05 EST
On Mon, 10 May 2010 15:08:15 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:
> On Sun, 9 May 2010 03:10:22 +0300
> "Kirill A. Shutemov" <kirill@xxxxxxxxxxxxx> wrote:
>
> > Since we unable to handle error returned by cftype.unregister_event()
> > properly, let's make the callback void-returning.
> >
> > mem_cgroup_unregister_event() has been rewritten to be "never fail"
> > function. On mem_cgroup_usage_register_event() we save old buffer
> > for thresholds array and reuse it in mem_cgroup_usage_unregister_event()
> > to avoid allocation.
> >
> > Signed-off-by: Kirill A. Shutemov <kirill@xxxxxxxxxxxxx>
>
> Hmm, just reusing buffer isn't enough ?
> as
> tmp = memory->thresholds;
> reduce entries on tmp
> And what happens when
>
> register
> register
> register
> unregister (use preallocated buffer)
> unregister ????
> unregister
>
Ah, sorry my eyes were wrong.
The fix seems to work.
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/