All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gow <davidgow@google.com>
To: Benjamin Berg <benjamin@sipsolutions.net>
Cc: Matti Vaittinen <mazziesaccount@gmail.com>,
	Maxime Ripard <maxime@cerno.tech>,
	Brendan Higgins <brendan.higgins@linux.dev>,
	Stephen Boyd <sboyd@kernel.org>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Daniel Latypov <dlatypov@google.com>, Rae Moar <rmoar@google.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Jonathan Cameron <jic23@kernel.org>,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	kunit-dev@googlegroups.com
Subject: Re: [PATCH v1 0/3] kunit: Deferred action helpers
Date: Wed, 26 Apr 2023 14:51:45 +0800	[thread overview]
Message-ID: <CABVgOS=ca71mj=qsPBvji-iTf-QsjDrxGzOymVGBJj8oHaJzWg@mail.gmail.com> (raw)
In-Reply-To: <5a820cf9aae169e18635a8c867835817a50892b0.camel@sipsolutions.net>

[-- Attachment #1: Type: text/plain, Size: 1759 bytes --]

On Mon, 24 Apr 2023 at 22:02, Benjamin Berg <benjamin@sipsolutions.net> wrote:
>
> Hi David,
>
> On Mon, 2023-04-24 at 14:32 +0200, Benjamin Berg wrote:
> > On Fri, 2023-04-21 at 16:42 +0800, 'David Gow' via KUnit Development wrote:
> > > This is v1 of the KUnit deferred actions API, which implements an
> > > equivalent of devm_add_action[1] on top of KUnit managed resources. This
> > > provides a simple way of scheduling a function to run when the test
> > > terminates (whether successfully, or with an error). It's therefore very
> > > useful for freeing resources, or otherwise cleaning up.
> > >
> > > The notable changes since RFCv2[2] are:
> > > - Got rid of the 'cancellation token' concept. It was overcomplicated,
> > >   and we can add it back if we need to.
> > > - kunit_add_action() therefore now returns 0 on success, and an error
> > >   otherwise (like devm_add_action()). Though you may wish to use:
> > > - Added kunit_add_action_or_reset(), which will call the deferred
> > >   function if an error occurs. (See devm_add_action_or_reset()). This
> > >   also returns an error on failure, which can be asserted safely.
> > > - Got rid of the function pointer typedef. Personally, I liked it, but
> > >   it's more typedef-y than most kernel code.
> > > - Got rid of the 'internal_gfp' argument: all internal state is now
> > >   allocated with GFP_KERNEL. The main KUnit resource API can be used
> > >   instead if this doesn't work for your use-case.
> > >
> > > I'd love to hear any further thoughts!
> >
> > I am happy with it as-is.
>
> Oh, wait. Nothing big, but I just noticed that the new API functions
> seem to not yet be exported using EXPORT_SYMBOL_GPL.

Ah, nice catch! I'll add those to the next version.

Cheers,
-- David

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4003 bytes --]

  reply	other threads:[~2023-04-26  6:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-21  8:42 [PATCH v1 0/3] kunit: Deferred action helpers David Gow
2023-04-21  8:42 ` [PATCH v1 1/3] kunit: Add kunit_add_action() to defer a call until test exit David Gow
2023-04-26  2:12   ` Daniel Latypov
2023-04-26  6:59     ` David Gow
2023-04-21  8:42 ` [PATCH v1 2/3] kunit: executor_test: Use kunit_add_action() David Gow
2023-04-21  8:42 ` [PATCH v1 3/3] kunit: kmalloc_array: " David Gow
2023-04-24 12:32 ` [PATCH v1 0/3] kunit: Deferred action helpers Benjamin Berg
2023-04-24 14:02   ` Benjamin Berg
2023-04-26  6:51     ` David Gow [this message]
2023-04-25 15:23 ` Maxime Ripard
2023-04-26  6:51   ` David Gow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABVgOS=ca71mj=qsPBvji-iTf-QsjDrxGzOymVGBJj8oHaJzWg@mail.gmail.com' \
    --to=davidgow@google.com \
    --cc=benjamin@sipsolutions.net \
    --cc=brendan.higgins@linux.dev \
    --cc=dlatypov@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=jic23@kernel.org \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=maxime@cerno.tech \
    --cc=mazziesaccount@gmail.com \
    --cc=rafael@kernel.org \
    --cc=rmoar@google.com \
    --cc=sboyd@kernel.org \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.