Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1490532

[PATCH 2/3] huge tmpfs: fix Committed_AS leak

Path csiph.com!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Hugh Dickins <hughd@google.com>
Newsgroups linux.kernel
Subject [PATCH 2/3] huge tmpfs: fix Committed_AS leak
Date Sat, 24 Sep 2016 05:30:01 +0200
Message-ID <skLP3-4b0-1@gated-at.bofh.it> (permalink)
References <skLP3-4b0-3@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=lniz2Wg7vUONqjv3BSf4AFlK+J7opZU+hQjZ3OnE+rI=; b=BaMtVpKXN1SBIb2dprohuia7zTckapxCvHjSHSUBX4rcvQjeBCV771fj9ej/u2nTBk vTkbumiqO6qr0LFX3yyTAUNFwDIP3u8O/vyyROLVMo/tPLaYJwIKSONo0qDWlbeWFn+I PFsjpnHkypqtoDneXAHOu1oE9jT2fpUdQuRQfvAVGEAsah3Jxt7zFxQcjoOrOGM/j70Y pJX44WAUn65+seS+w+eL9NaSZbgumUvcbakA9A8fSvnzEr4TEtjh5xrFltMUS8G1/02s panKz329/tb+A6K/uU65HpMYTO2SXkeFsZo9skUxwzFRzcn+dPuPz7R4hyq6Pub+sT4R wDkw==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=lniz2Wg7vUONqjv3BSf4AFlK+J7opZU+hQjZ3OnE+rI=; b=SSrLt4e/2tmCgFyPSWySxImyuth84BRY0vaXLMAH9KfdPbQ6Cotg9oUpNYHRph9V4N Uc3oCzHlsx35IqmYf6p3wIwUUpxReK2SkBbNkTn4y0QETh06KP3nuU3DYuBf+Rr1cEuh r6XNZdvgbGdXxNZ23cM73fkAOqn7U0d5HaDlxuDfSq0XilusGz7znezjuFJAvT2R3roY VoQCPdIWo1c6E75sUklfimRsLOsyjH6TbgFPSKNl/Z/Fp4FE+3wgIIrsyS4l94j3EVPa WC2+xUM56NuGJ6ykpune/Q1kTUoMeHwCkB+9WNIFbInlNiCWbSKeUV8ddPwayZytUfSz UycA==
X-Gm-Message-State AE9vXwPFNQ66IE/0L90QCfrHB+Qguwk6AB8AJn5SSv3aBf0Xs1MJzFVa9OVrLmjfCBnO45wK
X-Received by 10.202.104.224 with SMTP id o93mr14687872oik.82.1474687466012; Fri, 23 Sep 2016 20:24:26 -0700 (PDT)
X-X-Sender hugh@eggly.anvils
User-Agent Alpine 2.11 (LSU 23 2013-08-11)
MIME-Version 1.0
Content-Type TEXT/PLAIN; charset=US-ASCII
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 34
Organization linux.* mail to news gateway
X-Original-Cc Andrew Morton <akpm@linux-foundation.org>, "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>, linux-kernel@vger.kernel.org, linux-mm@kvack.org
X-Original-Date Fri, 23 Sep 2016 20:24:23 -0700 (PDT)
X-Original-Message-ID <alpine.LSU.2.11.1609232022110.2495@eggly.anvils>
X-Original-References <alpine.LSU.2.11.1609232014130.2495@eggly.anvils>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1490532

Show key headers only | View raw


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>
---

 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);
 }
 
 /*

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 2/3] huge tmpfs: fix Committed_AS leak Hugh Dickins <hughd@google.com> - 2016-09-24 05:30 +0200

csiph-web