* [PATCH] huge tmpfs: fix Committed_AS leak
@ 2016-09-22 17:37 Hugh Dickins
2016-09-23 9:25 ` Kirill A. Shutemov
0 siblings, 1 reply; 2+ messages in thread
From: Hugh Dickins @ 2016-09-22 17:37 UTC (permalink / raw)
To: Andrew Morton; +Cc: Kirill A. Shutemov, linux-kernel, linux-mm
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);
}
/*
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] huge tmpfs: fix Committed_AS leak
2016-09-22 17:37 [PATCH] huge tmpfs: fix Committed_AS leak Hugh Dickins
@ 2016-09-23 9:25 ` Kirill A. Shutemov
0 siblings, 0 replies; 2+ messages in thread
From: Kirill A. Shutemov @ 2016-09-23 9:25 UTC (permalink / raw)
To: Hugh Dickins; +Cc: Andrew Morton, Kirill A. Shutemov, linux-kernel, linux-mm
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
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-23 9:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-22 17:37 [PATCH] huge tmpfs: fix Committed_AS leak Hugh Dickins
2016-09-23 9:25 ` Kirill A. Shutemov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).