Re: [PATCH] ring-buffer: Add set/clear_current_oom_origin() during allocations

2018-04-06 Thread Zhaoyang Huang
On Fri, Apr 6, 2018 at 7:36 AM, Joel Fernandes wrote: > Hi Steve, > > On Thu, Apr 5, 2018 at 12:57 PM, Joel Fernandes wrote: >> On Thu, Apr 5, 2018 at 6:43 AM, Steven Rostedt wrote: >>> On Wed, 4 Apr 2018 16:59:18 -0700 >>> Joel Fernandes wrote: >>> Happy to try anything else, BTW when the

Re: [PATCH] ring-buffer: Add set/clear_current_oom_origin() during allocations

2018-04-05 Thread Joel Fernandes
Hi Steve, On Thu, Apr 5, 2018 at 12:57 PM, Joel Fernandes wrote: > On Thu, Apr 5, 2018 at 6:43 AM, Steven Rostedt wrote: >> On Wed, 4 Apr 2018 16:59:18 -0700 >> Joel Fernandes wrote: >> >>> Happy to try anything else, BTW when the si_mem_available check >>> enabled, this doesn't happen and the

Re: [PATCH] ring-buffer: Add set/clear_current_oom_origin() during allocations

2018-04-05 Thread Joel Fernandes
Hi Steve, On Thu, Apr 5, 2018 at 6:43 AM, Steven Rostedt wrote: > On Wed, 4 Apr 2018 16:59:18 -0700 > Joel Fernandes wrote: > >> Happy to try anything else, BTW when the si_mem_available check >> enabled, this doesn't happen and the buffer_size_kb write fails >> normally without hurting anything

Re: [PATCH] ring-buffer: Add set/clear_current_oom_origin() during allocations

2018-04-05 Thread Joel Fernandes
On Thu, Apr 5, 2018 at 7:51 AM, Michal Hocko wrote: > On Wed 04-04-18 16:59:18, Joel Fernandes wrote: >> Hi Steve, >> >> On Wed, Apr 4, 2018 at 9:18 AM, Joel Fernandes wrote: >> > On Wed, Apr 4, 2018 at 9:13 AM, Steven Rostedt wrote: >> > [..] >> >>> >> >>> Also, I agree with the new patch and i

Re: [PATCH] ring-buffer: Add set/clear_current_oom_origin() during allocations

2018-04-05 Thread Michal Hocko
On Wed 04-04-18 16:59:18, Joel Fernandes wrote: > Hi Steve, > > On Wed, Apr 4, 2018 at 9:18 AM, Joel Fernandes wrote: > > On Wed, Apr 4, 2018 at 9:13 AM, Steven Rostedt wrote: > > [..] > >>> > >>> Also, I agree with the new patch and its nice idea to do that. > >> > >> Thanks, want to give it a

Re: [PATCH] ring-buffer: Add set/clear_current_oom_origin() during allocations

2018-04-05 Thread Steven Rostedt
On Wed, 4 Apr 2018 16:59:18 -0700 Joel Fernandes wrote: > Happy to try anything else, BTW when the si_mem_available check > enabled, this doesn't happen and the buffer_size_kb write fails > normally without hurting anything else. Can you remove the RETRY_MAYFAIL and see if you can try again? It

Re: [PATCH] ring-buffer: Add set/clear_current_oom_origin() during allocations

2018-04-04 Thread Joel Fernandes
Hi Steve, On Wed, Apr 4, 2018 at 9:18 AM, Joel Fernandes wrote: > On Wed, Apr 4, 2018 at 9:13 AM, Steven Rostedt wrote: > [..] >>> >>> Also, I agree with the new patch and its nice idea to do that. >> >> Thanks, want to give it a test too? With the latest tree and the below diff, I can still OO

Re: [PATCH] ring-buffer: Add set/clear_current_oom_origin() during allocations

2018-04-04 Thread Joel Fernandes
On Wed, Apr 4, 2018 at 9:13 AM, Steven Rostedt wrote: [..] >> >> Also, I agree with the new patch and its nice idea to do that. > > Thanks, want to give it a test too? Sure, I'll try it in a few hours. I am thinking of trying some of the memory pressure tools we have. Likely by noon or so once I

Re: [PATCH] ring-buffer: Add set/clear_current_oom_origin() during allocations

2018-04-04 Thread Steven Rostedt
On Wed, 4 Apr 2018 09:03:47 -0700 Joel Fernandes wrote: > > for the tests. Note, without this, I tried to allocate all memory > > (bisecting it with allocations that failed and allocations that > > succeeded), and couldn't trigger an OOM :-/ > > I guess you need to have something *else* other

Re: [PATCH] ring-buffer: Add set/clear_current_oom_origin() during allocations

2018-04-04 Thread Joel Fernandes
On Wed, Apr 4, 2018 at 9:00 AM, Steven Rostedt wrote: > On Wed, 4 Apr 2018 11:53:10 -0400 > Steven Rostedt wrote: > >> @@ -1162,35 +1163,60 @@ static int rb_check_pages(struct ring_buffer_per_cpu >> *cpu_buffer) >> static int __rb_allocate_pages(long nr_pages, struct list_head *pages, int >> c

Re: [PATCH] ring-buffer: Add set/clear_current_oom_origin() during allocations

2018-04-04 Thread Steven Rostedt
On Wed, 4 Apr 2018 11:53:10 -0400 Steven Rostedt wrote: > @@ -1162,35 +1163,60 @@ static int rb_check_pages(struct ring_buffer_per_cpu > *cpu_buffer) > static int __rb_allocate_pages(long nr_pages, struct list_head *pages, int > cpu) > { > struct buffer_page *bpage, *tmp; > + bool u

[PATCH] ring-buffer: Add set/clear_current_oom_origin() during allocations

2018-04-04 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" As si_mem_available() can say there is enough memory even though the memory available is not useable by the ring buffer, it is best to not kill innocent applications because the ring buffer is taking up all the memory while it is trying to allocate a great deal of