mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + mm-memcg-simplify-mem_cgroup_get_max-v4.patch added to -mm tree
@ 2020-09-16  2:10 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2020-09-16  2:10 UTC (permalink / raw)
  To: mm-commits, vdavydov.dev, tj, shakeelb, mhocko, laoar.shao,
	hannes, guro, chris, longman


The patch titled
     Subject: mm-memcg-simplify-mem_cgroup_get_max-v4
has been added to the -mm tree.  Its filename is
     mm-memcg-simplify-mem_cgroup_get_max-v4.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/mm-memcg-simplify-mem_cgroup_get_max-v4.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/mm-memcg-simplify-mem_cgroup_get_max-v4.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Waiman Long <longman@redhat.com>
Subject: mm-memcg-simplify-mem_cgroup_get_max-v4

Link: https://lkml.kernel.org/r/20200914150928.7841-1-longman@redhat.com
Signed-off-by: Waiman Long <longman@redhat.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Cc: Chris Down <chris@chrisdown.name>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Roman Gushchin <guro@fb.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Yafang Shao <laoar.shao@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/memcontrol.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- a/mm/memcontrol.c~mm-memcg-simplify-mem_cgroup_get_max-v4
+++ a/mm/memcontrol.c
@@ -1642,8 +1642,12 @@ unsigned long mem_cgroup_get_max(struct
 			max += min(READ_ONCE(memcg->swap.max),
 				   (unsigned long)total_swap_pages);
 	} else { /* v1 */
-		if (mem_cgroup_swappiness(memcg))
-			max = memcg->memsw.max;
+		if (mem_cgroup_swappiness(memcg)) {
+			/* Calculate swap excess capacity from memsw limit */
+			unsigned long swap = READ_ONCE(memcg->memsw.max) - max;
+
+			max += min(swap, (unsigned long)total_swap_pages);
+		}
 	}
 	return max;
 }
_

Patches currently in -mm which might be from longman@redhat.com are

mm-memcg-clean-up-obsolete-enum-charge_type.patch
mm-memcg-simplify-mem_cgroup_get_max.patch
mm-memcg-simplify-mem_cgroup_get_max-v4.patch
mm-memcg-unify-swap-and-memsw-page-counters.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-16  2:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-16  2:10 + mm-memcg-simplify-mem_cgroup_get_max-v4.patch added to -mm tree akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).