[Devel,RHEL7,COMMIT] pfcache/ub: account pfcache peer files in ub0

Submitted by Konstantin Khorenko on Jan. 20, 2017, 2:54 p.m.

Details

Message ID 201701201454.v0KEsmtF025256@finist_cl7.x64_64.work.ct
State New
Series "pfcache/ub: account pfcache peer files in ub0"
Headers show

Commit Message

Konstantin Khorenko Jan. 20, 2017, 2:54 p.m.
The commit is pushed to "branch-rh7-3.10.0-514.6.1.vz7.28.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-514.6.1.vz7.28.2
------>
commit 68ca8fac8e49f0234550a2c93e17a4585d24fd75
Author: Andrey Ryabinin <aryabinin@virtuozzo.com>
Date:   Fri Jan 20 18:54:48 2017 +0400

    pfcache/ub: account pfcache peer files in ub0
    
    Pfcache's peer files is a shared resource, thus it shouldn't be accounted
    per-container.
    This makes peer files to be accounted in ub0, the same way as it is in PSBM6.
    
    https://jira.sw.ru/browse/PSBM-56167
    
    Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 mm/memory.c | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/mm/memory.c b/mm/memory.c
index b408ff27..6034045 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3813,10 +3813,13 @@  int open_mapping_peer(struct address_space *mapping,
 	struct inode *inode = path->dentry->d_inode;
 	struct address_space *peer = inode->i_mapping;
 	struct file *file = NULL;
+	struct user_beancounter *ub;
 
 restart:
 	if (!peer->i_peer_file) {
+		ub = set_exec_ub(&ub0);
 		file = dentry_open(path, O_RDONLY | O_LARGEFILE, cred);
+		set_exec_ub(ub);
 		if (IS_ERR(file)) {
 			return PTR_ERR(file);
 		}