Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1489391 > unrolled thread
| Started by | Hugh Dickins <hughd@google.com> |
|---|---|
| First post | 2016-09-22 21:00 +0200 |
| Last post | 2016-09-23 11:30 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] huge tmpfs: fix Committed_AS leak Hugh Dickins <hughd@google.com> - 2016-09-22 21:00 +0200
Re: [PATCH] huge tmpfs: fix Committed_AS leak "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-09-23 11:30 +0200
| From | Hugh Dickins <hughd@google.com> |
|---|---|
| Date | 2016-09-22 21:00 +0200 |
| Subject | [PATCH] huge tmpfs: fix Committed_AS leak |
| Message-ID | <skhnX-1Bu-1@gated-at.bofh.it> |
Under swapping load on huge tmpfs, /proc/meminfo's Committed_AS grows
bigger and bigger: just a cosmetic issue for most users, but disabling
for those who run without overcommit (/proc/sys/vm/overcommit_memory 2).
shmem_uncharge() was forgetting to unaccount __vm_enough_memory's charge,
and shmem_charge() was forgetting it on the filesystem-full error path.
Fixes: 800d8c63b2e9 ("shmem: add huge pages support")
Signed-off-by: Hugh Dickins <hughd@google.com>
---
mm/shmem.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- 4.8-rc7/mm/shmem.c 2016-08-14 20:17:02.388843463 -0700
+++ linux/mm/shmem.c 2016-09-22 09:29:15.462690346 -0700
@@ -270,7 +270,7 @@ bool shmem_charge(struct inode *inode, l
info->alloced -= pages;
shmem_recalc_inode(inode);
spin_unlock_irqrestore(&info->lock, flags);
-
+ shmem_unacct_blocks(info->flags, pages);
return false;
}
percpu_counter_add(&sbinfo->used_blocks, pages);
@@ -291,6 +291,7 @@ void shmem_uncharge(struct inode *inode,
if (sbinfo->max_blocks)
percpu_counter_sub(&sbinfo->used_blocks, pages);
+ shmem_unacct_blocks(info->flags, pages);
}
/*
[toc] | [next] | [standalone]
| From | "Kirill A. Shutemov" <kirill@shutemov.name> |
|---|---|
| Date | 2016-09-23 11:30 +0200 |
| Message-ID | <skuXU-1R8-19@gated-at.bofh.it> |
| In reply to | #1489391 |
On Thu, Sep 22, 2016 at 10:37:03AM -0700, Hugh Dickins wrote:
> Under swapping load on huge tmpfs, /proc/meminfo's Committed_AS grows
> bigger and bigger: just a cosmetic issue for most users, but disabling
> for those who run without overcommit (/proc/sys/vm/overcommit_memory 2).
>
> shmem_uncharge() was forgetting to unaccount __vm_enough_memory's charge,
> and shmem_charge() was forgetting it on the filesystem-full error path.
>
> Fixes: 800d8c63b2e9 ("shmem: add huge pages support")
> Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
--
Kirill A. Shutemov
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web