From: MinChan Kim <minchan.kim@gmail.com>
To: linux mm <linux-mm@kvack.org>
Cc: linux kernel <linux-kernel@vger.kernel.org>,
Lee Schermerhorn <Lee.Schermerhorn@hp.com>,
Nick Piggin <npiggin@suse.de>
Subject: [BUG] mlocked page counter mismatch
Date: Wed, 28 Jan 2009 19:28:41 +0900 [thread overview]
Message-ID: <20090128102841.GA24924@barrios-desktop> (raw)
After executing following program, 'cat /proc/meminfo' shows
following result.
--
# cat /proc/meminfo
..
Unevictable: 8 kB
Mlocked: 8 kB
..
-- test program --
#include <stdio.h>
#include <sys/mman.h>
int main()
{
char buf[64] = {0,};
char *ptr;
int k;
int i,j;
int x,y;
mlockall(MCL_CURRENT);
sprintf(buf, "cat /proc/%d/maps", getpid());
system(buf);
return 0;
}
--
It seems mlocked page counter have a problem.
After I diged in source, I found that try_to_unmap_file called
try_to_mlock_page about shared mapping pages
since other vma had VM_LOCKED flag.
After all, try_to_mlock_page called mlock_vma_page.
so, mlocked counter increased
But, After I called munlockall intentionally, the counter work well.
In case of munlockall, we already had a mmap_sem about write.
Such a case, try_to_mlock_page can't call mlock_vma_page.
so, mlocked counter didn't increased.
As a result, the counter seems to be work well but I think
it also have a problem.
--
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 reply other threads:[~2009-01-28 10:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-28 10:28 MinChan Kim [this message]
2009-01-28 14:38 ` KOSAKI Motohiro
2009-01-28 15:33 ` Lee Schermerhorn
2009-01-28 23:55 ` MinChan Kim
2009-01-28 23:57 ` MinChan Kim
2009-01-29 1:48 ` Lee Schermerhorn
2009-01-29 4:29 ` MinChan Kim
2009-01-29 12:35 ` KOSAKI Motohiro
2009-01-29 14:44 ` Lee Schermerhorn
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=20090128102841.GA24924@barrios-desktop \
--to=minchan.kim@gmail.com \
--cc=Lee.Schermerhorn@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=npiggin@suse.de \
/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