Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp363547rwr; Tue, 25 Apr 2023 23:53:42 -0700 (PDT) X-Google-Smtp-Source: AKy350bHEZmvC2gCiBHLLf5N1LgvjTxQ7PLATxN9PGeawr4Io+8CXIE9DLk2xj+aB9e3ypE18vxI X-Received: by 2002:a05:6a00:1acd:b0:635:c8e4:ed0f with SMTP id f13-20020a056a001acd00b00635c8e4ed0fmr25365364pfv.11.1682492021808; Tue, 25 Apr 2023 23:53:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682492021; cv=none; d=google.com; s=arc-20160816; b=rixNsQ1MkTj2FUU7OTqPtAy1lpCOtsXGhpGRqZyAZ0hPtDL+RS6OD47gyw9kfAKWeL STejEFJbzNk/JwNP1etmhNBnbQGfdcNvPYdWZsFk2Rbap786FAzTnLzLApqmpqkTJoZZ uxyqXZ6cZfVvHW3x/9kkWghQmn1bsXLlJUysUVmLuMdTsqZT3Mw2h8g4DKGtyvYbXybz vIuWq2majlPXgm454uuNeupl045XK1++86h11JCineAt+PKhbgQnG7VFUWMR580Gv1pB NdSU1hc1d7NtB/lwIifiTS7no2KM4QqWscTHUswmdf+JYpN75PbdbTayQ1JBH4hA1Sj9 4Bqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=wElXf1wLx1RJfNW0iKlEDdzRW1/ZkH3DWQqPrw6Tzd4=; b=d8PGc8YdVy0dxXMHidNruhD45s1LTZeVMiAh1UHgg/a0YO7EH0cxSc5j9a+qtqN5Ny LU2jV70rRiYDi2050SR1eTOnHoHWtPEnnq1U6oMHG8KdkuSD0ymgrWJuLBcoLDp4NoDL HXOf11N35Mc06YCVY9kffZaREuRpoVz19MeMtpFsSj7IG7pYBLjBGwX2+HGzXgu4+ItZ 7DdNuJyAg9e+TRp0c9hjotWlhuidP8hwElZqS8lpN3/dpkpJb7gGrl01VkBcvd3V64hG rYYY6X27sPA0l32L+Smib13FGEngw+QAq+BdUSE69E6ipuDseX6o+z86nurMwzboszZp n/dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=HF0+QRnw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s127-20020a625e85000000b0063b7bb98251si15792530pfb.216.2023.04.25.23.53.30; Tue, 25 Apr 2023 23:53:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=HF0+QRnw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239629AbjDZGwL (ORCPT + 99 others); Wed, 26 Apr 2023 02:52:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239581AbjDZGwJ (ORCPT ); Wed, 26 Apr 2023 02:52:09 -0400 Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC7EC2715 for ; Tue, 25 Apr 2023 23:51:58 -0700 (PDT) Received: by mail-qt1-x82b.google.com with SMTP id d75a77b69052e-3ef31924c64so317751cf.1 for ; Tue, 25 Apr 2023 23:51:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1682491918; x=1685083918; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=wElXf1wLx1RJfNW0iKlEDdzRW1/ZkH3DWQqPrw6Tzd4=; b=HF0+QRnw9ICiurw86U/LgM5fzT0mpVosa90P4zqhTwet7UHrqFEjr114y7mxk3Djt+ DPNExJRsI9OqUCW9KhYhz7io5UeEkzqvIseYtlb7cUcNhndFTLzUVC0DWGtkswyfeVmQ 6M2MzwuZf3XNDMgWqkhJEJzCQ6QWRAm0J/p1oYvkymuNnCk2CDUijxdI12QhSh4K5+fE kXg/kyRBDZmNUTeF9egGb1bxD7lC9Wg0NOh+jXpjgs+1dDw3VwTEMyjEqk1jURTsms6A iXDnBVW+w+qSzqulIRFLymBg0INNcsr3xuTuxFQv1ccqSBlhSDkxEtBgU/PpKIG53cxR kdzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682491918; x=1685083918; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wElXf1wLx1RJfNW0iKlEDdzRW1/ZkH3DWQqPrw6Tzd4=; b=Jtmg3Xl7lTL33s5W+wywzjfomGuE8bh+Lde8xYVw1wY/8PB3DoUU1MsNhttGcX3Vs1 5esN/BEiV9vD1V6z0zBrKxo5GBTmwh2tooA9OiFZfgdEPu0gDdaMrU1DYbswUHLKhL7x 6rAUTMrEQmcZaGX4VTsyo/S9/bQ8s5TH/TFUf9l4pL7EvJ7Gl9RtYT/o4NWdb9EQqdpO rkpIcZ3mTriXXP4/0G9tg4QSzcUs3PFhVcLFBFOa9+e0l4EwlNx91TJHBGWtvVxJfDqG vXAEG8D3CYghOD7qGfQTmaqR1lGr8osp7lrNtdJndQgx48GloeygD5LjebVSJcD3dZKc gPig== X-Gm-Message-State: AC+VfDwnDSWOMvByEcq4RTmFfNG7Ao+x2gebSVtnzKx2q3auPkaya0yB LY5CXFu0GwxlMiLSffize02SUISXjKNWJjstqa4Y8A== X-Received: by 2002:a05:622a:1ce:b0:3ef:31a5:13c with SMTP id t14-20020a05622a01ce00b003ef31a5013cmr165018qtw.3.1682491917727; Tue, 25 Apr 2023 23:51:57 -0700 (PDT) MIME-Version: 1.0 References: <20230421084226.2278282-1-davidgow@google.com> <54b49d4ddf371d0581f3b795f50f7f6673557a96.camel@sipsolutions.net> <5a820cf9aae169e18635a8c867835817a50892b0.camel@sipsolutions.net> In-Reply-To: <5a820cf9aae169e18635a8c867835817a50892b0.camel@sipsolutions.net> From: David Gow Date: Wed, 26 Apr 2023 14:51:45 +0800 Message-ID: Subject: Re: [PATCH v1 0/3] kunit: Deferred action helpers To: Benjamin Berg Cc: Matti Vaittinen , Maxime Ripard , Brendan Higgins , Stephen Boyd , Shuah Khan , Daniel Latypov , Rae Moar , Greg Kroah-Hartman , "Rafael J . Wysocki" , Heikki Krogerus , Jonathan Cameron , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="0000000000001c35be05fa37adf5" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --0000000000001c35be05fa37adf5 Content-Type: text/plain; charset="UTF-8" On Mon, 24 Apr 2023 at 22:02, Benjamin Berg 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 --0000000000001c35be05fa37adf5 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIPnwYJKoZIhvcNAQcCoIIPkDCCD4wCAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg ggz5MIIEtjCCA56gAwIBAgIQeAMYYHb81ngUVR0WyMTzqzANBgkqhkiG9w0BAQsFADBMMSAwHgYD VQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UE AxMKR2xvYmFsU2lnbjAeFw0yMDA3MjgwMDAwMDBaFw0y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