lkml.org 
[lkml]   [2011]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] trace: Set __GFP_NORETRY flag for ring buffer allocating process
On Thu, 9 Jun 2011, Steven Rostedt wrote:

> > Unfortunately, __GFP_NORETRY is racy and don't work as expected.
> > If free memory is not enough, the thread may start to reclaim and
> > another thread can steal the reclaimed memory. And thread0 don't retry.
> >
> > Then, thread0's alloc page may fail even though system have enough reclaimable
> > memory.
> >
> > thread0 thread1
> > ---------------------------------------------------------------
> > alloc_pages()
> > get_page_from_freelist() -> fail
> > try_to_free_pages()
> > alloc_pages()
> > get_page_from_freelist() -> success
> > get_page_from_freelist() -> fail again
> >
> > I think this is mm issue, and afaik, Minchan and some developers are
> > working on fixing it. but _now_ your patch doesn't work.
>
> Have you seen this fail in practice?
>
> I'm not too concern if it only triggers when memory is tight. But if it
> is triggering on normal cases, then that worries me.
>

It would only happen if there was an antagonist that stole the reclaimed
pages before your __GFP_NORETRY allocation could allocate them, resulting
in the system being oom again as it was before reclaim occurred. Without
__GFP_NORETRY, we'd automatically retry these allocations in a loop until
we found the memory since they are order-0, so the only side effect would
be an increased latency in the allocation. I think if we still end up oom
after reclaiming memory that was allocated by another thread that we
probably don't want to be expanding the ring buffer and, thus, I see no
problem with just failing.


\
 
 \ /
  Last update: 2011-06-09 21:45    [from the cache]
©2003-2011 Jasper Spaans