Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp880144ybg; Fri, 18 Oct 2019 08:43:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwD3sOPZ4bjapaTb/JSJoH3euhyBVlV6JurUuog4WmSzDGxWrW/1zqY8Kr/5JzRS/Kw2hQN X-Received: by 2002:a17:906:3415:: with SMTP id c21mr9529567ejb.190.1571413388368; Fri, 18 Oct 2019 08:43:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571413388; cv=none; d=google.com; s=arc-20160816; b=iApa6Xz66gZbuAmcqNIhCaIY4WMzCUF1H2jh7eZ0ZTQuyOQMAha6o5OrQ2YIkVTwra SOBkbAN48oVVAX0IfRN6ahTmJEb97H7YgjS54Yqc+1oGglrsKJ7M6osJQp9KdV+aqRdd mZfQtdcpNQkzvdilg8yzEAvxBreUJRy7u9rSJNQ/80ab/xJMrPycbqeq+hAf1grSUP1N ECJUtBPm6lnzO63IXPhcV8thSy95KlxYDwEv1aW2RZZU13ai/0GzdtgygOHCrTcRcSwS 1XjcBwmh2XgbBKNs16KYqYd38Xl0fBxLcw8XU9qXm3Jp7kY2GCwGsEMCwjX0AC6vXAcf zZqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from; bh=cH85xUWnsRMAW6lniL5kdwokKYZDJgjuWP/St3djiSA=; b=l/py+WybCeqG/EzyphV7NV4X/W2TCSBts3zutLdK5RK7Xkd04gSU9jy16cO1YCmAeg 2j2qc8AEPsCc4WM8TFeBGg2bcTffgxzPHMxS76sZwcO/XHvW4ppoL9krH5yOpBe3OihP A9M70Lo5Hsiy0dNXuGP7BgCv4JdcaiDF3b9VsKSHYAnlHrC3HP2mmXJxmIpdMj84G/aT XxBfN312XbXEQmoGvX9ans2ey9vYU9yqgOOQ/VBkt0R20YwNRDW0emieMF8+37WppJsH WAj003ObJcTPwiADvM+oby9ZfiZCWFpZU0nz7JMvcxokdniXVQtueiiEsnXDE2G6fvB2 OOdA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m21si4265944edc.153.2019.10.18.08.42.45; Fri, 18 Oct 2019 08:43:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406008AbfJQLcp (ORCPT + 99 others); Thu, 17 Oct 2019 07:32:45 -0400 Received: from mx60.baidu.com ([61.135.168.60]:18542 "EHLO tc-sys-mailedm04.tc.baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388727AbfJQLcp (ORCPT ); Thu, 17 Oct 2019 07:32:45 -0400 Received: from localhost (cp01-cos-dev01.cp01.baidu.com [10.92.119.46]) by tc-sys-mailedm04.tc.baidu.com (Postfix) with ESMTP id F2163236C006; Thu, 17 Oct 2019 19:32:30 +0800 (CST) From: Li RongQing To: hughd@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm: remove VM_ACCT(PAGE_SIZE) when charge and uncharge Date: Thu, 17 Oct 2019 19:32:31 +0800 Message-Id: <1571311951-8524-1-git-send-email-lirongqing@baidu.com> X-Mailer: git-send-email 1.7.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org VM_ACCT(PAGE_SIZE) is one, and it is unnecessary to multiply by it Signed-off-by: Li RongQing --- 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