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 <[email protected]>
---
 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

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to