All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yury Norov <ynorov@nvidia.com>
To: "孙毅 (Yi Sun)" <Yi.Sun@unisoc.com>
Cc: "yury.norov@gmail.com" <yury.norov@gmail.com>,
	"mnazarewicz@gmail.com" <mnazarewicz@gmail.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"mina86@mina86.com" <mina86@mina86.com>,
	"akinobu.mita@gmail.com" <akinobu.mita@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"王皓 (Hao_hao Wang)" <Hao_hao.Wang@unisoc.com>,
	"王科 (Ke Wang)" <Ke.Wang@unisoc.com>
Subject: Re: 答复: [PATCH v3 1/2] lib: bitmap: add find_last_bit_from() and _find_last_bit_from()
Date: Wed, 27 May 2026 16:54:26 -0400	[thread overview]
Message-ID: <ahdaAtlvRJzxcQRF@yury> (raw)
In-Reply-To: <23fc41cda8164b47a6236bc7fa350a1f@BJMBX02.spreadtrum.com>

On Wed, May 27, 2026 at 09:32:49AM +0000, 孙毅 (Yi Sun) wrote:

...

> > On the previous round I suggested the implementation based on
> > find_last_bit(), so that you don't need to create an outline
> > _find_last_bit_from() function and expose it. Can you compare the
> > implementations for the performance impact. If they are on par,
> > I'd stick to one re-using the existing code.
> 
> Using the new API find_last_bit_from() is about 4% faster than using find_last_bit().
> This is likely because find_last_bit() requires additional offset calculations.
> as shown below:
> index_bits_align = round_down(index, BITS_PER_LONG);
> index_idx = index / BITS_PER_LONG;
> i = find_last_bit(map + index_idx, end - index_bits_align) + index_bits_align;
> 
> 
> So which approach do you prefer? Using the new API or not?
> I will send patch v4 (including testing code) based on your suggestion.

I'd prefer you to send the new iteration with the proper test that I
can run, then collect feedback from testers and then make a decision.

Thanks,
Yury

  reply	other threads:[~2026-05-27 20:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-14  9:06 [PATCH v3 0/2] Improve the performance of bitmap_find_next_zero_area_off() Yi Sun
2026-05-14  9:06 ` [PATCH v3 1/2] lib: bitmap: add find_last_bit_from() and _find_last_bit_from() Yi Sun
2026-05-14 10:51   ` Michał Nazarewicz
2026-05-14 16:49   ` Yury Norov
2026-05-27  9:32     ` 答复: " 孙毅 (Yi Sun)
2026-05-27 20:54       ` Yury Norov [this message]
2026-05-14  9:06 ` [PATCH v3 2/2] lib: bitmap: reduce the number of goto again in bitmap_find_next_zero_area_off() Yi Sun
2026-05-14 10:51   ` Michał Nazarewicz
2026-05-14 17:18   ` Yury Norov
2026-05-27  9:19     ` 答复: " 孙毅 (Yi Sun)
2026-05-14 15:54 ` [PATCH v3 0/2] Improve the performance of bitmap_find_next_zero_area_off() Yury Norov

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=ahdaAtlvRJzxcQRF@yury \
    --to=ynorov@nvidia.com \
    --cc=Hao_hao.Wang@unisoc.com \
    --cc=Ke.Wang@unisoc.com \
    --cc=Yi.Sun@unisoc.com \
    --cc=akinobu.mita@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mina86@mina86.com \
    --cc=mnazarewicz@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.