Re: [PATCH] hv_balloon: Update the balloon driver to use the SBRM API

From: Wei Liu
Date: Thu Aug 03 2023 - 18:07:39 EST


On Mon, Jul 31, 2023 at 02:25:13PM -0700, Boqun Feng wrote:
> Hi Mitchell,
>
> On Wed, Jul 26, 2023 at 12:23:31AM +0000, Mitchell Levy via B4 Relay wrote:
> > From: Mitchell Levy <levymitchell0@xxxxxxxxx>
> >
> >
> >
> > ---
>
> I don't know whether it's a tool issue or something else, but all words
> after the "---" line in the email will be discarded from a commit log.
> You can try to apply this patch yourself and see the result:
>
> b4 shazam 20230726-master-v1-1-b2ce6a4538db@xxxxxxxxx
>
> > This patch is intended as a proof-of-concept for the new SBRM
> > machinery[1]. For some brief background, the idea behind SBRM is using
> > the __cleanup__ attribute to automatically unlock locks (or otherwise
> > release resources) when they go out of scope, similar to C++ style RAII.
> > This promises some benefits such as making code simpler (particularly
> > where you have lots of goto fail; type constructs) as well as reducing
> > the surface area for certain kinds of bugs.
> >
> > The changes in this patch should not result in any difference in how the
> > code actually runs (i.e., it's purely an exercise in this new syntax
> > sugar). In one instance SBRM was not appropriate, so I left that part
> > alone, but all other locking/unlocking is handled automatically in this
> > patch.
> >
> > Link: https://lore.kernel.org/all/20230626125726.GU4253@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/ [1]
> >
> > Suggested-by: Boqun Feng <boqun.feng@xxxxxxxxx>
> > Signed-off-by: "Mitchell Levy (Microsoft)" <levymitchell0@xxxxxxxxx>
>
> Beside the above format issue, the code looks good to me, nice job!
>
> Feel free to add:
>
> Reviewed-by: Boqun Feng <boqun.feng@xxxxxxxxx>
>

FAOD I'm expecting a v2 of this patch.

Thanks,
Wei.

> Regards,
> Boqun