Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1839262rwb; Sun, 14 Aug 2022 13:53:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR4LSMHvbKq4pygit/wUsEtOIY75uoNykiSsQl06oUijbMDmyqAiZyD3lv4+IbxfxtZNAb3J X-Received: by 2002:a63:8b4c:0:b0:422:9cef:9573 with SMTP id j73-20020a638b4c000000b004229cef9573mr8937388pge.21.1660510387018; Sun, 14 Aug 2022 13:53:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660510387; cv=none; d=google.com; s=arc-20160816; b=AY8h2PhFb9qQdyrSvGAa0+oV4dlAyCtCMosmughIri0nilVhj5iHcaFdF2LwFRyA6t HvZhkWImgRaSarsrw3PFnZiv8+nDdAHHdqm+HxyboxqizFYgjc3tnS3ZFDec1zVdvAi8 MLBdZkB7q96ZOnxeT9A8ynEhA/7MvzVf+01ey3kAo9NW7D4a/mSDygL5SSbUTqa5T6jA 7h8fRg1zhgDYKkRgyzggkRstTpQGUfWuklK2IW8HCfaTKLcaKbV+zDjyZ3dPEVYaSEBZ 4oJZM9wtacB837Y1HG21mgxsbbt4vh0GKPK1h63j0/eahXvHVKQRpKHlfJFbkQ23y/VY ENGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=xfOGomlI+wNDkGCVf2j5gRZIqtfFV7kG9Gxf0h/VnxU=; b=sBYAgcq6EJEL7X79ZHbBesSIB0UZ6JuiFtzelPNnkUxllFFSlKtFbCytNmWX8JlaPG NkvPcGchfrkWVBl/cNiXTlluVE25s2zrTN/z2PpRxnwkHW4eVuWNQ7FCUJCErzaftumJ gWEe9GgC0m8+st7M0vkqXNxFzYsvai4wnA5mXiAunOdjpfdxMTkMkOk/qk+YNblqiUMh e/Yf0JsdUa6W8I1cTcC/ACeKUb0skB52qkO6cunaL21Ym2K9s92dfGo75HqYfT5eaxgc 5Z8YNwq7CqL9clySeZ0MSxSHUldvYisaZegrUZWasJJnTGn1EckAVGOrnpgVL/I5ZtHm 8lrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=D1Y6bxPB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ob16-20020a17090b391000b001f4fd88724csi10124369pjb.5.2022.08.14.13.52.55; Sun, 14 Aug 2022 13:53:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=D1Y6bxPB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231949AbiHNU3v (ORCPT + 99 others); Sun, 14 Aug 2022 16:29:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231892AbiHNU3u (ORCPT ); Sun, 14 Aug 2022 16:29:50 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 782391EED7 for ; Sun, 14 Aug 2022 13:29:48 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id k26so10540164ejx.5 for ; Sun, 14 Aug 2022 13:29:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=xfOGomlI+wNDkGCVf2j5gRZIqtfFV7kG9Gxf0h/VnxU=; b=D1Y6bxPBDIzqq1QHg8NrNOVPs/qLN7TnjpcqjIhu/3KiooSJamYyL11iJeBHUGuw4Z /zCFkyohXYQGDTrDFRt92yXE7xHfQMB2U2yeRZ5Y1qo3oqC+NdAsr9axuEid3/m+fXAW 3BVEy3YoQhiAJCUpa+1DpLtLqINhPLQMU9Pug= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=xfOGomlI+wNDkGCVf2j5gRZIqtfFV7kG9Gxf0h/VnxU=; b=m6XpagPkmlw2xyk930ZN6em5feubDT/ZJpEqMjjvORudQr6we0lQbk15I6xZe18rku oDt4zg6k9jgOV9AwRrR8Tkr30hIebI6ENbhokDU8Ht93hzRiLAPrUzr741UXwCytoUjV Vw3uWhE2uxRnmWUZYUPNA5OOrL41DQkkoa3ovklhOkEhE+i1i0Kw8Fz75NQWRC9GQJxL PCfKLR+MkJHS2k1BHdZvDUBX2p/lal4bDDE0ZYJaf7IrsSpvrask4CM0yV5OVQJhLZtL fx7tJe16TdQCnA/0Z9sAMDXE1Yp6aKMxUznFlI2Q9DbUpJRc0mT39YRLujfiqjV+6QHD kvBg== X-Gm-Message-State: ACgBeo24NHt7XKBMzbzVsUgEN36hSG382pbU1PzW4QD9cwIS3EdKbiBu 1H55vcwMbZh89cG2MLpOPO7rfpKdCE53Qvui X-Received: by 2002:a17:907:2c68:b0:730:9272:8c7f with SMTP id ib8-20020a1709072c6800b0073092728c7fmr8714460ejc.528.1660508986813; Sun, 14 Aug 2022 13:29:46 -0700 (PDT) Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com. [209.85.128.48]) by smtp.gmail.com with ESMTPSA id u9-20020a1709060ec900b0072ed9efc9dfsm3322188eji.48.2022.08.14.13.29.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 14 Aug 2022 13:29:45 -0700 (PDT) Received: by mail-wm1-f48.google.com with SMTP id p12-20020a7bcc8c000000b003a5360f218fso6963298wma.3 for ; Sun, 14 Aug 2022 13:29:45 -0700 (PDT) X-Received: by 2002:a05:600c:4ed0:b0:3a3:3ef3:c8d1 with SMTP id g16-20020a05600c4ed000b003a33ef3c8d1mr14508149wmq.154.1660508985000; Sun, 14 Aug 2022 13:29:45 -0700 (PDT) MIME-Version: 1.0 References: <5d0b0367a5e28ec5b1f3b995c7792ff9a5cbcbd4.camel@kernel.org> <72a93a2c8910c3615bba7c093c66c18b1a6a2696.camel@kernel.org> In-Reply-To: From: Linus Torvalds Date: Sun, 14 Aug 2022 13:29:28 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [GIT PULL] Ceph updates for 5.20-rc1 To: Al Viro Cc: Nathan Chancellor , Nick Desaulniers , Jeff Layton , Ilya Dryomov , ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Matthew Wilcox , clang-built-linux Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 14, 2022 at 1:03 PM Linus Torvalds wrote: > > Gcc does well regardless, and clang ends up really wanting to move so > much out of the dentry_cmp() loop that it runs out of registers and > always ends up doing a couple of spills. > > I think it reduced the spills by one, but not enough to generate the > nice non-frame code that gcc does. Note that that code was basically written to make gcc happy, so the fact that clang then does worse is not hugely surprising. I dug into it some more, and it is really "load_unaligned_zeropad()" that makes clang really uncomfortable. The problem ends up being that clang sees that it's inside that inner loop, and tries very hard to optimize the shift-and-mask that happens if the exception happens. The fact that the exception *never* happens unless DEBUG_PAGEALLOC is enabled - and very very seldom even then - is not something we can really explain to clang. So it thinks that code is really hot in the inner loop, and does all kinds of silly things due to that. Gcc, in contrast, generates the obvious straightforward code, and that's what I wrote and optimized that code for. Linus