linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Jesper Dangaard Brouer <brouer@redhat.com>
Cc: linux-mm <linux-mm@kvack.org>
Subject: Re: Memory exhaustion testing?
Date: Fri, 13 Nov 2015 14:54:37 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1511131452130.6173@chino.kir.corp.google.com> (raw)
In-Reply-To: <20151112215531.69ccec19@redhat.com>

On Thu, 12 Nov 2015, Jesper Dangaard Brouer wrote:

> Hi MM-people,
> 
> How do you/we test the error paths when the system runs out of memory?
> 
> What kind of tools do you use?
> or Any tricks to provoke this?
> 

Depends on the paths that you want to exercise when the system is out of 
memory :)  If it's just to trigger the oom killer, then no kernel module 
should be necessary if you're not limited by any cgroup and just disable 
swap and start off an anonymous memory hog that consumes all memory.

> For testing my recent change to the SLUB allocator, I've implemented a
> crude kernel module that tries to allocate all memory, so I can test the
> error code-path in kmem_cache_alloc_bulk.
> 

Trying to exercise certain paths under oom is difficult because the oom 
killer will usually quickly kill a process or you'll get hung up somewhere 
else that needs memory before the function you want to test.  This is why 
failslab had been used in the past, and does a good job at runtime 
testing.  My suggestion would just be to instrument the kernel to randomly 
fail as though the system is oom and ensure that it works.

--
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:[~2015-11-13 22:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12 20:55 Jesper Dangaard Brouer
2015-11-13 22:54 ` David Rientjes [this message]
2015-11-16 14:24   ` Jesper Dangaard Brouer
2015-11-17 13:21     ` Jesper Dangaard Brouer
2015-11-19 20:40       ` David Rientjes
2015-11-20 13:09         ` Jesper Dangaard Brouer
2015-11-20 23:23           ` David Rientjes
2015-11-20 23:28             ` Andrew Morton
2015-11-14  8:23 ` Tetsuo Handa
2015-11-16 14:43   ` Jesper Dangaard Brouer

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=alpine.DEB.2.10.1511131452130.6173@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=brouer@redhat.com \
    --cc=linux-mm@kvack.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