lkml.org 
[lkml]   [2019]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mm: remove VM_ACCT(PAGE_SIZE) when charge and uncharge
Date
VM_ACCT(PAGE_SIZE) is one, and it is unnecessary to multiply by it

Signed-off-by: Li RongQing <lirongqing@baidu.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
\
 
 \ /
  Last update: 2019-10-17 13:33    [W:0.028 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site