linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: "Faccini, Bruno" <bruno.faccini@intel.com>
Cc: Michal Hocko <mhocko@kernel.org>,
	"cgroups@vger.kernel.org" <cgroups@vger.kernel.org>,
	linux-mm@kvack.org
Subject: Re: crash during new kmem-limited memory cgroup creation if kmem_cache has been created when previous memory cgroup were inactive
Date: Tue, 3 Oct 2017 19:09:44 +0300	[thread overview]
Message-ID: <20171003160944.ojiek7wtu3cmyow6@esperanza> (raw)
In-Reply-To: <20171002143244.lrp5nd2rf3lmjsql@dhcp22.suse.cz>

Hello Bruno,

On Mon, Oct 02, 2017 at 04:32:44PM +0200, Michal Hocko wrote:
> [CC Vldimir and linux-mm]
> 
> On Tue 19-09-17 22:42:37, Faccini, Bruno wrote:
> > The panic threada??s stack looks like :
> > ============================
> > [38212.118675] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
> > [38212.120795] IP: [<ffffffff811dbb04>] __memcg_kmem_get_cache+0xe4/0x220

Kernel memory accounting is totally unusable in 3.10, because it lacks
dcache reclaim and there are a lot of implementation bugs. The one you
caught is just one of many that have been fixed since 3.10. That's why
it stayed disabled by default until 4.x.

So IMHO the best you can do if you really want to use kernel memory
accounting is upgrade to 4.x or backport all related patches.

> > and we can easily trigger it when running one of our regression test
> > that is intended to test our software robustness against lack of
> > Kernel memory, by setting very restrictive kmem limit for a memory
> > cgroup where testa??s tasks/contexts will be attached during their
> > execution.

Lack of kernel memory typically results in OOM and killing your
software. The fact that it isn't like that in kmemcg-3.10 and you can
easily get ENOMEM, for example, while scanning a directory is actually
a bug, which was fixed in 4.x.

AFAIU you want to test ENOMEM handling paths. Then IMHO you'd better use
some kind of error injection either in userspace or in kernel, e.g. you
might want to take a look at CONFIG_FAILSLAB.

--
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>

      reply	other threads:[~2017-10-03 16:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0537E873-CE22-4E6D-912A-6C8FDCF85493@intel.com>
2017-10-02 14:32 ` Michal Hocko
2017-10-03 16:09   ` Vladimir Davydov [this message]

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=20171003160944.ojiek7wtu3cmyow6@esperanza \
    --to=vdavydov.dev@gmail.com \
    --cc=bruno.faccini@intel.com \
    --cc=cgroups@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.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