mm: vmscan: add shrinker_info_protected() helper
mainline inclusion from mainline-v5.13-rc1 commit 468ab843 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I48N0H CVE: NA ------------------------------------------------- The shrinker_info is dereferenced in a couple of places via rcu_dereference_protected with different calling conventions, for example, using mem_cgroup_nodeinfo helper or dereferencing memcg->nodeinfo[nid]->shrinker_info. And the later patch will add more dereference places. So extract the dereference into a helper to make the code more readable. No functional change. [akpm@linux-foundation.org: retain rcu_dereference_protected() in free_shrinker_info(), per Hugh] Link: https://lkml.kernel.org/r/20210311190845.9708-8-shy828301@gmail.com Signed-off-by:Yang Shi <shy828301@gmail.com> Acked-by:
Roman Gushchin <guro@fb.com> Acked-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Acked-by:
Vlastimil Babka <vbabka@suse.cz> Reviewed-by:
Shakeel Butt <shakeelb@google.com> Cc: Dave Chinner <david@fromorbit.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Michal Hocko <mhocko@suse.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by:
Chen Wandun <chenwandun@huawei.com> Reviewed-by:
Tong Tiangen <tongtiangen@huawei.com> Signed-off-by:
Zheng Zengkai <zhengzengkai@huawei.com>
Loading
Please sign in to comment