From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030679AbdEWOmf (ORCPT ); Tue, 23 May 2017 10:42:35 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:6885 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968116AbdEWOmc (ORCPT ); Tue, 23 May 2017 10:42:32 -0400 From: Kefeng Wang To: , , zhongjiang , Qiuxishi , Yisheng Xie , Subject: [Question] Mlocked count will not be decreased Message-ID: Date: Tue, 23 May 2017 22:41:34 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.19.180] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.59244A48.0271,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: a19d903bc962e68a1cd40fc334c7f2fe Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 #include #include #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; }