Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp289930iob; Wed, 11 May 2022 14:38:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDt6MX/j84ptvhFt+u5qsaoSw9Gn6qfFkBP56VLaylS2Z2BoOYIh9nCVrYXIk17czI0hGB X-Received: by 2002:a17:906:9b94:b0:6f3:fd8d:8a00 with SMTP id dd20-20020a1709069b9400b006f3fd8d8a00mr27005296ejc.90.1652305088364; Wed, 11 May 2022 14:38:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652305088; cv=none; d=google.com; s=arc-20160816; b=b/AlbUoL/TUh7q1+uZEZUbEPDi+wNzfxntocAum+/sc+1VlAZ2+UKMfDIY/M/zOLe1 0hoAJOWz8EBnv6/CQBIqVJpsOsz+2kJBmuqx2/rfMyIHb+OzMat72k9RmK7JZ1rnocm5 5cMCCahQS/3yOJYdYfBdLqEuBeEXWop6oXFo/Qjr5UtKXrTLmzVUxC/hEwk8v43QbnsA gcpTxIt9zne03qmhN26OJKGInBaFAXJjEdn4jYVOJztMvlsHqhXPZQdMT/bnzBfhbLRO mBnE1cfoKZ3yyB6lgGvfsvsdBopwqzYggujKc6sfFtL9iwYDYWIcARPkdwbnwBzVV4h3 Cq5g== 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=mP/86oh5D3d7YPJx0+zhN/dtgBHPyShEV7A2+2ykn3Y=; b=dq42BYYOHjkLyFaF7hX2pF3/ub8QOCmNl5YpItbTfwpEmMCHMpA/QhSbCZp5edW5hx g1G7lOh1hwnSWNN5z7Zv0+F+HTHJlQYUovb84YhITAKFNWMtxng3nxNeWjj58Qk7tsnz /v3lws03hoBj2xTv5zrqOelhbSQaLMKEyaVi/Szw0KEAZE0i9HICwH7Y60MHnNa2g8Om Q6MEqGwYaRFn4AY98MAdddkzL8J/yUXEdeuyffks+4mRqugZiwMEmXaV8PRZ63tynQJs V2PNxGnX9IIVF+BiQGsgjr3I/HLWlAneakzgc0YVZsNXAGD3QGxeI//ZsV1RXPXcFa4o xSAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=LQHpzRt6; 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 g7-20020a1709065d0700b006df9b4858fdsi4125836ejt.50.2022.05.11.14.37.42; Wed, 11 May 2022 14:38:08 -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=20210112 header.b=LQHpzRt6; 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 S1345349AbiEKVP3 (ORCPT + 99 others); Wed, 11 May 2022 17:15:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347978AbiEKVPU (ORCPT ); Wed, 11 May 2022 17:15:20 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B80722922E for ; Wed, 11 May 2022 14:15:18 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id z2so6515607ejj.3 for ; Wed, 11 May 2022 14:15:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mP/86oh5D3d7YPJx0+zhN/dtgBHPyShEV7A2+2ykn3Y=; b=LQHpzRt60RV1fucmT70DWSrOSPuZzASiWAbm8oOfHI4KsEbfBuz2Ox2D7eQlee2ViN w+eyxRny5jRgpeNImOZtDMVmqua/OnVr5Mu/veRfxmHMlHP/x34qY28r2zrTbEfhM8mE iwi9+NJrboMpwrNABMky8Nri4WCxu4/eUytH13qsYib8cMxRw0/NL3fCohsaeqBi+KpM E48nKIY6B/1zCZjJ9tzleQprrXwzhKgiwewCS4yUZ25dpm/3Rhiiu/vGh2tg7wpSNAh4 ZJhUfmY0GFeq5NMKJ1cV/MV8uRlzgNYZIxzv8Ps9GOWnOOKFitvKpFQzCOJISSsylKf2 +L1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mP/86oh5D3d7YPJx0+zhN/dtgBHPyShEV7A2+2ykn3Y=; b=mCCCMNocY5BTyPHDMG2iTYHerO86n8UHJfQISBvP7d0JmK/qWxqIXrPs8s2iZBKOhI 6tW2QGDgPXncs2YjKzvZsSVA7ncPgvY6bPl5h3NaGcFErba+LJ4EdaujhmO1MKmrVSgl uZwFGOLjUFqKU2vqcmESChsOtYBvB+ggiLNNw2Y1h2pcWr5sWsPhIsh3XgzbkRG+Z/Uv 80ScdjeH3Wm3VS+nPfR9Z0cQd5ViEBOZusUXJ/m1FiJ6GgRhgOtRiWnPOWKOp0orHK6B yfTo7WF7RC4EBtGwzTBbVmcNpDBWxFxvvofoLRpzC6RfErDcEu0AbWejJ1zz8Q2Wbk4Y BBig== X-Gm-Message-State: AOAM530CZ3Jnv42g03yHlZkO9kyAx/ZUBcakEeBlV7TGpaO0WVJeNIjB RJVTJOz3NRgNZMr37q9VP1k/eYzmdqgr1XbAWj9AiPbLVdA= X-Received: by 2002:a17:907:a40e:b0:6fd:c29b:e0b3 with SMTP id sg14-20020a170907a40e00b006fdc29be0b3mr7108434ejc.542.1652303716467; Wed, 11 May 2022 14:15:16 -0700 (PDT) MIME-Version: 1.0 References: <20220406232240.1825048-1-dlatypov@google.com> In-Reply-To: <20220406232240.1825048-1-dlatypov@google.com> From: Daniel Latypov Date: Wed, 11 May 2022 14:15:05 -0700 Message-ID: Subject: Re: [PATCH] kunit: bail out of test filtering logic quicker if OOM To: brendanhiggins@google.com, davidgow@google.com Cc: linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, skhan@linuxfoundation.org, Zeal Robot , Lv Ruyi Content-Type: text/plain; charset="UTF-8" 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,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=unavailable 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 On Wed, Apr 6, 2022 at 4:22 PM Daniel Latypov wrote: > > When filtering what tests to run (suites and/or cases) via > kunit.filter_glob (e.g. kunit.py run ), we allocate copies of > suites. > > These allocations can fail, and we largely don't handle that. > Note: realistically, this probably doesn't matter much. > We're not allocating much memory and this happens early in boot, so if > we can't do that, then there's likely far bigger problems. > > This patch makes us immediately bail out from the top-level function > (kunit_filter_suites) with -ENOMEM if any of the underlying kmalloc() > calls return NULL. > > Implementation note: we used to return NULL pointers from some functions > to indicate either that all suites/tests were filtered out or there was > an error allocating the new array. > > We'll log a short error in this case and not run any tests or print a > TAP header. From a kunit.py user's perspective, they'll get a message > about missing/invalid TAP output and have to dig into the test.log to > see it. Since hitting this error seems so unlikely, it's probably fine > to not invent a way to plumb this error message more visibly. > > See also: https://lore.kernel.org/linux-kselftest/20220329103919.2376818-1-lv.ruyi@zte.com.cn/ > > Signed-off-by: Daniel Latypov > Reported-by: Zeal Robot > Signed-off-by: Lv Ruyi Oh, I just realized the typo here. This was meant to be a second "Reported-by:" Let me sound out a v2 to fix that.