Re: [PATCH rcu 3/6] rcu/rcuscale: Move rcu_scale_*() after kfree_scale_cleanup()

From: Paul E. McKenney
Date: Fri May 12 2023 - 12:40:13 EST


On Thu, May 11, 2023 at 09:15:17PM -0700, Joel Fernandes wrote:
>
>
> > On May 11, 2023, at 8:20 PM, Zhuo, Qiuxu <qiuxu.zhuo@xxxxxxxxx> wrote:
> >
> > 
> >>
> >> From: Paul E. McKenney <paulmck@xxxxxxxxxx>
> >> ...
> >>>> I wish diff was better at showing what really changed. The meld tool
> >>>> can help but its gui...
> >>>>
> >>>> Should I run meld later (I'm out at a conference so no access to
> >>>> meld-capable
> >>>> machines) or are we sufficiently confident that the lines were moved
> >>>> as-is ? :)
> >>>>
> >>>
> >>> Thank you, Joel for this concern. Good to know the meld diff GUI tool.
> >>> I just run the command below and confirmed that the lines were moved
> >>> as-is: rcu_scale_{cleanup,shutdown}() follows kfree_scale_cleanup().
> >>> You may double check it ;-).
> >>>
> >>> meld --diff ./rcuscale.c.before ./rcuscale.c.after
> >>
> >> Nice, thank you both!
> >>
> >> Another option is to check out the commit corresponding to this patch, then
> >> do "git blame -M kernel/rcu/rcuscale.c". Given a move-only commit, there
> >> should be no line tagged with this commit's SHA-1.
> >
> > Just had a good experiment with the "git blame -M" option:
> > - Used this option to prove a move-only commit quickly (no line tagged with that commit) (the fastest method to me).
> > - Then just only needed to quickly check the positions of the moved code chunk by myself (easy).
> >
> > Thank you, Paul for sharing this. It's very useful to me.
>
> Looks good to me as well and thank you both for sharing the tips.

Here is one way to script this, where "SHA" identifies the commit to
be checked and PATHS the affected pathnames:

git checkout SHA^
git show SHA | git apply -
git blame -M PATHS | grep '^0* '

If there is no output, there were no non-move changes.

Or just do the "git blame -M PATHS | grep '^0* '" before doing the
checking.

And yes, you can derive PATHS using "git status" if you want. ;-)

Thanx, Paul