LKML Archive on
help / color / mirror / Atom feed
From: Michal Hocko <>
To: "long.wanglong" <>
	"" <>,
Subject: Re: does the semantics of MAP_LOCKED is equal to mlock() function?
Date: Tue, 20 Jan 2015 13:58:17 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Tue 20-01-15 11:23:40, long.wanglong wrote:
> hi, Michal Hocko
> sorry for the wrong description in the email. i run the two testcase in kernel v3.10.63, not
> the latest kernel.
> in kernel v3.18, the two testcases can not invoke OOM killer.
> The problem comes from the LTP tests, because the v3.10.61 lts apply the following patch:
> f8a5117916dd2871c056963bf5ee0d1101c10099 mm: memcg: handle non-error OOM situations more gracefully
> f79d6a468980516cbfb9e01313c846b82b9d2e7e mm: memcg: do not trap chargers with full callstack on OOM
> 7a147e0c45a8fa198ade4128bdcbf8592f48843e mm: memcg: rework and document OOM waiting and wakeup
> 11f34787b50ce71f66b85ad8790beaa5eee3f897 mm: memcg: enable memcg OOM killer only for user faults
> as you said in:
> "
> The primary issue is that mmap doesn't report a failure if MAP_LOCKED fails to populate the area. Is
> this the correct/expected behavior?
> "
> There is another problem:
> in kernel v3.10.63  testcase 1 can not invoke OOM, but testcase2 can invoke OOM.

Both mlock and mmap(MAP_LOCKED) are using the same way to fault pages
backing mmaped area so they both are supposed to fail in the same way.
Meaning OOM before the above rework and ENOMEM with the change.
Maybe both of them are using a different exit paths when something is
faulted in and OOM happens for one while not for the other. strace would
tell you that.
Michal Hocko

      reply	other threads:[~2015-01-20 12:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-19  6:17 long.wanglong
2015-01-19  9:46 ` Michal Hocko
2015-01-19 11:01   ` Michal Hocko
2015-01-20  3:23     ` long.wanglong
2015-01-20 12:58       ` Michal Hocko [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:

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

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: does the semantics of MAP_LOCKED is equal to mlock() function?' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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