lkml.org 
[lkml]   [2015]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: does the semantics of MAP_LOCKED is equal to mlock() function?
On Mon 19-01-15 10:46:56, Michal Hocko wrote:
[...]
> > testcase 2: mmap without MAP_LOCKED flag and the call mlock (memsize = 8192)
> >
> > 185 p = mmap(NULL, memsize, PROT_WRITE | PROT_READ,
> > 186 MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
> > 187 if (p == MAP_FAILED)
> > 188 err(1, "mmap(lock) failed");
> > 189
> > 190 if (mlock(p, memsize) == -1)
> > 191 err(1, "mlock failed")
> >
> > expect: invoke OOM killer.
> > result: invoke OOM killer.

Are you sure about this? memcg OOM killer shouldn't trigger even from
mlock path. It should just lead to ENOMEM. If you see the OOM killer
then it is probably coming from a page fault from a different source.
strace of your test would tell you more.
--
Michal Hocko
SUSE Labs


\
 
 \ /
  Last update: 2015-01-19 12:21    [W:0.061 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site