* + mm-compactionc-micro-optimization-remove-unnecessary-branch.patch added to -mm tree
@ 2020-09-14 0:38 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2020-09-14 0:38 UTC (permalink / raw)
To: mm-commits, vbabka, rientjes, mgorman, iamjoonsoo.kim, akpm,
mateusznosek0
The patch titled
Subject: mm/compaction.c: micro-optimization remove unnecessary branch
has been added to the -mm tree. Its filename is
mm-compactionc-micro-optimization-remove-unnecessary-branch.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/mm-compactionc-micro-optimization-remove-unnecessary-branch.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/mm-compactionc-micro-optimization-remove-unnecessary-branch.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: Mateusz Nosek <mateusznosek0@gmail.com>
Subject: mm/compaction.c: micro-optimization remove unnecessary branch
The same code can work both for 'zone->compact_considered > defer_limit'
and 'zone->compact_considered >= defer_limit'. In the latter there is one
branch less which is more effective considering performance.
Link: https://lkml.kernel.org/r/20200913190448.28649-1-mateusznosek0@gmail.com
Signed-off-by: Mateusz Nosek <mateusznosek0@gmail.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Mel Gorman <mgorman@suse.de>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/compaction.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
--- a/mm/compaction.c~mm-compactionc-micro-optimization-remove-unnecessary-branch
+++ a/mm/compaction.c
@@ -180,11 +180,10 @@ bool compaction_deferred(struct zone *zo
return false;
/* Avoid possible overflow */
- if (++zone->compact_considered > defer_limit)
+ if (++zone->compact_considered >= defer_limit) {
zone->compact_considered = defer_limit;
-
- if (zone->compact_considered >= defer_limit)
return false;
+ }
trace_mm_compaction_deferred(zone, order);
_
Patches currently in -mm which might be from mateusznosek0@gmail.com are
mm-page_allocc-clean-code-by-removing-unnecessary-initialization.patch
mm-page_allocc-micro-optimization-remove-unnecessary-branch.patch
mm-compactionc-micro-optimization-remove-unnecessary-branch.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-09-14 0:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-14 0:38 + mm-compactionc-micro-optimization-remove-unnecessary-branch.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).