From: Michal Hocko <mhocko@kernel.org>
To: Shayan Pooya <shayan@liveve.org>
Cc: cgroups mailinglist <cgroups@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-mm@kvack.org
Subject: Re: bug in memcg oom-killer results in a hung syscall in another process in the same cgroup
Date: Mon, 11 Jul 2016 08:41:50 +0200 [thread overview]
Message-ID: <20160711064150.GB5284@dhcp22.suse.cz> (raw)
In-Reply-To: <CABAubThf6gbi243BqYgoCjqRW36sXJuJ6e_8zAqzkYRiu0GVtQ@mail.gmail.com>
On Sat 09-07-16 16:49:32, Shayan Pooya wrote:
> I came across the following issue in kernel 3.16 (Ubuntu 14.04) which
> was then reproduced in kernels 4.4 LTS:
> After a couple of of memcg oom-kills in a cgroup, a syscall in
> *another* process in the same cgroup hangs indefinitely.
>
> Reproducing:
>
> # mkdir -p strace_run
> # mkdir /sys/fs/cgroup/memory/1
> # echo 1073741824 > /sys/fs/cgroup/memory/1/memory.limit_in_bytes
> # echo 0 > /sys/fs/cgroup/memory/1/memory.swappiness
> # for i in $(seq 1000); do ./call-mem-hog
> /sys/fs/cgroup/memory/1/cgroup.procs & done
>
> Where call-mem-hog is:
> #!/bin/sh
> set -ex
> echo $$ > $1
> echo "Adding $$ to $1"
> strace -ff -tt ./mem-hog 2> strace_run/$$
>
>
> Initially I thought it was a userspace bug in dash as it only happened
> with /bin/sh (which points to dash) and not with bash. I see the
> following hanging processes:
>
> USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
> root 20999 0.0 0.0 4508 100 pts/6 S 16:28 0:00
> /bin/sh ./call-mem-hog /sys/fs/cgroup/memory/1/cgroup.procs
>
> However, when using strace, I noticed that sometimes there is actually
> a mem-hog process hanging on sbrk syscall (Of course the
> memory.oom_control is 0 and this is not expected).
> Sending an ABRT signal to the waiting strace process then resulted in
> the mem-hog process getting oom-killed by the kernel.
Could you post the stack trace of the hung oom victim? Also could you
post the full kernel log?
--
Michal Hocko
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2016-07-11 6:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-09 23:49 Shayan Pooya
2016-07-11 6:41 ` Michal Hocko [this message]
2016-07-11 17:40 ` Shayan Pooya
2016-07-11 18:33 ` Shayan Pooya
2016-07-12 7:19 ` Michal Hocko
2016-07-12 15:35 ` Shayan Pooya
2016-07-12 15:52 ` Konstantin Khlebnikov
2016-07-12 16:52 ` Oleg Nesterov
2016-07-12 22:57 ` Shayan Pooya
2016-07-14 13:22 ` Oleg Nesterov
2016-07-14 15:35 ` Shayan Pooya
2016-07-15 16:58 ` Shayan Pooya
2016-07-18 13:53 ` Oleg Nesterov
2016-07-13 8:08 ` Michal Hocko
2016-07-12 7:17 ` Michal Hocko
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=20160711064150.GB5284@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=shayan@liveve.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