Message ID | 20240620175703.605111-1-yury.norov@gmail.com |
---|---|
Headers | show |
Series | lib/find: add atomic find_bit() primitives | expand |
On Thu, Jun 20, 2024 at 11:00:38AM -0700, Linus Torvalds wrote: > On Thu, 20 Jun 2024 at 10:57, Yury Norov <yury.norov@gmail.com> wrote: > > > > > > The typical lock-protected bit allocation may look like this: > > If it looks like this, then nobody cares. Clearly the user in question > never actually cared about performance, and you SHOULD NOT then say > "let's optimize this that nobody cares about":. > > Yury, I spend an inordinate amount of time just double-checking your > patches. I ended up having to basically undo one of them just days > ago. Is that in master already? I didn't get any email, and I can't find anything related in the master branch. > New rule: before you send some optimization, you need to have NUMBERS. I tried to underline that it's not a performance optimization at my best. People notice some performance differences, but it's ~3%, no more. > Some kind of "look, this code is visible in profiles, so we actually care". The original motivation comes from a KCSAN report, so it's already visible in profiles. See [1] in cover letter. This series doesn't fix that particular issue, but it adds tooling that allow people to search and acquire bits in bitmaps without firing KCSAN warnings. This series fixes one real bug in the codebase - see #33, and simplifies bitmaps usage in many other places. Many people like it, and acked the patches. Again, this is NOT a performance series. Thanks, Yury > Because without numbers, I'm just not going to pull anything from you. > These insane inlines for things that don't matter need to stop. > > And if they *DO* matter, you need to show that they matter. > > Linus
On Thu, 20 Jun 2024 at 13:20, Yury Norov <yury.norov@gmail.com> wrote: > > FORCE_NR_CPUS helped to generate a better code for me back then. I'll > check again against the current kernel. Of _course_ it generates better code. But when "better code" is a source of bugs, and isn't actually useful in general, it's not better, is it. > The 5d272dd1b343 is wrong. Limiting FORCE_NR_CPUS to UP case makes no > sense because in UP case nr_cpu_ids is already a compile-time macro: Yury, I'm very aware. That was obviously intentional. the whole point of the commit is to just disable the the whole thing as useless and problematic. I could have just ripped it out entirely. I ended up doing a one-liner instead. Linus