Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp202906ybs; Tue, 26 May 2020 07:13:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEVhXRyaj+yvuKG3kdHoImVJHrkLJpvel471oTMn15exrV/JWNupMBQzPChBpY8qZHfy4t X-Received: by 2002:a17:906:5f98:: with SMTP id a24mr1368077eju.214.1590502403425; Tue, 26 May 2020 07:13:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590502403; cv=none; d=google.com; s=arc-20160816; b=QwYdUuchk73HbYZCadjCPokxjxaa1ePjgl3tvPyzfH7o2WB+KTnpj70FacqUEnce/2 ahIpVxbwMKtl3EB0It6VZPEq25zLhpLlyCpHWKiLYNg5rm9rMzW2Q4Z0/pFntIepk6e+ NnTOqEH3mPn3tiFxtIhHECYEUMDrdifILdREfGz3VNG+xBkavAQABYET+qMoB1r3Do8P aRhTL0Xx1Gx2u+Ulxle6y/SUfqmsH2hoAbAr8UVWIpNd92sgLA9JESrQp3uzX0wB8D/e xjGjMNF58aukLLkgR2Rg+YytJXgQnSFj3CqIMhv+v+XhQpqbLxhyIQmSs76tPYH2ZI9o 4tFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=ACimDYYDlr70cMGpImzoHikpOl3de3cJ1aRwknZ8uQA=; b=qx7lqdOu0DJxEgRcnY6imAQl0EsU5B77ekOcge5LZ7gk+rD37GrKpu8TjI7M75el2i 9EcHQnwVWnsoeMVET8P1L+1PHIoI/uy4Pftsninmjerrx+yAnDM1tsPIBARNhte0wN0U HdXVxWv5feI6XWFbSu1TTKCc2HGT+NDB1hNFbBEMfwYtd1X8ziAO/UlY/RnDCk9VJB4a cL1Zh5QcIDUvmjG5hd8yMeU/yPdtKnOxB59yVy1ZdxVTvwE6aBoQ12k+cnXE7e/8Nje6 4Hb+PLY+nsvFGccTsipk4qT3l0YWRIakD7eg54WV40PBiuMvp5BhYvdgJHtF+9VFveB9 vSXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d15si1211405ejb.4.2020.05.26.07.12.59; Tue, 26 May 2020 07:13:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388355AbgEZKmg (ORCPT + 99 others); Tue, 26 May 2020 06:42:36 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:37851 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731890AbgEZKmg (ORCPT ); Tue, 26 May 2020 06:42:36 -0400 Received: from mail-qk1-f174.google.com ([209.85.222.174]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.145]) with ESMTPSA (Nemesis) id 1MI5YH-1jqPLa2G4F-00FFWC for ; Tue, 26 May 2020 12:42:33 +0200 Received: by mail-qk1-f174.google.com with SMTP id c12so1109009qkk.13 for ; Tue, 26 May 2020 03:42:33 -0700 (PDT) X-Gm-Message-State: AOAM530BcTPcJK4EZHiEH4xXJb3tLEanAiVqs4t2UClNnau21RE4l4XO 8C+kIbp50GK1cGRPrTNrRDTz/DN/8vSN5XXruB8= X-Received: by 2002:ae9:ed95:: with SMTP id c143mr562891qkg.394.1590489752379; Tue, 26 May 2020 03:42:32 -0700 (PDT) MIME-Version: 1.0 References: <20200521142047.169334-1-elver@google.com> <20200521142047.169334-10-elver@google.com> In-Reply-To: From: Arnd Bergmann Date: Tue, 26 May 2020 12:42:16 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH -tip v3 09/11] data_race: Avoid nested statement expression To: Nick Desaulniers Cc: Marco Elver , "Paul E. McKenney" , Dmitry Vyukov , Alexander Potapenko , Andrey Konovalov , kasan-dev , LKML , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Will Deacon , clang-built-linux , Borislav Petkov Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:qvSyjSUpK1f5XtbiEZvYVXI1Fvify93tSqpIAlVVR0TfwL0CZtD UBAn0GeLMPUV5uDB1fKvvzI0lokTvOP7SsCNhF27epbX2iMa/Yg5COVRA5gkdYO1X3i8kuI Lm2nHmg85G3zUvfg4pPNPENmMEbu2JLRhEadKI5WfrBM11OnFiXG6HkQhOrjVMIapAqQ8OQ XznKLxgHaCnGiXVejldHw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:FeDxH0tE3jk=:Stkw2TzVjATt2TWoUlijoD rOGSV0ETBMBr3g+Kokb7DHMLlMPzo7+3vgBZ/An+D+lvseSYmv9fN3yRlBO1PhzrCZRCJTw5K sigKiSJPo0qc6pJUAdiajFF3xWPV6Zp68dw3qZcN+DHfwq/vfNvPep13DJzk8D+zAuynqPqGS QUdYratgQMWJg7dhmz42CFVUisPGABVCDhN6TDreDX63ZUx0RIdwOfWf+mjTDDK/ZuRmX/DjL YbXyN1u68F60VzXv1AIQqQyYFrxHX8LrSHIzOXX83ZbloedLNTUCorANEKVDp2QYoaNBrYZPP moyFa44nHTT3+hptHqMUAyyy9+fgcapqXB49jqdADcngsLl2/R/6lt7TWLd/ydV8NZUQT4VRB yWgchqnPQj2da3neTGDm5el45TLSpxoLD03WYz4Yu2SDO1QPWKjePEuLQHJzgrfGmuiqJ36/x rDHqPEaybNCT/KdLuctVbsHJYP9pnd9RA2ixTwdl6U65OpM/QeCZJ7voVhR5KVyC6X2WiG9wk 9/K1nfaPmFPvVWEydsT1b7f9e2JgcBBsAwr+R4t3KSD/GJszoS+Wmd4/3w+dvE8QrRFPWAjy8 j5Feg7TsUxxfPtLQG+Ow+UJXMI93wNPcaVPt+2qxBZrsQKe6JCUoCP3WQEl8300b9RkSoUonS tocOjNd9OtLByAqCGgKBt41e1nwgdmtB9Lxl+bysFEnFb/Mv/yduxm/fweAQzZO13eNA3TFy+ SMvGGVZKR48EY3CoEGFxXRWvw4y6pbY+1HnOisukGPf8V9hnPBOV3XlwatUh9ZLk5j5VlvH6q xYsd49q57qvCAfGf0u6pvL3+XCGf3KZMxe7OTMCNUfz3IlAraM= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 21, 2020 at 10:21 PM 'Nick Desaulniers' via Clang Built Linux wrote: > > On Thu, May 21, 2020 at 7:22 AM 'Marco Elver' via Clang Built Linux > wrote: > > > > It appears that compilers have trouble with nested statement > > expressions. Therefore remove one level of statement expression nesting > > from the data_race() macro. This will help us avoid potential problems > > in future as its usage increases. > > > > Link: https://lkml.kernel.org/r/20200520221712.GA21166@zn.tnic > > Acked-by: Will Deacon > > Signed-off-by: Marco Elver > > Thanks Marco, I can confirm this series fixes the significant build > time regressions. > > Tested-by: Nick Desaulniers > > More measurements in: https://github.com/ClangBuiltLinux/linux/issues/1032 > > Might want: > Reported-by: Borislav Petkov > Reported-by: Nathan Chancellor > too. I find this patch only solves half the problem: it's much faster than without the patch, but still much slower than the current mainline version. As far as I'm concerned, I think the build speed regression compared to mainline is not yet acceptable, and we should try harder. I have not looked too deeply at it yet, but this is what I found from looking at a file in a randconfig build: Configuration: see https://pastebin.com/raw/R9erCwNj == Current linux-next == with "data_race: Avoid nested statement expression" and "compiler.h: Remove data_race() and unnecessary checks from {READ,WRITE}_ONCE()" $ touch fs/ocfs2/journal.c ; cp ../arch/x86/configs/0xFFA843AA_defconfig obj-x86/.config ; perf stat make olddefconfig O=obj-x86/ CC=clang-11 fs/ocfs2/journal.i ARCH=x86 -skj30 ; wc obj-x86/fs/ocfs2/journal.i 48741 552950 9010050 obj-x86/fs/ocfs2/journal.i real 0m12.514s user 0m10.270s sys 0m2.668s == Same tree, without those two == $ touch fs/ocfs2/journal.c cp ../arch/x86/configs/0xFFA843AA_defconfig obj-x86/.config ; time make olddefconfig O=obj-x86/ CC=clang-11 fs/ocfs2/journal.i ARCH=x86 -skj30 ; wc obj-x86/fs/ocfs2/journal.i real 1m35.968s user 1m33.579s sys 0m3.523s 48741 1926607 36542560 obj-x86/fs/ocfs2/journal.i == Mainline Linux == $ touch fs/ocfs2/journal.c ; cp ../arch/x86/configs/0xFFA843AA_defconfig obj-x86/.config ; time make olddefconfig O=obj-x86/ CC=clang-11 fs/ocfs2/journal.i ARCH=x86 -skj30 ; wc obj-x86/fs/ocfs2/journal.i real 0m6.529s user 0m4.389s sys 0m2.561s 47377 377887 4178633 obj-x86/fs/ocfs2/journal.i So both the size of the preprocessed file and the time to preprocess it are still twice as bad for linux-next compared to mainline. Actually compiling the preprocessed filed is very quick, as I guess only the preprocessing seems to use all the time. Arnd