The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear 
at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.34
------>
commit 6f0005096b2a068cd00ce31a1c389e8be341f73d
Author: Vasily Averin <[email protected]>
Date:   Wed Jun 2 19:48:02 2021 +0300

    ms/mm/memcontrol.c: allocate shrinker_map on appropriate NUMA node
    
    The shrinker_map may be touched from any cpu (e.g., a bit there may be set
    by a task running everywhere) but kswapd is always bound to specific node.
    So allocate shrinker_map from the related NUMA node to respect its NUMA
    locality.  Also, this follows generic way we use for allocation of memcg's
    per-node data.
    
    Signed-off-by: Kirill Tkhai <[email protected]>
    
    Signed-off-by: Andrew Morton <[email protected]>
    Reviewed-by: David Hildenbrand <[email protected]>
    Reviewed-by: Shakeel Butt <[email protected]>
    Reviewed-by: Roman Gushchin <[email protected]>
    Acked-by: Michal Hocko <[email protected]>
    Cc: Johannes Weiner <[email protected]>
    Cc: Vladimir Davydov <[email protected]>
    Link: 
http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Linus Torvalds <[email protected]>
    
    (cherry picked from ms commit 86daf94efb11 ("mm/memcontrol.c: allocate
    shrinker_map on appropriate NUMA node"))
    
    taken from vz7 commit bb7cce9fa82d ("ms/mm: Allocate shrinker_map on 
appropriate
    NUMA node")
    
    Signed-off-by: Vasily Averin <[email protected]>
---
 mm/memcontrol.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index a7d971c42367..43efd7998c81 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -341,7 +341,7 @@ static int memcg_expand_one_shrinker_map(struct mem_cgroup 
*memcg,
                if (!old)
                        return 0;
 
-               new = kvmalloc(sizeof(*new) + size, GFP_KERNEL);
+               new = kvmalloc_node(sizeof(*new) + size, GFP_KERNEL, nid);
                if (!new)
                        return -ENOMEM;
 
@@ -385,7 +385,7 @@ static int memcg_alloc_shrinker_maps(struct mem_cgroup 
*memcg)
        mutex_lock(&memcg_shrinker_map_mutex);
        size = memcg_shrinker_map_size;
        for_each_node(nid) {
-               map = kvzalloc(sizeof(*map) + size, GFP_KERNEL);
+               map = kvzalloc_node(sizeof(*map) + size, GFP_KERNEL, nid);
                if (!map) {
                        memcg_free_shrinker_maps(memcg);
                        ret = -ENOMEM;
_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to