[Devel] [PATCH rh7] pfcache/ub: account pfcache peer files in ub0
Andrey Ryabinin
aryabinin at virtuozzo.com
Mon Jan 9 07:31:39 PST 2017
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 at virtuozzo.com>
---
mm/memory.c | 3 +++
1 file changed, 3 insertions(+)
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);
}
--
2.10.2
More information about the Devel
mailing list