+ lib-micro-optimization-for-__bitmap_complement.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: lib/bitmap.c: micro-optimization for __bitmap_complement()
has been added to the -mm tree.  Its filename is
     lib-micro-optimization-for-__bitmap_complement.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/lib-micro-optimization-for-__bitmap_complement.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/lib-micro-optimization-for-__bitmap_complement.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: Yury Norov <ynorov@xxxxxxxxxxxxxxxxxx>
Subject: lib/bitmap.c: micro-optimization for __bitmap_complement()

Use BITS_TO_LONGS() macro to avoid calculation of reminder (bits %
BITS_PER_LONG) On ARM64 it saves 5 instruction for function - 16 before
and 11 after.

Link: http://lkml.kernel.org/r/20180411145914.6011-1-ynorov@xxxxxxxxxxxxxxxxxx
Signed-off-by: Yury Norov <ynorov@xxxxxxxxxxxxxxxxxx>
Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Matthew Wilcox <mawilcox@xxxxxxxxxxxxx>
Cc: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 lib/bitmap.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff -puN lib/bitmap.c~lib-micro-optimization-for-__bitmap_complement lib/bitmap.c
--- a/lib/bitmap.c~lib-micro-optimization-for-__bitmap_complement
+++ a/lib/bitmap.c
@@ -64,12 +64,9 @@ EXPORT_SYMBOL(__bitmap_equal);
 
 void __bitmap_complement(unsigned long *dst, const unsigned long *src, unsigned int bits)
 {
-	unsigned int k, lim = bits/BITS_PER_LONG;
+	unsigned int k, lim = BITS_TO_LONGS(bits);
 	for (k = 0; k < lim; ++k)
 		dst[k] = ~src[k];
-
-	if (bits % BITS_PER_LONG)
-		dst[k] = ~src[k];
 }
 EXPORT_SYMBOL(__bitmap_complement);
 
_

Patches currently in -mm which might be from ynorov@xxxxxxxxxxxxxxxxxx are

lib-micro-optimization-for-__bitmap_complement.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux