Re: [PATCH 00/13] Rename k[v]free_rcu() single argument to k[v]free_rcu_mightsleep()

From: Joel Fernandes
Date: Wed Mar 15 2023 - 22:13:43 EST


Hey Steve,

On Wed, Mar 15, 2023 at 6:26 PM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
[...]
> > Also "mightsleep" means just that -- *might*. That covers the fact
> > that sleeping may not happen ;-).
>
> Yes, and even though you are doubtful of it not ever having a non-sleep
> implementation, there is still a chance that there might be something
> someday.

Perhaps if it never sleeps, then we would introduce back the
single-arg kvfree_rcu() and delete the kvfree_rcu_mightsleep()` at
that point, since it would not serve any purpose.

> > This is just my opinion and I will defer to Uladzislau, Paul and you
> > on how to proceed. Another option is "cansleep" which has the same
> > number of characters as headless. I don't believe expecting users to
> > read comments is practical, since we did already have comments and
> > there was a bug in the usage that triggered this whole series.
>
> The point of "headless" is that is the rational for this version of
> kvfree_rcu(). It doesn't have a head. That's an API name that users care
> about.
>
> Why not call it kvfree_rcu_alloc() ? It allocates right?

Sure, but one can say now that allocating is an implementation detail? ;-)

Also, it may sound strange to have 'free' and 'alloc' in the same name.

> We have might_sleep() in lots of places. In fact, the default is things
> might sleep. We don't need to call it out. That's what the might_sleep()
> call is for. Usually it's the non sleep version that is special.
>
> We could call the normal kvfree_rcu() "kvfree_rcu_inatomic()" ;-)

Heh, I actually like 'inatomic' alot ;-)

> But I guess that would be a bigger change.
>

True.

thanks,

- Joel