From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Yury Norov <ynorov@nvidia.com>
Cc: linux-kernel@vger.kernel.org, Yury Norov <yury.norov@gmail.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Jonathan Cameron <jic23@kernel.org>,
Chris Li <sparse@chrisli.org>,
Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
linux-sparse@vger.kernel.org
Subject: Re: [PATCH v1 1/1] bitmap: Refactor bitmap_read() and bitmap_write() to avoid too big shift
Date: Tue, 24 Nov 2026 11:13:41 +0200 [thread overview]
Message-ID: <awVVRTuvDLLVmRlS@ashevche-desk.local> (raw)
In-Reply-To: <awBcWKvDGV8sLcGu@yury>
On Fri, Nov 20, 2026 at 09:42:32AM -0500, Yury Norov wrote:
> On Fri, Nov 20, 2026 at 10:42:24AM +0200, Andy Shevchenko wrote:
> > On Thu, Nov 19, 2026 at 04:22:06PM -0500, Yury Norov wrote:
> > > On Thu, Nov 19, 2026 at 11:03:53PM +0200, Andy Shevchenko wrote:
> > > > On Thu, Nov 19, 2026 at 03:37:33PM -0500, Yury Norov wrote:
> > > > > On Thu, Nov 19, 2026 at 08:15:30PM +0100, Andy Shevchenko wrote:
...
> > > > > I guess... Let's keep the patch minimal?
> > > > >
> > > > > > - mask = BITMAP_LAST_WORD_MASK(nbits);
> > > > > > - value &= mask;
> > > > > > - offset = start % BITS_PER_LONG;
> > > > > > - space = BITS_PER_LONG - offset;
> > > > > > - fit = space >= nbits;
> > > > >
> > > > > I don't like this 'fit' thing, and would like to drop it. But
> > > > > let's find a better motivation to do that?
> > > >
> > > > Why? The fit keeps the check I want to refactor, since it makes it twice
> > > > the code with that ternary looks ugly and unreadable. This is exactly the
> > > > chance to kill two birds with one stone.
> > >
> > > That's what I meant regarding the motivational part and minimizing the
> > > patch.
> >
> > OK. So refactoring bitmap_write() to make it look like bitmap_read() can be
> > done after your nice below patch.
>
> Sure, I'll take the patch with the tags suggested.
In the Linux Next it uses Link instead of Closes. Perhaps you still have
a chance to amend that?
> But you're very welcome to continue optimizing it - my gut feeling says we
> can squeeze a few more percents out of it with just a careful refactoring.
Sure, when I have time to look into this again.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-11-24 10:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 19:15 [PATCH v1 1/1] bitmap: Refactor bitmap_read() and bitmap_write() to avoid too big shift Andy Shevchenko
2026-11-19 20:37 ` Yury Norov
2026-11-19 21:03 ` Andy Shevchenko
2026-11-19 21:22 ` Yury Norov
2026-11-20 8:42 ` Andy Shevchenko
2026-11-20 8:51 ` Andy Shevchenko
2026-11-20 14:42 ` Yury Norov
2026-11-24 9:13 ` Andy Shevchenko [this message]
2026-11-24 20:57 ` Yury Norov
2026-11-25 10:14 ` 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=awVVRTuvDLLVmRlS@ashevche-desk.local \
--to=andriy.shevchenko@linux.intel.com \
--cc=jic23@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sparse@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=luc.vanoostenryck@gmail.com \
--cc=sparse@chrisli.org \
--cc=ynorov@nvidia.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.