Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1638520pxp; Thu, 17 Mar 2022 13:19:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy37UIgSi8VZ3wk7L7yIhhXvy3XGLnC2dkrhdD3YAqrEGwx996wACjRWxY1vqS9ruoFUiGd X-Received: by 2002:a17:903:11c7:b0:151:9769:3505 with SMTP id q7-20020a17090311c700b0015197693505mr6683491plh.72.1647548341515; Thu, 17 Mar 2022 13:19:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647548341; cv=none; d=google.com; s=arc-20160816; b=QtG+xnTGpH+NZkOcdmhNBOZbrtkCJNHdySQPCdsAnNn8WVADXQa+Fvot1gyr8vc502 AADKMEWBevltVj++1ytf0gI7gineZ/H8GuUJDsakF9HYVo4mhs46QN+EnICpd2djJHAJ I5jkVthfW9cLRaWYvNFC09fJWBD1eOvw7lNuPVsM/z8N3ZYtWV+uu2M1gETimp6+XXkk kYzOVTsGbzikdod9q2V4ZpTaFSJiitu+kBaq8NobnpVVnOZXDjf7DgUAJJ7VhhIMwT3p f0pwYN+o8h7V8OgGEVitW1A09DeDSokgr65Sz/ApqiCrcLGV4HuZIwuKUafCZi2TZjhV Zojg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=/9bxIg1qOp3zLI4jFQ/JI5uNUyvRHc0GfLBohoapK+0=; b=VE5A2YPiAYWH6ZjyGxSoAOTQS8L/23nIqPoT1inPCit0Oj+I7fmN8FX5SxZw5xgr4v uk7aNR6wDe7ltxH24BOQg6ZVknmSpRrT2OPd3j9fgEKJEv8HzQg5jYuMUrGpaGeQV5To WX1ET8P19ypAZgQLkfPGzjZhqYRHToJ5uf4hexkMXMiYf2KiAe69LrxIuS8X5aBufKUz 2FKqvc5QRNSVJK4ZynlsEHmD5i/EZYavzFgI5s+3suOzoITtx+Yq5FcMRoRYcTI3atN9 q2jgQslSMWzbKWG10ap0aJ760MHX4xBitjrULwQRIA2UHRd63Bdo/23AMGAkxPMWmUCh yfWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GUmy1ma1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i2-20020a17090332c200b00153b2d16489si61695plr.145.2022.03.17.13.19.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 13:19:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GUmy1ma1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E279715CB74; Thu, 17 Mar 2022 13:00:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237879AbiCQTMj (ORCPT + 99 others); Thu, 17 Mar 2022 15:12:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237878AbiCQTMe (ORCPT ); Thu, 17 Mar 2022 15:12:34 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 401AF208C23 for ; Thu, 17 Mar 2022 12:11:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647544277; x=1679080277; h=message-id:date:mime-version:to:cc:references:from: subject:in-reply-to:content-transfer-encoding; bh=QtbZsZYj0hr0+LT60TV+H4KtAWp3GNm9B4MX5TPGWQk=; b=GUmy1ma1DosoGBcQ2Hy4tPidmyGAzHsqv8FsAP0CJPjwWUDOjfs3xHJk IlJVcZOA4igLz9A6eNPG8BLcq5TTSAmQrJaxCgXcvxmdkklBwpf91CHhs NYJxQOy/1+JbslfKE86ufTTgNwAosSe5ZEBiYTsCjH1bqWjO4rTQ2u14n w9dUZUSSNf7G7hjdSJvIlMLf9CzBhkCckPzpmWB0dw1coj18+IYrF53N7 v5cr31n15CUtl++bNhSMBT89rdFCAHEeaPnmWEKAii/RRBlBPwmZDU0l3 /EJ7ETOxJVXvfOy3Z1WcQCD34qawwUpsNxc6vp3qmd21RT5Fec0wfU3fe Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10289"; a="237574612" X-IronPort-AV: E=Sophos;i="5.90,188,1643702400"; d="scan'208";a="237574612" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2022 12:11:16 -0700 X-IronPort-AV: E=Sophos;i="5.90,188,1643702400"; d="scan'208";a="581411403" Received: from dstanfie-mobl2.amr.corp.intel.com (HELO [10.212.178.19]) ([10.212.178.19]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2022 12:11:16 -0700 Message-ID: <96f9b880-876f-bf4d-8eb0-9ae8bbc8df6d@intel.com> Date: Thu, 17 Mar 2022 12:11:08 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: Nadav Amit Cc: kernel test robot , Ingo Molnar , Dave Hansen , LKML , "lkp@lists.01.org" , "lkp@intel.com" , "ying.huang@intel.com" , "feng.tang@intel.com" , "zhengjun.xing@linux.intel.com" , "fengwei.yin@intel.com" References: <20220317090415.GE735@xsang-OptiPlex-9020> <3B958B13-75F0-4B81-B8CF-99CD140436EB@vmware.com> From: Dave Hansen Subject: Re: [x86/mm/tlb] 6035152d8e: will-it-scale.per_thread_ops -13.2% regression In-Reply-To: <3B958B13-75F0-4B81-B8CF-99CD140436EB@vmware.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 3/17/22 12:02, Nadav Amit wrote: >> This new "early lazy check" behavior could theoretically work both ways. >> If threads tended to be waking up from idle when TLB flushes were being >> sent, this would tend to reduce the number of IPIs. But, since they >> tend to be going to sleep it increases the number of IPIs. >> >> Anybody have a better theory? I think we should probably revert the commit. > > Let’s get back to the motivation behind this patch. > > Originally we had an indirect branch that on system which are > vulnerable to Spectre v2 translates into a retpoline. > > So I would not paraphrase this patch purpose as “early lazy check” > but instead “more efficient lazy check”. There is very little code > that was executed between the call to on_each_cpu_cond_mask() and > the actual check of tlb_is_not_lazy(). So what it seems to happen > in this test-case - according to what you say - is that *slower* > checks of is-lazy allows to send fewer IPIs since some cores go > into idle-state. > > Was this test run with retpolines? If there is a difference in > performance without retpoline - I am probably wrong. Nope, no retpolines: > /sys/devices/system/cpu/vulnerabilities/spectre_v2:Mitigation: Enhanced IBRS, IBPB: conditional, RSB filling which is the same situation as the "Xeon Platinum 8358" which found this in 0day. Maybe the increased IPIs with this approach end up being a wash with the reduced retpoline overhead. Did you have any specific performance numbers that show the benefit on retpoline systems?