From: Joe Perches <joe@perches.com>
To: Wang Qing <wangqing@vivo.com>,
Andrew Morton <akpm@linux-foundation.org>,
Dennis Zhou <dennis@kernel.org>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
David Sterba <dsterba@suse.com>,
Josef Bacik <josef@toxicpanda.com>,
Stefano Brivio <sbrivio@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
William Breathitt Gray <vilhelm.gray@gmail.com>,
Randy Dunlap <rdunlap@infradead.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Yury Norov <yury.norov@gmail.com>,
linux-kernel@vger.kernel.org
Cc: opensource.kernel@vivo.com
Subject: Re: [PATCH] Bitmap: Optimized division operation to shift operation
Date: Wed, 15 Apr 2020 00:47:39 -0700 [thread overview]
Message-ID: <e9b90677b2d97c556c400e3744518942e0b58d41.camel@perches.com> (raw)
In-Reply-To: <1586935667-4792-1-git-send-email-wangqing@vivo.com>
On Wed, 2020-04-15 at 15:27 +0800, Wang Qing wrote:
> On some processors, the / operate will call the compiler`s div lib,
> which is low efficient. Bitmap is performance sensitive, We can
> replace the / operation with shift.
Seems more like bad compilers than useful code changes
unless you can specify what compilers and what processors.
> diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
[]
> @@ -337,7 +337,7 @@ static inline int bitmap_equal(const unsigned long *src1,
> return !((*src1 ^ *src2) & BITMAP_LAST_WORD_MASK(nbits));
> if (__builtin_constant_p(nbits & BITMAP_MEM_MASK) &&
> IS_ALIGNED(nbits, BITMAP_MEM_ALIGNMENT))
> - return !memcmp(src1, src2, nbits / 8);
> + return !memcmp(src1, src2, nbits >> 3);
next prev parent reply other threads:[~2020-04-15 7:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-15 7:27 Wang Qing
2020-04-15 7:47 ` Joe Perches [this message]
2020-04-15 8:56 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e9b90677b2d97c556c400e3744518942e0b58d41.camel@perches.com \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dennis@kernel.org \
--cc=dsterba@suse.com \
--cc=josef@toxicpanda.com \
--cc=linux-kernel@vger.kernel.org \
--cc=opensource.kernel@vivo.com \
--cc=rdunlap@infradead.org \
--cc=sbrivio@redhat.com \
--cc=tglx@linutronix.de \
--cc=vilhelm.gray@gmail.com \
--cc=wangqing@vivo.com \
--cc=wsa+renesas@sang-engineering.com \
--cc=yury.norov@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®