From: Kirill Tkhai <ktk...@virtuozzo.com> Next patch requires these defines are above their current position, so here they are moved to declarations.
Link: http://lkml.kernel.org/r/153063055665.1818.5200425793649695598.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> Acked-by: Vladimir Davydov <vdavydov....@gmail.com> Tested-by: Shakeel Butt <shake...@google.com> Cc: Al Viro <v...@zeniv.linux.org.uk> Cc: Andrey Ryabinin <aryabi...@virtuozzo.com> Cc: Chris Wilson <ch...@chris-wilson.co.uk> Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org> Cc: Guenter Roeck <li...@roeck-us.net> Cc: "Huang, Ying" <ying.hu...@intel.com> Cc: Johannes Weiner <han...@cmpxchg.org> Cc: Josef Bacik <jba...@fb.com> Cc: Li RongQing <lirongq...@baidu.com> Cc: Matthew Wilcox <wi...@infradead.org> Cc: Matthias Kaehlcke <m...@chromium.org> Cc: Mel Gorman <mgor...@techsingularity.net> Cc: Michal Hocko <mho...@kernel.org> Cc: Minchan Kim <minc...@kernel.org> Cc: Philippe Ombredanne <pombreda...@nexb.com> Cc: Roman Gushchin <g...@fb.com> Cc: Sahitya Tummala <stumm...@codeaurora.org> Cc: Stephen Rothwell <s...@canb.auug.org.au> Cc: Tetsuo Handa <penguin-ker...@i-love.sakura.ne.jp> Cc: Thomas Gleixner <t...@linutronix.de> Cc: Waiman Long <long...@redhat.com> Signed-off-by: Andrew Morton <a...@linux-foundation.org> Signed-off-by: Linus Torvalds <torva...@linux-foundation.org> (cherry picked from commit b05706f1001fe662bafe198814c5999fd996dce0) Signed-off-by: Andrey Ryabinin <aryabi...@virtuozzo.com> --- mm/memcontrol.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 8c582652a096..e3e0fe0c4317 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -237,6 +237,21 @@ enum res_type { /* Used for OOM nofiier */ #define OOM_CONTROL (0) +/* + * Iteration constructs for visiting all cgroups (under a tree). If + * loops are exited prematurely (break), mem_cgroup_iter_break() must + * be used for reference counting. + */ +#define for_each_mem_cgroup_tree(iter, root) \ + for (iter = mem_cgroup_iter(root, NULL, NULL); \ + iter != NULL; \ + iter = mem_cgroup_iter(root, iter, NULL)) + +#define for_each_mem_cgroup(iter) \ + for (iter = mem_cgroup_iter(NULL, NULL, NULL); \ + iter != NULL; \ + iter = mem_cgroup_iter(NULL, iter, NULL)) + /* Some nice accessors for the vmpressure. */ struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg) { @@ -866,21 +881,6 @@ static void invalidate_reclaim_iterators(struct mem_cgroup *dead_memcg) } } -/* - * Iteration constructs for visiting all cgroups (under a tree). If - * loops are exited prematurely (break), mem_cgroup_iter_break() must - * be used for reference counting. - */ -#define for_each_mem_cgroup_tree(iter, root) \ - for (iter = mem_cgroup_iter(root, NULL, NULL); \ - iter != NULL; \ - iter = mem_cgroup_iter(root, iter, NULL)) - -#define for_each_mem_cgroup(iter) \ - for (iter = mem_cgroup_iter(NULL, NULL, NULL); \ - iter != NULL; \ - iter = mem_cgroup_iter(NULL, iter, NULL)) - /** * mem_cgroup_scan_tasks - iterate over tasks of a memory cgroup hierarchy * @memcg: hierarchy root -- 2.24.1 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel