mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [merged] mm-dmapoolc-micro-optimisation-remove-unnecessary-branch.patch removed from -mm tree
@ 2020-04-08  2:00 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2020-04-08  2:00 UTC (permalink / raw)
  To: akpm, mateusznosek0, mm-commits


The patch titled
     Subject: mm/dmapool.c: micro-optimisation remove unnecessary branch
has been removed from the -mm tree.  Its filename was
     mm-dmapoolc-micro-optimisation-remove-unnecessary-branch.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Mateusz Nosek <mateusznosek0@gmail.com>
Subject: mm/dmapool.c: micro-optimisation remove unnecessary branch

Previously there was a check if 'size' is aligned to 'align' and if not
then it was aligned.  This check was expensive as both branch and division
are expensive instructions in most architectures.  'ALIGN' function on
already aligned value will not change it, and as it is cheaper than branch
+ division it can be executed all the time and branch can be removed.

Link: http://lkml.kernel.org/r/20200320173317.26408-1-mateusznosek0@gmail.com
Signed-off-by: Mateusz Nosek <mateusznosek0@gmail.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/dmapool.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/mm/dmapool.c~mm-dmapoolc-micro-optimisation-remove-unnecessary-branch
+++ a/mm/dmapool.c
@@ -144,9 +144,7 @@ struct dma_pool *dma_pool_create(const c
 	else if (size < 4)
 		size = 4;
 
-	if ((size % align) != 0)
-		size = ALIGN(size, align);

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

only message in thread, other threads:[~2020-04-08  2:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-08  2:00 [merged] mm-dmapoolc-micro-optimisation-remove-unnecessary-branch.patch removed from -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).