Skip to contentSkip to conversation

mm-dmapoolc-micro-optimisation-remove-unnecessary-branch.patch removed from -mm tree

merged [email protected] 1 participant 1 message Apr 8, 2020

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

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 <[email protected]>
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.

---

 mm/dmapool.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
mm/dmapool.c renamed from mm/dmapool.c~mm-dmapoolc-micro-optimisation-remove-unnecessary-branch +0 -2
@@ -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);