From mboxrd@z Thu Jan 1 00:00:00 1970 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 3608AC43334 for ; Thu, 9 Jun 2022 12:29:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 929318D000D; Thu, 9 Jun 2022 08:29:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8D87D8D0006; Thu, 9 Jun 2022 08:29:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 779998D000D; Thu, 9 Jun 2022 08:29:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 666EB8D0006 for ; Thu, 9 Jun 2022 08:29:56 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 3D55480F01 for ; Thu, 9 Jun 2022 12:29:56 +0000 (UTC) X-FDA: 79558629192.01.7A82F58 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf17.hostedemail.com (Postfix) with ESMTP id 8BA0A4006F for ; Thu, 9 Jun 2022 12:29:54 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E64DDB82D31 for ; Thu, 9 Jun 2022 12:29:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74652C34114 for ; Thu, 9 Jun 2022 12:29:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1654777790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+ZKCPkatmZQhMUqvjXsixnwwHTDth2O7Ki+YyHfUIdw=; b=BTa3ImG/q/FDhj2K9CGLypM1xgoxQSph866PKzoVsxVcHgCCqeaOcfLpa/KLeVFVYXgGTT fCWU9e6qcnH3QL+wsskpht5KQcX3b1MohkN+EypJS9z2QwT5toUmaZq+faUyVKTXH19NI4 p2l4s8st1KOoWPWo6bioytmRT3bQdN0= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 89ef0d96 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Thu, 9 Jun 2022 12:29:49 +0000 (UTC) Received: by mail-yw1-f181.google.com with SMTP id 00721157ae682-3137316bb69so44476727b3.10 for ; Thu, 09 Jun 2022 05:29:49 -0700 (PDT) X-Gm-Message-State: AOAM532CmGzXWNGXi7JCxDDe74PkAZFVgfWhOUlSgv6Xaw5qOXr+jHGT GpAKfLOqz7stYiRkWoLu+UYZ4GmvxLF13NPA9kQ= X-Google-Smtp-Source: ABdhPJyb0QIJ7TWICAPZCiS2OJY6lap9/tFDuzmweUf578cIz3SS7SYKHoZT+c4EehPz7vXw/aTl77QcI36HThOsARg= X-Received: by 2002:a0d:ef03:0:b0:2fa:245:adf3 with SMTP id y3-20020a0def03000000b002fa0245adf3mr44088700ywe.100.1654777788720; Thu, 09 Jun 2022 05:29:48 -0700 (PDT) MIME-Version: 1.0 References: <20220609121709.12939-1-Jason@zx2c4.com> In-Reply-To: From: "Jason A. Donenfeld" Date: Thu, 9 Jun 2022 14:29:37 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mm/kfence: select random number before taking raw lock To: Marco Elver Cc: Linux-MM , LKML , John Ogness , Alexander Potapenko , Dmitry Vyukov , Geert Uytterhoeven Content-Type: text/plain; charset="UTF-8" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1654777794; a=rsa-sha256; cv=none; b=tZfWneLx8J5KIlXovpuCmL1V/YE/WOTSv3I0Y0bfedo4ZkOPpvBMGFenLFqBucCAY2t7C9 Sp4W1hvD7WUoQBgy/fE8bH3ae1qfdmlbcXGCeCYzs2ZbWbu0Jz6jkGlqKJjaQ1JyyaqlFH iAbVBZov1rxl5lcaZ7QFab8Zc2WtHwM= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=zx2c4.com header.s=20210105 header.b="BTa3ImG/"; spf=pass (imf17.hostedemail.com: domain of "SRS0=TG91=WQ=zx2c4.com=Jason@kernel.org" designates 145.40.68.75 as permitted sender) smtp.mailfrom="SRS0=TG91=WQ=zx2c4.com=Jason@kernel.org"; dmarc=pass (policy=none) header.from=zx2c4.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1654777794; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=+ZKCPkatmZQhMUqvjXsixnwwHTDth2O7Ki+YyHfUIdw=; b=pHs9o4lcNLmrcIfSQ0lP3KksGAuOmobqQdX5ZtPyoTwBrpKiAZz0g0hWq9VWaj8xX9tzLs WY4xFb9rZeRkZXawYcztkU02NvuPWh/qMQkoN41UL9tQr5MhyMRrpebQ6d+Z0c0J629jhD sH95Q+K3LVUZsS9dG08BzgEmJ6v1SK8= X-Rspamd-Queue-Id: 8BA0A4006F Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=zx2c4.com header.s=20210105 header.b="BTa3ImG/"; spf=pass (imf17.hostedemail.com: domain of "SRS0=TG91=WQ=zx2c4.com=Jason@kernel.org" designates 145.40.68.75 as permitted sender) smtp.mailfrom="SRS0=TG91=WQ=zx2c4.com=Jason@kernel.org"; dmarc=pass (policy=none) header.from=zx2c4.com X-Rspam-User: X-Rspamd-Server: rspam06 X-Stat-Signature: 1wkosrm7fioesckowib663ce58tokd18 X-HE-Tag: 1654777794-627584 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: On Thu, Jun 9, 2022 at 2:27 PM Marco Elver wrote: > The compiler should elide this branch entirely if > CONFIG_KFENCE_STRESS_TEST_FAULTS=0, but not sure it'll always do so > now. My suggestion is to make both new bools consts, to help out the > compiler a little. > > Otherwise looks good, thanks for the quick fix! Disassembling reveals it still does elide. (gcc 11.3) But I'll make them const just in case and send a v2. Jason