Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5733462rwd; Sun, 18 Jun 2023 18:32:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6KdOMh9wMZlC4Tx+dqEc+3YERJeEK+dYpKiuyj4P+X8tE2fLfItqjhRuyUbsEXDfj7JPin X-Received: by 2002:a05:6a00:150f:b0:665:c37f:759e with SMTP id q15-20020a056a00150f00b00665c37f759emr6195668pfu.6.1687138340638; Sun, 18 Jun 2023 18:32:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687138340; cv=none; d=google.com; s=arc-20160816; b=nL0bH85ewYFdoMBb1KtDAjtTWDTpQYZ91ZXW7IOuKdIlMBKvP2ln6GOsDxmeoOm5sQ eQp0Fqe3CO9fKQw4tY4rhJWX4jIsg6xeAIKyhETcEpmErsS6DTO2FhDx5U5yQhH7g0BX y6aT9tP9D9ueVjgkpyGVAYk+pzwScV6lqrjW3xc0tix+FQJUWEZFVnYdbMIfd3jDPY1T HOTxtSgNCOqAi0tNJWqMpJaSW5nv/0U4hjdE137MF+aNA3+MOV2x7W8pw/3jTX+VgI4L nBtp3+IUcxbUA22ufbR7E/m2X7OqPSSQsofOcSMvRplnHJOtBdn/QMSFXHQY553+qYcO MjsA== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=VJcFjV6pMmGhhQ74b6q47TJilbjK91hK2Te/yYvvcKY=; b=oeFsk6LZhRdY2HSsofkKuoaYLb8mP+at5SiVD8qgDmQlnA9evmfW+XkQiJ/i/E408A yPgJOC1pFAtZKopBlBRUj4EL16E8JG46+vA+LOhUQwQmZGrohT6WKLz0XY6dakafnWot dPiqMVy+UnqdTtTkAj9a5F8l+Zoy6qqzSHVTrbXXGogtG1rxKizOUneAM7nRmadDqJic nR9KwzO+KeStuHAlBYOINlh9gMtDXXNjQ4EyOcSNYwqYxnoHRSQDQKJ1icaOKKcMyIq4 x1osBsJb1Qmp6JeTOy9ztBEBPlxpn4GBb3L6atClUOq9eEZFk5/J5W66rnBLfKd3vf8N Uypg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HH83hPVo; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x26-20020aa7941a000000b006536902d31fsi20275394pfo.185.2023.06.18.18.32.04; Sun, 18 Jun 2023 18:32:20 -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=@redhat.com header.s=mimecast20190719 header.b=HH83hPVo; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229592AbjFSBUE (ORCPT + 99 others); Sun, 18 Jun 2023 21:20:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbjFSBUC (ORCPT ); Sun, 18 Jun 2023 21:20:02 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9283710C4 for ; Sun, 18 Jun 2023 18:18:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687137531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VJcFjV6pMmGhhQ74b6q47TJilbjK91hK2Te/yYvvcKY=; b=HH83hPVobLJJVwVaJZbbud3WXOFijc7zV54zcaVE7/ZWL3D9UUuuJtbr6KDOQrygKRpNLY TJeGiLpDnyNXyhLnFPbj2bsVqJWRl6A+K1GPz0X5cUfajnbF2VWJNcYXvx+aEPdP0qVvMX jZfzrQSCr8v4GA0M2/IVOVCz8stx5yA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-587-V6JgilncMMe0GUh746NMGw-1; Sun, 18 Jun 2023 21:18:44 -0400 X-MC-Unique: V6JgilncMMe0GUh746NMGw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7359F101A528; Mon, 19 Jun 2023 01:18:43 +0000 (UTC) Received: from [10.22.16.51] (unknown [10.22.16.51]) by smtp.corp.redhat.com (Postfix) with ESMTP id D6FDB112132C; Mon, 19 Jun 2023 01:18:41 +0000 (UTC) Message-ID: <55219f3b-992d-ccc3-ba29-7bf33465b5cc@redhat.com> Date: Sun, 18 Jun 2023 21:18:41 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH 0/5] x86/speculation: Disable IBRS when idle Content-Language: en-US To: Peter Zijlstra , Robin Jarry Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H.Peter Anvin" , Peter Zijlstra , Josh Poimboeuf , Pawan Gupta , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel@vger.kernel.org, x86@kernel.org, Joe Mario References: <20230616200003.745742-1-longman@redhat.com> <20230617122115.GA1830050@hirez.programming.kicks-ass.net> From: Waiman Long In-Reply-To: <20230617122115.GA1830050@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 6/17/23 08:21, Peter Zijlstra wrote: > On Fri, Jun 16, 2023 at 10:14:52PM +0200, Robin Jarry wrote: >> Waiman Long, Jun 16, 2023 at 21:59: >>> For Intel processors that need to turn on IBRS to protect against >>> Spectre v2 and Retbleed, the IBRS bit in the SPEC_CTRL MSR affects >>> the performance of the whole core even if only one thread is turning >>> it on when running in the kernel. For user space heavy applications, >>> the performance impact of occasionally turning IBRS on during syscalls >>> shouldn't be significant. Unfortunately, that is not the case when the >>> sibling thread is idling in the kernel. In that case, the performance >>> impact can be significant. >>> >>> When DPDK is running on an isolated CPU thread processing network packets >>> in user space while its sibling thread is idle. The performance of the >>> busy DPDK thread with IBRS on and off in the sibling idle thread are: >>> >>> IBRS on IBRS off >>> ------- -------- >>> packets/second: 7.8M 10.4M >>> avg tsc cycles/packet: 282.26 209.86 >>> >>> This is a 25% performance degradation. The test system is a Intel Xeon >>> 4114 CPU @ 2.20GHz. >>> >>> This patch series turns off IBRS when in various idle mode to eliminate >>> the performance impact of the idling thread on its busy sibling thread. >> Hi Longman, >> >> thanks a lot for the quick turnaround on this issue. >> >> Tested-by: Robin Jarry > I can't see the patches -- they didn't arrive in my mailbox nor can I > find them in the archive, in fact this here mail is the only evidence > they exist at all. I got a rebound message from your mail server about incorrect message format. It is probably caused by some problem in my end. > However, did you all see intel_idle_ibrs() and how that is selected for > C6 and up? > > What exactly isn't working there? We were testing on the RHEL9.2 kernel which doesn't have your intel_idle_ibrs() patch yet. My preliminary testing does indicate your patch will likely work. I will ask Jerry to test a newer RHEL9.3 kernel with the intel_idle_ibrs() patch to see if it helps. > Also, instead of investing more in this IBRS trainwreck, did you all try > call-depth-stuffing ? Yes, we are planning to backport your call-depth-stuffing code, but I believe there is still some issue outstanding that you need to address. So we need a solution to work around this issue in the mean time. Cheers, Longman