From patchwork Fri Nov 1 18:40:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sabyrzhan Tasbolatov X-Patchwork-Id: 13859677 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A151CE6F07D for ; Fri, 1 Nov 2024 18:40:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3706C6B008A; Fri, 1 Nov 2024 14:40:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 320426B008C; Fri, 1 Nov 2024 14:40:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1C0E36B0093; Fri, 1 Nov 2024 14:40:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id F11796B008A for ; Fri, 1 Nov 2024 14:40:24 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 78F0BACE3B for ; Fri, 1 Nov 2024 18:40:24 +0000 (UTC) X-FDA: 82738390728.24.DD9861F Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by imf05.hostedemail.com (Postfix) with ESMTP id 8FF6110000B for ; Fri, 1 Nov 2024 18:39:28 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=JVeugnK2; spf=pass (imf05.hostedemail.com: domain of snovitoll@gmail.com designates 209.85.167.49 as permitted sender) smtp.mailfrom=snovitoll@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730486340; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=325HZLula7jSoNoGXlC+vhYpf/xwBEOPgui+U1ZAOR4=; b=djIkVxEgXRpMhqZ6jvvkC0GtMQM223CZfaO4G39PrYpyvAnTj33Q3l+I/uug0+7HOp2gI1 Izlvf2cDKII65RBWZp1iKvS5MY+yfVWhTCk5Zf5XHp2wFE+l9kOSzW/ubxJtEFKbKSxGXb 6lIFa7LA+3/RJ6FG2F4Oh2Ji4CElkWI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730486340; a=rsa-sha256; cv=none; b=voW0PtArkDe50h+5XQmj9UuvuJhnvjquJLMUQ1GZqJvnBpGEEiKBHpYlc9aGhdCL9uR9Rj 9rpspVtGmqKM8M09gWKyZDVGphsYI/qRJyqlfDo1XXzN3ERJ2woPzCHcVuA9Pn2S6zVX6O 5vhded3CihsRWoAzVJ/grTal6E4X9Bc= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=JVeugnK2; spf=pass (imf05.hostedemail.com: domain of snovitoll@gmail.com designates 209.85.167.49 as permitted sender) smtp.mailfrom=snovitoll@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-539f2b95775so2730335e87.1 for ; Fri, 01 Nov 2024 11:40:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730486421; x=1731091221; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=325HZLula7jSoNoGXlC+vhYpf/xwBEOPgui+U1ZAOR4=; b=JVeugnK2LsBuW5OKGqclXXQ5qLR/C39PFRCpmM9OwfJQTrA0ofauOXInLLdJ/Y4cXq 60xI5eXHz/WL2vKg17EHk9GUL7eUJ/E34HU1rEB91IGHgAUpaEgjGyOlo5mOl7KNND31 DZNQK4pgO/GHBUMt147cQeXKvot60PWJ2Cg0Rx3JHQqf+/PnRvSCpG3eMlJ7a8CB9oap KxwFSsGd4T9iuJsZX+Dxchr7fS09AmhivqnUPjRbVXCflNy6BetojLWRY15R4UxLIVyQ XW1EGDeNdqzWKdMXC1QW39BepatKajgbn5i+k+lALeYaRT/pN1XFMtAcRfsjpmIEO6TM V4Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730486421; x=1731091221; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=325HZLula7jSoNoGXlC+vhYpf/xwBEOPgui+U1ZAOR4=; b=B0Rh5IaSTwiXUvJ4L99MMOySKIaHIsrHRHg/KS3FRacE4qdLUaxeoYxgLTYwyA9a9J 7+ZLOwecVnO3IU8LI0K/MHT8Dr0sxAGTtThk46owSEmn03wGByUUiioPucDzzbmZn3QH NHdYtp8g0EaXPXlY33Rb80DB1Dd5YZ73lhiIiS7o9h4RcWrz52TV2nEJDo4CGFzKl+JI YzonTmQ45gtzmEBTrURsAqNCPzNm9VIMPwadMYB5ciXLUce1pl+Ez5uwNo6tcnVVSxaO C4Q7unkluFi5aBireJc/pXZa2Wr6Fgc2imdpYRfEeYikLXElry7fbxKOqdyM/PZSDz+u N6KA== X-Forwarded-Encrypted: i=1; AJvYcCXGOP1LQKw5CAcPbLRvyxcUq69TY3F26J/RSHUPFK5L1/NnyV85HFqLwuuvv0iRVpplnibiaHwakg==@kvack.org X-Gm-Message-State: AOJu0YwrRicTNa6edS4+XViL8Ep9RnaaCSKfsjJONubQTWVDqCOvzxuZ ldpQRqhAiQQwfy/PS5lihXOPMocbnvY5VZLYhN1kz+MEO3veGJC/ X-Google-Smtp-Source: AGHT+IFJs6WKOoZ+dQPXZdy5J0yt3B7+wP/Od81xCXCJNl3ABlWzNAHthdTYNFEexLKPL7ABxshCLw== X-Received: by 2002:a05:6512:3a8b:b0:539:89a8:600f with SMTP id 2adb3069b0e04-53d65de5298mr4080862e87.23.1730486420555; Fri, 01 Nov 2024 11:40:20 -0700 (PDT) Received: from work.. (2.133.25.254.dynamic.telecom.kz. [2.133.25.254]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53c7bc957cbsm646821e87.60.2024.11.01.11.40.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 11:40:19 -0700 (PDT) From: Sabyrzhan Tasbolatov To: ryabinin.a.a@gmail.com, andreyknvl@gmail.com, elver@google.com Cc: arnd@kernel.org, glider@google.com, dvyukov@google.com, vincenzo.frascino@arm.com, akpm@linux-foundation.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, snovitoll@gmail.com Subject: [PATCH 1/2] kasan: use EXPORT_SYMBOL_IF_KUNIT to export symbols Date: Fri, 1 Nov 2024 23:40:10 +0500 Message-Id: <20241101184011.3369247-2-snovitoll@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241101184011.3369247-1-snovitoll@gmail.com> References: <20241101184011.3369247-1-snovitoll@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam10 X-Stat-Signature: 48nmnz3ueksnm6qs3qj4faane69rrzhu X-Rspamd-Queue-Id: 8FF6110000B X-Rspam-User: X-HE-Tag: 1730486368-761720 X-HE-Meta: U2FsdGVkX18IJZlc488zaByNqmdx1Q3sx9zuF7ivQ2K83TlcUGREuBxTPJlSK+LKvXJfmqAzERrlLrF7KWTUAzFLmD5s/YWVE9KlGtL/Boatnguag5bM85bHnv6N4WHaRunzQ9/PMmNQOLCnRbmzMT6qxO7LBxv2dtJNlblCikG7LRV+dr/6g689BC9KrWO6ibDpMyBlt13gmGhvHy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53Fy9X5xKpWGifBV3DxRgVnYHkiTr6UV98q6zkkfAVtpRzmJl91NUFp10EUuubeCTqmRezjO5xcjCr/ehHwlRxzXRPNJjq27Oz2Z1EgRNHqUSkYoOMsvuDzuzH6hUBZBCkblDCqA5LJX3ku0uk9Z835pbodnAwba9oYN2NVNJAXcfDetFxcyjnZ+e3v1zfkA5oHN8Eq4tOwBafNhRQvndalMeKiMezsSzFP/I= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Replace EXPORT_SYMBOL_GPL with EXPORT_SYMBOL_IF_KUNIT to mark the symbols as visible only if CONFIG_KUNIT is enabled. KASAN Kunit test should import the namespace EXPORTED_FOR_KUNIT_TESTING to use these marked symbols. Reported-by: Andrey Konovalov Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218315 Signed-off-by: Sabyrzhan Tasbolatov Reviewed-by: Andrey Konovalov --- mm/kasan/hw_tags.c | 7 ++++--- mm/kasan/kasan_test_c.c | 2 ++ mm/kasan/report.c | 17 +++++++++-------- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/mm/kasan/hw_tags.c b/mm/kasan/hw_tags.c index 9958ebc15d38..ccd66c7a4081 100644 --- a/mm/kasan/hw_tags.c +++ b/mm/kasan/hw_tags.c @@ -8,6 +8,7 @@ #define pr_fmt(fmt) "kasan: " fmt +#include #include #include #include @@ -394,12 +395,12 @@ void kasan_enable_hw_tags(void) #if IS_ENABLED(CONFIG_KASAN_KUNIT_TEST) -EXPORT_SYMBOL_GPL(kasan_enable_hw_tags); +EXPORT_SYMBOL_IF_KUNIT(kasan_enable_hw_tags); -void kasan_force_async_fault(void) +VISIBLE_IF_KUNIT void kasan_force_async_fault(void) { hw_force_async_tag_fault(); } -EXPORT_SYMBOL_GPL(kasan_force_async_fault); +EXPORT_SYMBOL_IF_KUNIT(kasan_force_async_fault); #endif diff --git a/mm/kasan/kasan_test_c.c b/mm/kasan/kasan_test_c.c index a181e4780d9d..3e495c09342e 100644 --- a/mm/kasan/kasan_test_c.c +++ b/mm/kasan/kasan_test_c.c @@ -33,6 +33,8 @@ #define OOB_TAG_OFF (IS_ENABLED(CONFIG_KASAN_GENERIC) ? 0 : KASAN_GRANULE_SIZE) +MODULE_IMPORT_NS(EXPORTED_FOR_KUNIT_TESTING); + static bool multishot; /* Fields set based on lines observed in the console. */ diff --git a/mm/kasan/report.c b/mm/kasan/report.c index b48c768acc84..e5bc4e3ee198 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c @@ -10,6 +10,7 @@ */ #include +#include #include #include #include @@ -134,18 +135,18 @@ static bool report_enabled(void) #if IS_ENABLED(CONFIG_KASAN_KUNIT_TEST) || IS_ENABLED(CONFIG_KASAN_MODULE_TEST) -bool kasan_save_enable_multi_shot(void) +VISIBLE_IF_KUNIT bool kasan_save_enable_multi_shot(void) { return test_and_set_bit(KASAN_BIT_MULTI_SHOT, &kasan_flags); } -EXPORT_SYMBOL_GPL(kasan_save_enable_multi_shot); +EXPORT_SYMBOL_IF_KUNIT(kasan_save_enable_multi_shot); -void kasan_restore_multi_shot(bool enabled) +VISIBLE_IF_KUNIT void kasan_restore_multi_shot(bool enabled) { if (!enabled) clear_bit(KASAN_BIT_MULTI_SHOT, &kasan_flags); } -EXPORT_SYMBOL_GPL(kasan_restore_multi_shot); +EXPORT_SYMBOL_IF_KUNIT(kasan_restore_multi_shot); #endif @@ -157,17 +158,17 @@ EXPORT_SYMBOL_GPL(kasan_restore_multi_shot); */ static bool kasan_kunit_executing; -void kasan_kunit_test_suite_start(void) +VISIBLE_IF_KUNIT void kasan_kunit_test_suite_start(void) { WRITE_ONCE(kasan_kunit_executing, true); } -EXPORT_SYMBOL_GPL(kasan_kunit_test_suite_start); +EXPORT_SYMBOL_IF_KUNIT(kasan_kunit_test_suite_start); -void kasan_kunit_test_suite_end(void) +VISIBLE_IF_KUNIT void kasan_kunit_test_suite_end(void) { WRITE_ONCE(kasan_kunit_executing, false); } -EXPORT_SYMBOL_GPL(kasan_kunit_test_suite_end); +EXPORT_SYMBOL_IF_KUNIT(kasan_kunit_test_suite_end); static bool kasan_kunit_test_suite_executing(void) { From patchwork Fri Nov 1 18:40:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sabyrzhan Tasbolatov X-Patchwork-Id: 13859678 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 126EFE6F07D for ; Fri, 1 Nov 2024 18:40:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9B4216B008C; Fri, 1 Nov 2024 14:40:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 963D76B0095; Fri, 1 Nov 2024 14:40:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7DCAF6B0096; Fri, 1 Nov 2024 14:40:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 5F0446B008C for ; Fri, 1 Nov 2024 14:40:28 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 0D746120C23 for ; Fri, 1 Nov 2024 18:40:28 +0000 (UTC) X-FDA: 82738391190.04.BD5FACA Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by imf10.hostedemail.com (Postfix) with ESMTP id 63248C0007 for ; Fri, 1 Nov 2024 18:40:13 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=mxY4VuXh; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf10.hostedemail.com: domain of snovitoll@gmail.com designates 209.85.167.54 as permitted sender) smtp.mailfrom=snovitoll@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730486344; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=vvvOwVHZ4i14J6dT/7UuF/SG7t5JsDpEeQt8L7cE6aI=; b=EujJkAGG+54Y9jeIYY2lTmQc/WadlW7joBv4RwXbb5OQeFqd1TMSDSVRlPp7RqlWqmU+Rw 03FKmkBjouIMllrL+RY99CmfXaFNNLFLFQuSWM+P6t8gKz4kXDaRZT2Kl0EEHQeN8p69rW d2EGhWo5yBxFbK5uJg4ZjlZcF49rKAs= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=mxY4VuXh; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf10.hostedemail.com: domain of snovitoll@gmail.com designates 209.85.167.54 as permitted sender) smtp.mailfrom=snovitoll@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730486344; a=rsa-sha256; cv=none; b=2jA4WJl/YfGbqyZOzZOWF+u8jrx9QmEgceCXm/yJMQ2VERAhaUj/rv1UaRwC9WO9SGQ/oZ 9JPD69stIvMeytjvVwiRJUBRikXmgNt3h+ofN804eQGK/N07VaXNyBoDsRgvqreO0prln5 /gz0fG39CAKsIUS8T+JV0IVnWIhZ8u8= Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-539f7606199so103927e87.0 for ; Fri, 01 Nov 2024 11:40:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730486424; x=1731091224; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vvvOwVHZ4i14J6dT/7UuF/SG7t5JsDpEeQt8L7cE6aI=; b=mxY4VuXh6edorHxm7pO3rYsSMoG0mDbCeCzuswrc9xsnr9wy0/v8dDieEgwmXvGDP5 gBdBFraBnHd0zHWOwDdMwJxTip3kNCqA+wXJSjwvzS1pPg4jYOrSnGW1FRm41xfn7nk0 puj0/XlJ2xUmZnaMUio06QOWH8WlxMclE3OLuOphCwAFaQb56Ha5sQ9lkNG1cLBOdNyv Vh8eqwc1XxmLBcrVxRqDppvXGFNBPo2iFi2e/3tFzKGJuQLC9Tzk+3BJB/EW5i0G4Z9k I12AHO84TpXl2qjOVikKaKHecxxdQ3MEMatU7jaBDXn8LhuOo8MyLF3P9kdH1dFjL86h wVnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730486424; x=1731091224; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vvvOwVHZ4i14J6dT/7UuF/SG7t5JsDpEeQt8L7cE6aI=; b=I8Cua3ulck8KUKQPX74R3r4PhTrAouYoG0B5DP3mO3FeWBoY67H6e+Yk5IdfxEW27/ WVlrgQ4VTvwoCG3Pk36eXiG4gSyAtdfwNM1qX5L01dyYVTmuwAe4cVkWy7VTcp3B+fF+ AilIxmhgk5Sl/z7G23OiwqrH2l0RWWzFC4YwmvuIel7o6kavOIk+crhrpyBMd8BDhvnC 1aJ/T0E/ZFyxM1FIXv1J3oU/R9nAZ9uiSEVLCsDsc/DABcT3Rsulqm3bJFe5V0ahFRrQ MfMleIWhaWsM4gxUutXv5WrPDFHgOyTtvR+DJ1ER5x2XENLhrQMCmgdr7NKbE+rQPyWW fJLg== X-Forwarded-Encrypted: i=1; AJvYcCU0sm9yHLmW+F36gUhzwNtNdQMS4PMk6jy/5Bffa++nRmQrMPDV8v1q9m+3FtrA2XYfd8nEO04TGQ==@kvack.org X-Gm-Message-State: AOJu0YzqbNdMyFfs+cdgcQhKEb0YmXocogNw6L5us5xSWuK1WvWso8UD I0K0aw+56mTR7qootf/5ex+VeX3U/epCRc3I3PXNW3uMa8JaJsBT X-Google-Smtp-Source: AGHT+IH5fcF8BYzg6W5STIyYo1fvvKvw1DJ0Of90pEW3zppY2vMeDONybXD+PH9MpX9iAFVv+lPGvw== X-Received: by 2002:a05:6512:a87:b0:53b:27ba:2d11 with SMTP id 2adb3069b0e04-53b7ece09bamr7284478e87.16.1730486423951; Fri, 01 Nov 2024 11:40:23 -0700 (PDT) Received: from work.. (2.133.25.254.dynamic.telecom.kz. [2.133.25.254]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53c7bc957cbsm646821e87.60.2024.11.01.11.40.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 11:40:23 -0700 (PDT) From: Sabyrzhan Tasbolatov To: ryabinin.a.a@gmail.com, andreyknvl@gmail.com, elver@google.com Cc: arnd@kernel.org, glider@google.com, dvyukov@google.com, vincenzo.frascino@arm.com, akpm@linux-foundation.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, snovitoll@gmail.com Subject: [PATCH 2/2] kasan: change kasan_atomics kunit test as KUNIT_CASE_SLOW Date: Fri, 1 Nov 2024 23:40:11 +0500 Message-Id: <20241101184011.3369247-3-snovitoll@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241101184011.3369247-1-snovitoll@gmail.com> References: <20241101184011.3369247-1-snovitoll@gmail.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 63248C0007 X-Stat-Signature: rwndy94mrjddjnsd7yg7iuhpr6gte4wc X-HE-Tag: 1730486413-336298 X-HE-Meta: U2FsdGVkX1+CBasYX715Is+y36boqLz18nEjB7VCfgj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AUIPMz8c0seVw3IVKW7YPz7esToyOIJo3n8s4L7qd0KOlj1G2mWn2DVoGzPqwQ1kRMsaouIo0+atp8yVMVZQDnN/kWP1tfgXX0JUolumxhX7ITm87QJAzM2JIH5Iv1i6ZvvyNMmSKwBklMH1TjMZT90O4DRF92nBT2BjvN3hjnstxQk8gpTLVWvAoFb3DE7nkkNOl947SJ2eV6zeKPohcu96LJ7F4HG9KsDzgSRCkUuR+IjKAjAvlnfFBoj1LDOl54kbOryRCcI0Il8sIRbTX//i9QtBLemgbdeCAZ2iypRdUxCjmAtU1kzUOwjeOs7sceN6li48AoPhWgjcbLEn+09Z6s/RE5odDex7jaew== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000019, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: During running KASAN Kunit tests with CONFIG_KASAN enabled, the following "warning" is reported by kunit framework: # kasan_atomics: Test should be marked slow (runtime: 2.604703115s) It took 2.6 seconds on my PC (Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz), apparently, due to multiple atomic checks in kasan_atomics_helper(). Let's mark it with KUNIT_CASE_SLOW which reports now as: # kasan_atomics.speed: slow Signed-off-by: Sabyrzhan Tasbolatov Reviewed-by: Andrey Konovalov --- mm/kasan/kasan_test_c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/kasan/kasan_test_c.c b/mm/kasan/kasan_test_c.c index 3e495c09342e..3946fc89a979 100644 --- a/mm/kasan/kasan_test_c.c +++ b/mm/kasan/kasan_test_c.c @@ -2020,7 +2020,7 @@ static struct kunit_case kasan_kunit_test_cases[] = { KUNIT_CASE(kasan_strings), KUNIT_CASE(kasan_bitops_generic), KUNIT_CASE(kasan_bitops_tags), - KUNIT_CASE(kasan_atomics), + KUNIT_CASE_SLOW(kasan_atomics), KUNIT_CASE(vmalloc_helpers_tags), KUNIT_CASE(vmalloc_oob), KUNIT_CASE(vmap_tags),