Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5362635rwb; Tue, 17 Jan 2023 12:41:06 -0800 (PST) X-Google-Smtp-Source: AMrXdXsLTzmg+2WEaOqPzhMg0oXgkmq9aBaLMviqvbLuUx6VUk32gMkiJF5OdIGjnR0ybmYTz/B+ X-Received: by 2002:a17:906:684e:b0:84d:3794:5748 with SMTP id a14-20020a170906684e00b0084d37945748mr3643937ejs.9.1673988065807; Tue, 17 Jan 2023 12:41:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673988065; cv=none; d=google.com; s=arc-20160816; b=bJR4AiC6t8f5Vt+r85gfCSsVNwbYMVidVs5VLyNSKKrzGk/tGNUDRrzIWWsJK9JUg7 6P4RxreqC4sIDNbWcw1AvOBUZpe+O8LCMmtqsEW4gTaasbV7acz/iT0M4qRzxgqs5R7p ALhbCYiN1yS4towIbJ0GeHduqzyoyf8ci51Tb1D9GTvbJG5+zYS82T5T57dQlirLuwzy 4HwVwc0jU+X9Vn0FSFUvKJPQVvrUI/F57QlEXFFbekAoi+6X2+hlACbTQX3vQ95qOviZ yPQcusohWDXtCITbB2jqoKZDbuUDVMTx6wvhMSEwQ7H6JeW2kM8Yj3IFlvwe7S5Cz15q aQoA== 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=+Mu9koWxZO+GAicl5/zS5kt22OU1K36mNzIi6VF5ODg=; b=B7MSvhYjvygfgD3lvrlrOugcoZdnDTxqwkzRMEkLyYYtPlwNvzNO16pbmgfEHHxP8Z mfjx9lkQ1+A9GKgcjxTxXz+9/eI3c30jAMSfAdiS4f2al3j7RuyxsZ9fkGZgxyFgJ9xy RRWgfrTWizNQpYcuRONJAxr7YhEC8Xrro19Jt+V3FglVPgvjVCXNH1dqB6NwDpW6eGoy rJSbemBbsIE4uBYVL8J38O9vbN0WxKKEVXR0c0w596+dEkalhhtkvX9n3dPfIgrK/Tpn ayyzSN2oZUM/mXB6td/VltNuOjoCwvHuIy9usybofkvgLPDOLaOa58pKXUtzJajy3vap bSyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Mq6oH5qK; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw42-20020a1709066a2a00b007ad943d0608si11002578ejc.630.2023.01.17.12.40.53; Tue, 17 Jan 2023 12:41:05 -0800 (PST) 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=@google.com header.s=20210112 header.b=Mq6oH5qK; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235275AbjAQTVh (ORCPT + 47 others); Tue, 17 Jan 2023 14:21:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231266AbjAQTMc (ORCPT ); Tue, 17 Jan 2023 14:12:32 -0500 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA43137B4A for ; Tue, 17 Jan 2023 10:26:34 -0800 (PST) Received: by mail-pj1-x1034.google.com with SMTP id x2-20020a17090a46c200b002295ca9855aso7111902pjg.2 for ; Tue, 17 Jan 2023 10:26:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+Mu9koWxZO+GAicl5/zS5kt22OU1K36mNzIi6VF5ODg=; b=Mq6oH5qKA0GiWeJKgDxS3jtZ54iKpVzxllLLtClfwonnVI3fy2+MSy6gdiEg2ybH4d YI0bAD7AvA5UEWkaMXE4411ssRNhQkOhgXfcR2Rw/UCdZU++9Qem8/gmytQ9peDSb1OL v3QUh9MAoM0fZZPpItddCM3cYixpIokrCLznzbXMeyWGB+YRHIf6uyj++pUwTLBYo7dn yzLg6DACo1QzFEzV/0jo7aNC1Ck5BUOJ25jB5Eo4/W6Yit08/MZUJvl23JqTH+yq6Sl1 ptKdz147F9MraZ/7qPiae3JFTdJcm3naETmXOzH2DB+YRPHYNjWo+c5w8pcVEsdv8LcP QAXQ== 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:subject:date:message-id :reply-to; bh=+Mu9koWxZO+GAicl5/zS5kt22OU1K36mNzIi6VF5ODg=; b=xKE9pnBIadwIekPR3mYSAT1tPr/lIXi116trPPAAQDHtXUr/bFOopgJc3XaWX7ebg2 A0OZptjTP237cVqXWo3Ai/ZKUXdYf8ccZ/TnwiHPBPJatTQaPT2MwiY1D2uPHjUSWOsO USoLx5QPBR17GXruX4GFfzf5GPoLJybkT0VssgZ5y1E/tNWq9InYgb469+xvGmOv0J9v rXGpODgndHiiIDejTiXs9cHIpl7fM0vNfb7row6loN0NUBYPrg/HW9egNYGd5CwjffN4 BZWAHAzqrEPUl+7SmIJz5ssTNm3zHQy0lFvLmv8y5UNN9nP+rVMhxy+LgKByPYjBq+J6 0vwg== X-Gm-Message-State: AFqh2koTE6d9K7LzbBAXNXLnpiJerGZp0PUcR+tqvExGIRtPLiZBjcuX nKq7bos0jcpfdT21Gg51+woYPDBrRgdH2BTaH+GOZQ== X-Received: by 2002:a17:90a:ad92:b0:229:41a0:c5de with SMTP id s18-20020a17090aad9200b0022941a0c5demr351566pjq.107.1673979993589; Tue, 17 Jan 2023 10:26:33 -0800 (PST) MIME-Version: 1.0 References: <20230111123736.20025-1-kirill.shutemov@linux.intel.com> <20230111123736.20025-9-kirill.shutemov@linux.intel.com> <20230117135703.voaumisreld7crfb@box> In-Reply-To: From: Nick Desaulniers Date: Tue, 17 Jan 2023 10:26:22 -0800 Message-ID: Subject: Re: [PATCHv14 08/17] x86/mm: Reduce untagged_addr() overhead until the first LAM user To: Linus Torvalds Cc: Peter Zijlstra , "Kirill A. Shutemov" , Dave Hansen , Andy Lutomirski , x86@kernel.org, Kostya Serebryany , Andrey Ryabinin , Andrey Konovalov , Alexander Potapenko , Taras Madan , Dmitry Vyukov , "H . J . Lu" , Andi Kleen , Rick Edgecombe , Bharata B Rao , Jacob Pan , Ashok Raj , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Sami Tolvanen , joao@overdrivepizza.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham 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 Tue, Jan 17, 2023 at 9:29 AM Linus Torvalds wrote: > > On Tue, Jan 17, 2023 at 9:18 AM Linus Torvalds > wrote: > > > > The reason clang seems to generate saner code is that clang seems to > > largely ignore the whole "__builtin_expect()", at least not to the > > point where it tries to make the unlikely case be out-of-line. > > Side note: that's not something new or unusual. It's been the case > since I started testing clang - we have several code-paths where we > use "unlikely()" to try to get very unlikely cases to be out-of-line, > and clang just mostly ignores it, or treats it as a very weak hint. I > think the only way to get clang to treat it as a *strong* hint is to > use PGO. I'd be surprised if that were intentional or by design. Do you guys have a bug report we could look at? > So clang ignoring the likely() hint is probably the right thing here, > and then the wrong thing in some other places. -- Thanks, ~Nick Desaulniers