[Devel] [PATCH RHEL7 COMMIT] fs/dax: remove comment leftover: merge into ms/mm: memcontrol: rewrite uncharge API
The commit is pushed to "branch-rh7-3.10.0-693.1.1.vz7.37.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-693.1.1.el7 --> commit d1a7c8e0a2809ea8913f27e0a4a470c8cbf2875b Author: Andrey Ryabinin Date: Wed Aug 30 10:16:49 2017 +0300 fs/dax: remove comment leftover: merge into ms/mm: memcontrol: rewrite uncharge API mem_cgroup_uncharge_page() call in dax_mapping_entry() not needed. Uncharging now happens in __page_cache_release() Should be merged in b3c711a7287f ("ms/mm: memcontrol: rewrite uncharge API") https://jira.sw.ru/browse/PSBM-70742 Signed-off-by: Andrey Ryabinin --- fs/dax.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/dax.c b/fs/dax.c index 1a7d6a5..2e0c8ba 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -643,7 +643,6 @@ static void *dax_insert_mapping_entry(struct address_space *mapping, RADIX_DAX_ENTRY_LOCK); if (hole_fill) { __delete_from_page_cache(entry, NULL); -// FIXME mem_cgroup_uncharge_page(entry); /* Drop pagecache reference */ page_cache_release(entry); error = radix_tree_insert(page_tree, index, new_entry); ___ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel
[Devel] [PATCH RHEL7 COMMIT] mm/hmm: Restore removed hunk in copy_one_pte(): to merge with: ms/mm: remove rest usage of VM_NONLINEAR and pte_file()
The commit is pushed to "branch-rh7-3.10.0-693.1.1.vz7.37.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-693.1.1.el7 --> commit acd6126a714593569b98eff69671cc094d3227c4 Author: Andrey Ryabinin Date: Wed Aug 30 10:51:59 2017 +0300 mm/hmm: Restore removed hunk in copy_one_pte(): to merge with: ms/mm: remove rest usage of VM_NONLINEAR and pte_file() Rebased "ms/mm: remove rest usage of VM_NONLINEAR and pte_file()" removed huge hunk from copy_one_pte for no reason. Bring it back https://jira.sw.ru/browse/PSBM-70740 Fixes: be8e22c9c444 ("ms/mm: remove rest usage of VM_NONLINEAR and pte_file()") Signed-off-by: Andrey Ryabinin --- mm/memory.c | 25 ++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index e53e8dd..c30a042 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -879,13 +879,32 @@ copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm, pte = pte_swp_mksoft_dirty(pte); set_pte_at(src_mm, addr, src_pte, pte); } - } else { + } else if (is_hmm_entry(entry)) { + page = hmm_entry_to_page(entry); + + /* +* Update rss count even for un-addressable +* page as they should be consider just like +* any other page. +*/ + get_page(page); + rss[mm_counter(page)]++; + page_dup_rmap(page); + + if (is_write_hmm_entry(entry) && + is_cow_mapping(vm_flags)) { + make_hmm_entry_read(&entry); + pte = swp_entry_to_pte(entry); + if (pte_swp_soft_dirty(*src_pte)) + pte = pte_swp_mksoft_dirty(pte); + set_pte_at(src_mm, addr, src_pte, pte); + } + } else /* * This can not happen because HMM migration holds * mmap_sem in read mode. */ - VM_BUG_ON(is_hmm_entry(entry)); - } +VM_BUG_ON(is_hmm_entry(entry)); goto out_set_pte; } ___ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel
[Devel] [PATCH rh7] mm/migrate: add missing memcg charge
Fixes: b3c711a7287f ("ms/mm: memcontrol: rewrite uncharge API") Signed-off-by: Andrey Ryabinin --- mm/migrate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/migrate.c b/mm/migrate.c index 6b7349ca368c..c629762fbfd5 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2383,6 +2383,9 @@ static void migrate_vma_insert_page(struct migrate_vma *migrate, inc_mm_counter(mm, MM_ANONPAGES); page_add_new_anon_rmap(page, vma, addr); + mem_cgroup_commit_charge(page, memcg, false); + if (!is_zone_device_page(page)) + lru_cache_add_active_or_unevictable(page, vma); set_pte_at(mm, addr, ptep, entry); /* Take a reference on the page */ -- 2.13.5 ___ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel
[Devel] [PATCH rh7] mm/memcg: drop extra mem_cgroup_inc_failcnt()
We need only one. Shoud be merged into c6f8224e23d8cf ("ms/mm: memcontrol: rewrite charge API") https://jira.sw.ru/browse/PSBM-70741 Signed-off-by: Andrey Ryabinin --- mm/memcontrol.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 97824e281d7a..940cca31ed5d 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2880,7 +2880,6 @@ retry: goto bypass; mem_cgroup_oom(mem_over_limit, gfp_mask, get_order(batch * PAGE_SIZE)); - mem_cgroup_inc_failcnt(mem_over_limit, gfp_mask, nr_pages); nomem: mem_cgroup_inc_failcnt(mem_over_limit, gfp_mask, nr_pages); -- 2.13.5 ___ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel
[Devel] [PATCH RHEL7 COMMIT] mm/migrate: add missing memcg charge
The commit is pushed to "branch-rh7-3.10.0-693.1.1.vz7.37.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-693.1.1.el7 --> commit 1c1c763d7424c872265d60007d6050cf3a394386 Author: Andrey Ryabinin Date: Wed Aug 30 14:24:48 2017 +0300 mm/migrate: add missing memcg charge Fixes: b3c711a7287f ("ms/mm: memcontrol: rewrite uncharge API") Signed-off-by: Andrey Ryabinin --- mm/migrate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/migrate.c b/mm/migrate.c index 6b7349c..c629762f 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2383,6 +2383,9 @@ static void migrate_vma_insert_page(struct migrate_vma *migrate, inc_mm_counter(mm, MM_ANONPAGES); page_add_new_anon_rmap(page, vma, addr); + mem_cgroup_commit_charge(page, memcg, false); + if (!is_zone_device_page(page)) + lru_cache_add_active_or_unevictable(page, vma); set_pte_at(mm, addr, ptep, entry); /* Take a reference on the page */ ___ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel
[Devel] [PATCH RHEL7 COMMIT] mm/memcg: drop extra mem_cgroup_inc_failcnt()
The commit is pushed to "branch-rh7-3.10.0-693.1.1.vz7.37.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-693.1.1.el7 --> commit 08eefdc668f199088d9185dd9e3973177da94e18 Author: Andrey Ryabinin Date: Wed Aug 30 14:37:04 2017 +0300 mm/memcg: drop extra mem_cgroup_inc_failcnt() We need only one. Shoud be merged into c6f8224e23d8cf ("ms/mm: memcontrol: rewrite charge API") https://jira.sw.ru/browse/PSBM-70741 Signed-off-by: Andrey Ryabinin --- mm/memcontrol.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 97824e2..940cca3 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2880,7 +2880,6 @@ static int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask, bool kmem_charge goto bypass; mem_cgroup_oom(mem_over_limit, gfp_mask, get_order(batch * PAGE_SIZE)); - mem_cgroup_inc_failcnt(mem_over_limit, gfp_mask, nr_pages); nomem: mem_cgroup_inc_failcnt(mem_over_limit, gfp_mask, nr_pages); ___ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel
Re: [Devel] [PATCH rh7] mm/memcg: add missing kmem charge.
On 2017-08-29 18:13, Andrey Ryabinin wrote: > Since de3a106e28d5 ("mm/memcg: reclaim memory on reaching kmem limit.") > if try_charge() decide to bypass memory limit, mem_cgroup_charge_kmem() memcg_charge_kmem() should be here > will charge only ->memory/->memsw but not ->kmem. This may lead to > deadlocks during cgroup destruction as condition: >(page_counter_read(&memcg->memory) - >page_counter_read(&memcg->kmem) > 0) > > in mem_cgroup_reparent_charges() won't come true ever. > > https://jira.sw.ru/browse/PSBM-70556 > Fixes: de3a106e28d5 ("mm/memcg: reclaim memory on reaching kmem limit.") > Signed-off-by: Andrey Ryabinin Reviewed-by:Vasily Averin > --- > mm/memcontrol.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 5ab5e82c924e..49d4586c9d21 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -3087,6 +3087,8 @@ int memcg_charge_kmem(struct mem_cgroup *memcg, gfp_t > gfp, > page_counter_charge(&memcg->memory, nr_pages); > if (do_swap_account) > page_counter_charge(&memcg->memsw, nr_pages); > + page_counter_charge(&memcg->kmem, nr_pages); > + > ret = 0; > } > > ___ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel
Re: [Devel] [PATCH rh7] mm/memcg: add missing kmem charge.
On 2017-08-29 18:13, Andrey Ryabinin wrote: > Since de3a106e28d5 ("mm/memcg: reclaim memory on reaching kmem limit.") > if try_charge() decide to bypass memory limit, mem_cgroup_charge_kmem() memcg_charge_kmem() should be here > will charge only ->memory/->memsw but not ->kmem. This may lead to > deadlocks during cgroup destruction as condition: >(page_counter_read(&memcg->memory) - >page_counter_read(&memcg->kmem) > 0) > > in mem_cgroup_reparent_charges() won't come true ever. > > https://jira.sw.ru/browse/PSBM-70556 > Fixes: de3a106e28d5 ("mm/memcg: reclaim memory on reaching kmem limit.") > Signed-off-by: Andrey Ryabinin Reviewed-by:Vasily Averin > --- > mm/memcontrol.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 5ab5e82c924e..49d4586c9d21 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -3087,6 +3087,8 @@ int memcg_charge_kmem(struct mem_cgroup *memcg, gfp_t > gfp, > page_counter_charge(&memcg->memory, nr_pages); > if (do_swap_account) > page_counter_charge(&memcg->memsw, nr_pages); > + page_counter_charge(&memcg->kmem, nr_pages); > + > ret = 0; > } > > ___ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel
[Devel] [PATCH] zdtm: fix autofs tes compilation
Variables type of size_t have to be printed with "%z" directive. https://jira.sw.ru/browse/PSBM-71041 Signed-off-by: Stanislav Kinsburskiy --- test/zdtm/static/autofs.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/zdtm/static/autofs.c b/test/zdtm/static/autofs.c index d854fd0..8d917ee 100644 --- a/test/zdtm/static/autofs.c +++ b/test/zdtm/static/autofs.c @@ -484,7 +484,7 @@ static int automountd_loop(int pipe, const char *mountpoint, struct autofs_param continue; } if (bytes > psize) { - pr_err("read more that expected: %ld > %ld\n", bytes, psize); + pr_err("read more that expected: %zd > %zd\n", bytes, psize); return -EINVAL; } if (bytes != sizeof(*packet)) { ___ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel