Message ID | 20220718192844.1805158-6-yury.norov@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 2B9FDC43334 for <linux-mm@archiver.kernel.org>; Mon, 18 Jul 2022 19:28:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4E7D98E0002; Mon, 18 Jul 2022 15:28:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 44978940007; Mon, 18 Jul 2022 15:28:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2C2D08E0005; Mon, 18 Jul 2022 15:28:54 -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 EEFD08E0002 for <linux-mm@kvack.org>; Mon, 18 Jul 2022 15:28:53 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id C1B833317F for <linux-mm@kvack.org>; Mon, 18 Jul 2022 19:28:53 +0000 (UTC) X-FDA: 79701208146.18.90EDE03 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) by imf25.hostedemail.com (Postfix) with ESMTP id 3C4CEA0099 for <linux-mm@kvack.org>; Mon, 18 Jul 2022 19:28:53 +0000 (UTC) Received: by mail-qk1-f181.google.com with SMTP id b25so8800387qka.11 for <linux-mm@kvack.org>; Mon, 18 Jul 2022 12:28:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=fSIJ7a7j2AX31WFosI1tLZd0prS7r7q6CFeV8/OppVE=; b=VbkCt5PHj4oSczMa9BarPYV2CjxzDRvrtDRRMj4B07hzccBFOAfmYblYUUH9Ajgumv RKM4K28hzaiG92J/7vkuoCFu1rn9w8fhy0lWf6SIorEHqKyHwppnrzuULW+EmT6h7aZb iNnNyCpV5Al9CLDF5s+BHS+cuFK+7eXWgag89LdLI4R4kgeV2hbArCXUwMlgqtF2xWIm qfkeQzp0/+pXaxkZspiEkYN3yN4c8vfsqHzTwgjkQ3p2CVysWoVDuRXKrA2nXL5HlaIv LdBinorxw3H/YgC7eHfwweeumD20to6B5s4SYw9LVJdPLE0pFWEA8sn1G0OBVc/9tacU f7fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fSIJ7a7j2AX31WFosI1tLZd0prS7r7q6CFeV8/OppVE=; b=dehdzmu8GEgLqcQD4VfZGMO6IHMRJyjyvJU7zJNTVakXhfKRyHAFjbGxJORGn9XKNb C9//gdninqOftjpAJABRPvsKryZnrbw4T58bG+aUYNuPWHl09YK/6M9ZvHaZV3VW4zSA Ak34LmIIT0Ic3SwKE8qCApBEvFqEbRmuA3T3R2H74hOn4+Wje0/W12bZE0kpGouvEsbU HFjZKeKSWicTKio0cu/1Q0nkzrqoSLNix1eQlHAlqCiXtUKouN89a+AJOZ7mhIhVuE45 7RCW7akLpHMgA+vmRMLP8snbbmQhVlE1whTkJFbIxFP/KleFzXYoghxVwIlA7cWiep8s 48YQ== X-Gm-Message-State: AJIora9wF0Y+6OEW+9zDOm4QudpnF9qOZbBxdviJQf0yxGxcom76NbBa 3VtzUU1OcPxai/I8GZzooVQ= X-Google-Smtp-Source: AGRyM1vV0SLlM81qvktCdvHe8wlRlm35TgOxVMvgml/1hdumCxKzVqNhVheVD3VDTLe5gZR7GC4mqw== X-Received: by 2002:ae9:e402:0:b0:6a7:86a3:752e with SMTP id q2-20020ae9e402000000b006a786a3752emr18219422qkc.300.1658172532712; Mon, 18 Jul 2022 12:28:52 -0700 (PDT) Received: from localhost ([2601:4c1:c100:1230:ab01:d009:465a:5ab1]) by smtp.gmail.com with ESMTPSA id d19-20020a05620a241300b006a6d20386f6sm13557144qkn.42.2022.07.18.12.28.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 12:28:52 -0700 (PDT) From: Yury Norov <yury.norov@gmail.com> To: linux-kernel@vger.kernel.org, Alexander Lobakin <alexandr.lobakin@intel.com>, Alexei Starovoitov <ast@kernel.org>, Alexey Klimov <aklimov@redhat.com>, Andrew Morton <akpm@linux-foundation.org>, Andrii Nakryiko <andrii@kernel.org>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Ben Segall <bsegall@google.com>, Christoph Lameter <cl@linux.com>, Dan Williams <dan.j.williams@intel.com>, Daniel Borkmann <daniel@iogearbox.net>, Daniel Bristot de Oliveira <bristot@redhat.com>, Dennis Zhou <dennis@kernel.org>, Dietmar Eggemann <dietmar.eggemann@arm.com>, Eric Dumazet <edumazet@google.com>, Frederic Weisbecker <fweisbec@gmail.com>, Guenter Roeck <linux@roeck-us.net>, Ingo Molnar <mingo@redhat.com>, Isabella Basso <isabbasso@riseup.net>, John Fastabend <john.fastabend@gmail.com>, Josh Poimboeuf <jpoimboe@kernel.org>, Juergen Gross <jgross@suse.com>, Juri Lelli <juri.lelli@redhat.com>, KP Singh <kpsingh@kernel.org>, Kees Cook <keescook@chromium.org>, Martin KaFai Lau <kafai@fb.com>, Mel Gorman <mgorman@suse.de>, Miroslav Benes <mbenes@suse.cz>, Nathan Chancellor <nathan@kernel.org>, "Paul E . McKenney" <paulmck@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Randy Dunlap <rdunlap@infradead.org>, Rasmus Villemoes <linux@rasmusvillemoes.dk>, Sebastian Andrzej Siewior <bigeasy@linutronix.de>, Song Liu <songliubraving@fb.com>, Steven Rostedt <rostedt@goodmis.org>, Tejun Heo <tj@kernel.org>, Thomas Gleixner <tglx@linutronix.de>, Valentin Schneider <vschneid@redhat.com>, Vincent Guittot <vincent.guittot@linaro.org>, Vlastimil Babka <vbabka@suse.cz>, Yonghong Song <yhs@fb.com>, Yury Norov <yury.norov@gmail.com>, linux-mm@kvack.org, netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH 05/16] lib/test_bitmap: disable compile-time test if DEBUG_BITMAP() is enabled Date: Mon, 18 Jul 2022 12:28:33 -0700 Message-Id: <20220718192844.1805158-6-yury.norov@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220718192844.1805158-1-yury.norov@gmail.com> References: <20220718192844.1805158-1-yury.norov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658172533; a=rsa-sha256; cv=none; b=sFHJSc5d+jCsGDrFVUbXOQ7tYM9ugLgDCoTS+M7IztYUFj6h2xrlykLEIOw9P5HxtbijYs vggn5RSQyXxls62IUKJ/w1mLA942J2Y+I4YGX2y62sxckTmVMb0t1qnuHel92uPjWzTqP8 gqg3aYXu4qdJ8Sr0Qz9bM6QKOCWKgQA= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=VbkCt5PH; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf25.hostedemail.com: domain of yury.norov@gmail.com designates 209.85.222.181 as permitted sender) smtp.mailfrom=yury.norov@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658172533; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=fSIJ7a7j2AX31WFosI1tLZd0prS7r7q6CFeV8/OppVE=; b=yyioKTQRUcEaeNuZjZ3V3+2Ipj52i01BBU2rYl1op2xK5Kx6hyxBnIvW3yBix8GF0aqZOz uDu01U1fiXg3L2kgAb9pdNWcK/n/OOV1eCNCF9Im7vuLmwpvJCSEY8XAHbLpigWyCOkpG/ 9hOFZyNwrNtHJ86AdvncQCSJ+wxLhBc= X-Rspamd-Queue-Id: 3C4CEA0099 X-Rspam-User: Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=VbkCt5PH; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf25.hostedemail.com: domain of yury.norov@gmail.com designates 209.85.222.181 as permitted sender) smtp.mailfrom=yury.norov@gmail.com X-Rspamd-Server: rspam08 X-Stat-Signature: 7s3wgfti9p74ffaokhm1cdkse56yq9ui X-HE-Tag: 1658172533-815402 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: <linux-mm.kvack.org> |
Series |
Introduce DEBUG_BITMAP config option and bitmap_check_params()
|
expand
|
On Mon, Jul 18, 2022 at 12:28:33PM -0700, Yury Norov wrote: > CONFIG_DEBUG_BITMAP, when enabled, injects __bitmap_check_params() > into bitmap functions. It prevents compiler from compile-time > optimizations, which makes corresponding test fail. Does it stays the same for trace points?
diff --git a/lib/test_bitmap.c b/lib/test_bitmap.c index bc48d992d10d..8bd279a7633f 100644 --- a/lib/test_bitmap.c +++ b/lib/test_bitmap.c @@ -877,6 +877,7 @@ static void __init test_bitmap_print_buf(void) static void __init test_bitmap_const_eval(void) { +#ifndef CONFIG_DEBUG_BITMAP DECLARE_BITMAP(bitmap, BITS_PER_LONG); unsigned long initvar = BIT(2); unsigned long bitopvar = 0; @@ -934,6 +935,7 @@ static void __init test_bitmap_const_eval(void) /* ~BIT(25) */ BUILD_BUG_ON(!__builtin_constant_p(~var)); BUILD_BUG_ON(~var != ~BIT(25)); +#endif } static void __init selftest(void)
CONFIG_DEBUG_BITMAP, when enabled, injects __bitmap_check_params() into bitmap functions. It prevents compiler from compile-time optimizations, which makes corresponding test fail. Signed-off-by: Yury Norov <yury.norov@gmail.com> --- lib/test_bitmap.c | 2 ++ 1 file changed, 2 insertions(+)