linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [Question] Mlocked count will not be decreased
@ 2017-05-23 14:41 Kefeng Wang
  2017-05-23 22:04 ` Tetsuo Handa
  2017-05-24  8:32 ` Yisheng Xie
  0 siblings, 2 replies; 14+ messages in thread
From: Kefeng Wang @ 2017-05-23 14:41 UTC (permalink / raw)
  To: linux-mm, linux-kernel, zhongjiang, Qiuxishi, Yisheng Xie,
	wangkefeng.wang

Hi All,

Mlocked in meminfo will be increasing with an small testcase, and never be released in mainline,
here is a testcase[1] to reproduce the issue, but the centos7.2/7.3 will not increase.

Is it normal?

Thanks,
Kefeng




[1] testcase
linux:~ # cat test_mlockall.sh
grep Mlocked /proc/meminfo
 for j in `seq 0 10`
 do
	for i in `seq 4 15`
	do
		./p_mlockall >> log &
	done
	sleep 0.2
done
grep Mlocked /proc/meminfo


linux:~ # cat p_mlockall.c
#include <sys/mman.h>
#include <stdlib.h>
#include <stdio.h>

#define SPACE_LEN	4096

int main(int argc, char ** argv)
{
	int ret;
	void *adr = malloc(SPACE_LEN);
	if (!adr)
		return -1;
	
	ret = mlockall(MCL_CURRENT | MCL_FUTURE);
	printf("mlcokall ret = %d\n", ret);

	ret = munlockall();
	printf("munlcokall ret = %d\n", ret);

	free(adr);
	return 0;
}

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-05-25  6:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-23 14:41 [Question] Mlocked count will not be decreased Kefeng Wang
2017-05-23 22:04 ` Tetsuo Handa
2017-05-24  8:32 ` Yisheng Xie
2017-05-24  8:57   ` Kefeng Wang
2017-05-24 10:32   ` Vlastimil Babka
2017-05-24 10:42     ` Vlastimil Babka
2017-05-24 10:49     ` Xishi Qiu
2017-05-24 11:38     ` Xishi Qiu
2017-05-24 11:52       ` Vlastimil Babka
2017-05-24 12:10         ` Xishi Qiu
2017-05-24 13:16           ` Vlastimil Babka
2017-05-25  1:16             ` Xishi Qiu
2017-05-25  6:12               ` Vlastimil Babka
2017-05-25  1:00         ` Yisheng Xie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox