* + mm-memcg-remove-unneeded-nr_scanned.patch added to -mm tree
@ 2022-03-28 20:20 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2022-03-28 20:20 UTC (permalink / raw)
To: mm-commits, roman.gushchin, mhocko, david, linmiaohe, akpm
The patch titled
Subject: mm/memcg: remove unneeded nr_scanned
has been added to the -mm tree. Its filename is
mm-memcg-remove-unneeded-nr_scanned.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/mm-memcg-remove-unneeded-nr_scanned.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/mm-memcg-remove-unneeded-nr_scanned.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: Miaohe Lin <linmiaohe@huawei.com>
Subject: mm/memcg: remove unneeded nr_scanned
The local variable nr_scanned is unneeded as mem_cgroup_soft_reclaim
always does *total_scanned += nr_scanned. So we can pass total_scanned
directly to the mem_cgroup_soft_reclaim to simplify the code and save some
cpu cycles of adding nr_scanned to total_scanned.
Link: https://lkml.kernel.org/r/20220328114144.53389-1-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Roman Gushchin <roman.gushchin@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/memcontrol.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- a/mm/memcontrol.c~mm-memcg-remove-unneeded-nr_scanned
+++ a/mm/memcontrol.c
@@ -3387,7 +3387,6 @@ unsigned long mem_cgroup_soft_limit_recl
int loop = 0;
struct mem_cgroup_tree_per_node *mctz;
unsigned long excess;
- unsigned long nr_scanned;
if (order > 0)
return 0;
@@ -3415,11 +3414,9 @@ unsigned long mem_cgroup_soft_limit_recl
if (!mz)
break;
- nr_scanned = 0;
reclaimed = mem_cgroup_soft_reclaim(mz->memcg, pgdat,
- gfp_mask, &nr_scanned);
+ gfp_mask, total_scanned);
nr_reclaimed += reclaimed;
- *total_scanned += nr_scanned;
spin_lock_irq(&mctz->lock);
__mem_cgroup_remove_exceeded(mz, mctz);
_
Patches currently in -mm which might be from linmiaohe@huawei.com are
mm-memcg-remove-unneeded-nr_scanned.patch
mm-mremap-use-helper-mlock_future_check.patch
mm-mlock-fix-two-bugs-in-user_shm_lock.patch
mm-compaction-use-helper-isolation_suitable.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-28 20:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-28 20:20 + mm-memcg-remove-unneeded-nr_scanned.patch added to -mm tree Andrew Morton
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).