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

Submitted by Andrey Ryabinin on Jan. 9, 2017, 3:31 p.m.

Details

Message ID 20170109153139.28578-1-aryabinin@virtuozzo.com
State New
Series "pfcache/ub: account pfcache peer files in ub0"
Headers show

Commit Message

Andrey Ryabinin Jan. 9, 2017, 3:31 p.m.
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 d6fcde2..8014dc8 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -4473,10 +4473,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);
 		}