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 X-Spam-Level: X-Spam-Status: No, score=-8.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BCDFC49EA2 for ; Fri, 18 Jun 2021 00:12:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DCDAF613B9 for ; Fri, 18 Jun 2021 00:12:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DCDAF613B9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 78A716B0070; Thu, 17 Jun 2021 20:12:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 73AF86B0071; Thu, 17 Jun 2021 20:12:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 602426B0072; Thu, 17 Jun 2021 20:12:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0062.hostedemail.com [216.40.44.62]) by kanga.kvack.org (Postfix) with ESMTP id 2DA3C6B0070 for ; Thu, 17 Jun 2021 20:12:18 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id C257F2494 for ; Fri, 18 Jun 2021 00:12:17 +0000 (UTC) X-FDA: 78264917514.25.571F7CA Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf24.hostedemail.com (Postfix) with ESMTP id 775EFA000245 for ; Fri, 18 Jun 2021 00:12:17 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 2AD2F610CA; Fri, 18 Jun 2021 00:12:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623975136; bh=NIkBnZc2GHohfpXgF10FM3cZz9pBdstBWE9sKMqAMu8=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=oSpSYvWFKgBFEmjj8o4qaE7vn+cDY9bhzewS9dKRZoiijkKB/+Yqur25dKFc91Vis ZIPJrkANH3XOikALMkUnqGw2NMPt+2syBcTxRTm5Ev0FPDGtcWXmgcUpH0vvkHEkHG eUQLxuoMVV4FDkRNZtCVHL97C/k/qdnN3cp8bPWJY+iKrsdKwIYHjOzT4a9IqX+lyj i1+y1Xo6wBY0AAm1bUVFS8enJ0mzJMsXotkTh2iJ+ORWNNUbZnA4HZP4xG4dZqoay8 o8Bg5Bxd9kWW/TTPnGN7ihP827CtnDc1xghkjSy+TcwjGKxWA/F7/Q+8IdiRR0jt77 rJUiaJF3kPs9g== Subject: Re: [PATCH 8/8] membarrier: Rewrite sync_core_before_usermode() and improve documentation To: Mathieu Desnoyers Cc: x86 , Dave Hansen , linux-kernel , linux-mm , Andrew Morton , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , linuxppc-dev , Nicholas Piggin , Catalin Marinas , Will Deacon , linux-arm-kernel , Peter Zijlstra , stable References: <07a8b963002cb955b7516e61bad19514a3acaa82.1623813516.git.luto@kernel.org> <827549827.10547.1623941277868.JavaMail.zimbra@efficios.com> From: Andy Lutomirski Message-ID: <26196903-4aee-33c4-bed8-8bf8c7b46793@kernel.org> Date: Thu, 17 Jun 2021 17:12:15 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <827549827.10547.1623941277868.JavaMail.zimbra@efficios.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=oSpSYvWF; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf24.hostedemail.com: domain of luto@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=luto@kernel.org X-Stat-Signature: 9h9uiwfsepwg5cdkqq4hjyk1gj387kxo X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 775EFA000245 X-HE-Tag: 1623975137-570018 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 6/17/21 7:47 AM, Mathieu Desnoyers wrote: > Please change back this #ifndef / #else / #endif within function for > > if (!IS_ENABLED(CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE)) { > ... > } else { > ... > } > > I don't think mixing up preprocessor and code logic makes it more readable. I agree, but I don't know how to make the result work well. membarrier_sync_core_before_usermode() isn't defined in the !IS_ENABLED case, so either I need to fake up a definition or use #ifdef. If I faked up a definition, I would want to assert, at build time, that it isn't called. I don't think we can do: static void membarrier_sync_core_before_usermode() { BUILD_BUG_IF_REACHABLE(); }