From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Yury Norov <yury.norov@gmail.com>
Cc: linux-kernel@vger.kernel.org,
Rasmus Villemoes <linux@rasmusvillemoes.dk>
Subject: Re: [PATCH] bitmap: optimize bitmap_remap()
Date: Thu, 17 Aug 2023 12:38:28 +0300 [thread overview]
Message-ID: <ZN3qlCd+TcYiZg+s@smile.fi.intel.com> (raw)
In-Reply-To: <ZN3qQPeFtdZQrLE4@smile.fi.intel.com>
On Thu, Aug 17, 2023 at 12:37:05PM +0300, Andy Shevchenko wrote:
> On Tue, Aug 15, 2023 at 04:59:34PM -0700, Yury Norov wrote:
...
> > int n = bitmap_pos_to_ord(old, oldbit, nbits);
> >
> > + bit = (n < 0) ? oldbit : /* identity map */
>
> Can't you also optimize this case?
>
> Something like
>
> bitmap_xor(tmp, old, new) // maybe even better approach, dunno
> bitmap_empty(tmp) // can be replaced by find first bit
Or reuse bitmap_weight()...
> ?
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-08-17 9:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-15 23:59 [PATCH] bitmap: optimize bitmap_remap() Yury Norov
2023-08-17 9:37 ` Andy Shevchenko
2023-08-17 9:38 ` Andy Shevchenko [this message]
2023-08-17 14:21 ` Yury Norov
2023-08-17 15:37 ` Andy Shevchenko
2023-08-19 2:03 ` Yury Norov
2023-08-21 7:48 ` Rasmus Villemoes
2023-08-21 8:56 ` Andy Shevchenko
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=ZN3qlCd+TcYiZg+s@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--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