Re: [PATCH v1 1/1] treewide: Align match_string() with sysfs_match_string()

From: Linus Torvalds
Date: Tue Jun 11 2024 - 19:49:20 EST


On Tue, 11 Jun 2024 at 14:38, Yury Norov <yury.norov@xxxxxxxxx> wrote:
>
> On Mon, Jun 10, 2024 at 10:08:00AM +0200, Linus Walleij wrote:
>
> Hi Linus,

Real Linus here, not that other non-real one.

> I think about renaming set_bit() stuff for atomicity at least twice
> a year.

Yeah, no. The double underscores are historical, and not always great,
but when it comes to the bit ops they are at least fairly obvious: the
double-underscore version is the "unlocked" version.

That is, in fact, the very traditional logic for the in-kernel use:
the traditional model for double underscores is the "this is the
underlying implementation that doesn't do the whole thing, don't use
unless you know *exactly* what you are doing".

So for the bitops, it means "not atomic".

For user accesses, it meant "doesn't do the full checking".

And for a lot of other things, it meant "you need to take the proper lock".

So there's actually often that kind of unifying logic there.

For this match_string() thing, that was *not* the case. There the
double underscore just meant "non-array interface". I NAK'ed it
elsewhere for that - and other - reasons.

Linus