linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joel Fernandes <joelaf@google.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Michal Hocko <mhocko@kernel.org>,
	Zhaoyang Huang <huangzhaoyang@gmail.com>,
	Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1] ringbuffer: Don't choose the process with adj equal OOM_SCORE_ADJ_MIN
Date: Tue, 10 Apr 2018 11:39:24 -0700	[thread overview]
Message-ID: <CAJWu+ooC4hCK31srhBFoAf=qwfFFOyTGsjRRJ9PdxaVsb6waQQ@mail.gmail.com> (raw)
In-Reply-To: <20180410140036.650a8732@gandalf.local.home>

Hi Steve,

On Tue, Apr 10, 2018 at 11:00 AM, Steven Rostedt <rostedt@goodmis.org> wrote:
> On Tue, 10 Apr 2018 09:45:54 -0700
> Joel Fernandes <joelaf@google.com> wrote:
>
>> > diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
>> > index a0233edc0718..807e2bcb21b3 100644
>> > --- a/include/linux/ring_buffer.h
>> > +++ b/include/linux/ring_buffer.h
>> > @@ -106,7 +106,8 @@ __poll_t ring_buffer_poll_wait(struct ring_buffer *buffer, int cpu,
>> >
>> >  void ring_buffer_free(struct ring_buffer *buffer);
>> >
>> > -int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size, int cpu);
>> > +int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size,
>> > +                       int cpu, int rbflags);
>> >
>> >  void ring_buffer_change_overwrite(struct ring_buffer *buffer, int val);
>> >
>> > @@ -201,6 +202,7 @@ int ring_buffer_print_page_header(struct trace_seq *s);
>> >
>> >  enum ring_buffer_flags {
>> >         RB_FL_OVERWRITE         = 1 << 0,
>> > +       RB_FL_NO_RECLAIM        = 1 << 1,
>>
>> But the thing is, set_oom_origin doesn't seem to be doing the
>> desirable thing every time anyway as per my tests last week [1] and
>> the si_mem_available check alone seems to be working fine for me (and
>> also Zhaoyang as he mentioned).
>
> But did you try it with just plain GFP_KERNEL, and not RETRY_MAYFAIL.

Yes I tried it with just GFP_KERNEL as well. What I did based on your
suggestion for testing the OOM hint is:
1. Comment the si_mem_available check
2. Do only GFP_KERNEL

The system gets destabilized with this combination even with the OOM
hint. These threads are here:
https://lkml.org/lkml/2018/4/5/720

> My tests would always trigger the allocating task without the
> RETRY_MAYFAIL, but with RETRY_MAYFAIL it would sometimes take out other
> tasks.
>
>>
>> Since the problem Zhaoyang is now referring to is caused because of
>> calling set_oom_origin in the first place, can we not just drop that
>> patch and avoid adding more complexity?
>
> Actually, I'm thinking of dropping the MAYFAIL part. It really should
> be the one targeted if you are extending the ring buffer.

This then sounds like it should be fixed in -mm code? If we're giving
the hint and its not getting killed there then that's an -mm issue.

> I could add two loops. One that does NORETRY without the oom origin,
> and if it succeeds, its fine. But if it requires reclaim, it will then
> set oom_origin and go harder (where it should be the one targeted).
>
> But that may be pointless, because if NORETRY succeeds, there's not
> really any likelihood of oom triggering in the first place.

Yes.

>
>>
>> IMHO I feel like for things like RB memory allocation, we shouldn't
>> add a knob if we don't need to.
>
> It was just a suggestion.

Cool, I understand.

>>
>> Also I think Zhaoyang is developing for Android too since he mentioned
>> he ran CTS tests so we both have the same "usecase" but he can feel
>> free to correct me if that's not the case ;)
>
> I think if you are really worried with the task being killed by oom,
> then I agree with Michal and just fork a process to do the allocation
> for you.

Yes I agree. So lets just do that and no other patches additional
patches are needed then. Let me know if there's anything else I
missed?

Also I got a bit confused, I reread all the threads. Zhaoyang's
current issue is that the OOM hint *IS* working which is what
triggered your patch to toggle the behavior through an option. Where
was in this message we are discussing that the OOM hint doesn't always
work which is not Zhaoyang's current issue. Let me know if I missed
something? Sorry if I did.

thanks,

- Joel

  reply	other threads:[~2018-04-10 18:39 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-08  2:16 [PATCH v1] ringbuffer: Don't choose the process with adj equal OOM_SCORE_ADJ_MIN Zhaoyang Huang
2018-04-08  3:48 ` Steven Rostedt
2018-04-08  5:54   ` Zhaoyang Huang
2018-04-08 12:47     ` Steven Rostedt
2018-04-09  0:56       ` Zhaoyang Huang
2018-04-09 13:49         ` Steven Rostedt
2018-04-10  0:32           ` Zhaoyang Huang
2018-04-10  2:32             ` Zhaoyang Huang
2018-04-10  3:12               ` Steven Rostedt
2018-04-10  3:41                 ` Zhaoyang Huang
2018-04-10  6:14                   ` Michal Hocko
2018-04-10  6:39                     ` Zhaoyang Huang
2018-04-10  7:49                       ` Michal Hocko
2018-04-10  8:04                         ` Zhaoyang Huang
2018-04-10  8:12                           ` Michal Hocko
2018-04-10  8:38                             ` Zhaoyang Huang
2018-04-10  9:01                               ` Michal Hocko
2018-04-10  9:32                                 ` Zhaoyang Huang
2018-04-10  9:51                                   ` Zhaoyang Huang
2018-04-10 10:49                                   ` Michal Hocko
2018-04-10 12:23                                     ` Steven Rostedt
2018-04-10 12:27                                       ` Michal Hocko
2018-04-10 12:36                                         ` Steven Rostedt
2018-04-10 13:13                                           ` Steven Rostedt
2018-04-10 13:14                                             ` Steven Rostedt
2018-04-10 16:45                                             ` Joel Fernandes
2018-04-10 18:00                                               ` Steven Rostedt
2018-04-10 18:39                                                 ` Joel Fernandes [this message]
2018-04-10 19:05                                                   ` Steven Rostedt
2018-04-11  7:48                                                   ` Zhaoyang Huang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJWu+ooC4hCK31srhBFoAf=qwfFFOyTGsjRRJ9PdxaVsb6waQQ@mail.gmail.com' \
    --to=joelaf@google.com \
    --cc=huangzhaoyang@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@kernel.org \
    --cc=mingo@kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).