[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1571311951-8524-1-git-send-email-lirongqing@baidu.com>
Date: Thu, 17 Oct 2019 19:32:31 +0800
From: Li RongQing <lirongqing@...du.com>
To: hughd@...gle.com, linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: [PATCH] mm: remove VM_ACCT(PAGE_SIZE) when charge and uncharge
VM_ACCT(PAGE_SIZE) is one, and it is unnecessary to multiply by it
Signed-off-by: Li RongQing <lirongqing@...du.com>
---
mm/shmem.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/mm/shmem.c b/mm/shmem.c
index cd570cc79c76..f01df46ef2ff 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -202,14 +202,13 @@ static inline int shmem_acct_block(unsigned long flags, long pages)
if (!(flags & VM_NORESERVE))
return 0;
- return security_vm_enough_memory_mm(current->mm,
- pages * VM_ACCT(PAGE_SIZE));
+ return security_vm_enough_memory_mm(current->mm, pages);
}
static inline void shmem_unacct_blocks(unsigned long flags, long pages)
{
if (flags & VM_NORESERVE)
- vm_unacct_memory(pages * VM_ACCT(PAGE_SIZE));
+ vm_unacct_memory(pages);
}
static inline bool shmem_inode_acct_block(struct inode *inode, long pages)
--
2.16.2
Powered by blists - more mailing lists