public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Qian Cai <cai@lca.pw>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	linux kernel <linux-kernel@vger.kernel.org>,
	gkohli@codeaurora.org
Subject: Re: kernel BUG at kernel/sched/core.c:3490!
Date: Mon, 7 Jan 2019 18:56:45 +0100	[thread overview]
Message-ID: <20190107175644.GB7636@redhat.com> (raw)
In-Reply-To: <46089f1c-ad72-c96c-2f35-c2f60e726462@lca.pw>

On 01/07, Qian Cai wrote:
>
>
> On 1/7/19 8:52 AM, Peter Zijlstra wrote:
> > On Tue, Jan 01, 2019 at 12:44:35AM -0500, Qian Cai wrote:
> >> Running some mmap() workloads to put the system on low memory situation with
> >> swapping and OOM, and then it trigger this BUG(),
> >>
> >> void __noreturn do_task_dead(void)
> >> {
> >>         /* Causes final put_task_struct in finish_task_switch(): */
> >>         set_special_state(TASK_DEAD);
> >>
> >>         /* Tell freezer to ignore us: */
> >>         current->flags |= PF_NOFREEZE;
> >>
> >>         __schedule(false);
> >>         BUG();
> >>
> >>         /* Avoid "noreturn function does return" - but don't continue if BUG()
> >> is a NOP: */
> >>         for (;;)
> >>                 cpu_relax();
> >> }
> >
> > This would mean that we somehow loose the TASK_DEAD state before hitting
> > schedule(), but that is something that should be avoided by
> > set_special_state(), which is supposed to serialize against concurrent
> > wake-ups.

or may be pick_next_task() somehow returns the deactivated TASK_DEAD task?

> > How readily does this reproduce?
>
> Running LTP oom01 [1] triggered it at least once in five attempts every time so
> far on v4.20+. Have not tried much on v5.0-rc1 yet.

Can you add

	pr_crit("XXX: %ld %d\n", current->state, current->on_rq);

before that BUG() and reproduce?

Oleg.


  reply	other threads:[~2019-01-07 17:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-01  5:44 kernel BUG at kernel/sched/core.c:3490! Qian Cai
2019-01-07 13:52 ` Peter Zijlstra
2019-01-07 14:36   ` Qian Cai
2019-01-07 17:56     ` Oleg Nesterov [this message]
2019-01-11 10:37       ` Kohli, Gaurav
2019-01-11 16:17         ` Qian Cai
2019-01-12  8:54           ` Kohli, Gaurav
2019-01-16 17:32             ` Oleg Nesterov

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=20190107175644.GB7636@redhat.com \
    --to=oleg@redhat.com \
    --cc=cai@lca.pw \
    --cc=gkohli@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.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