Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp780805pxb; Thu, 30 Sep 2021 17:42:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1LAVgC4gjFGUxLoovwnQnLYl3s9CKDeHybVPXRTKm6pAq8TYWXpVY9GYwM4g4QGAl/Thn X-Received: by 2002:aa7:8887:0:b0:43c:83fe:2c56 with SMTP id z7-20020aa78887000000b0043c83fe2c56mr7165721pfe.82.1633048965030; Thu, 30 Sep 2021 17:42:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1633048965; cv=pass; d=google.com; s=arc-20160816; b=k1hlie0alLMZLHMnahpdD9E94DNuF4qBLTUMJN5Vp6YZmYD0c969tuEOpiwkWMk3sA D25SzYP/p/FpwP6YF3cfbJNDxAjJwc3tGJJsG5EGs9xHIo8/arv96Ro88xnUTQxG5kka qhFYSSr2t7JBzsMHFq7FdEmp6UOD1grGP9xi6Gb61kotKQFFBhXPAghThbwPq0k8XPMK x7Nd/rFoybSxuhz9IUTKblcK5c0pCVj1rCJ2RoFHn0voXXhMWu0MOeC+MhxJqn6YBDUW +rk2FRqnu2bC2A3gR199tjYfdsUrpPTxiCVcmAUvtjFgTxdoeN/ankr7f/zx/5kHN6kV QkHg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-language :content-transfer-encoding:in-reply-to:user-agent:date:message-id :from:references:cc:to:subject:dkim-signature; bh=aqMOt9UR4Nu+hD7zvVuQmRP9Z4ORnMa3A5tWNXxUUmk=; b=k2njv22diz2G6bI7GAg92UyQDQRwX4w8RcXofMlgh9+ASx5657Whl/Clo4W0VRFUkr o41/EtB86bxpeaBEEaguTd8hU88isu65kVJ77XnhrX3Q9FIEX8CBoadKFqrQUp8x5igB sYsttdFzlVmdeRLYEt2k6LqD+95Ld41iD5me0v8sMIbPwXa4Rsz9vAgM+l2tesBJbUa/ MvFipzSRQ54lfrjKevxPG8K2vNpBxE/jojnxUqgs1je10RZlDC5lfBQvn5/8rNcrTQWL eQfK/ht75Ma6cijVHLp//FKJb3pRYGi4Q1SAQV2VUP7LF9WlXc/AsTTI4tuV0UJg6A3K vRMQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=Fz2jwYGs; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d20si5980403pfr.69.2021.09.30.17.42.31; Thu, 30 Sep 2021 17:42:45 -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; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=Fz2jwYGs; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351161AbhJAAmf (ORCPT + 99 others); Thu, 30 Sep 2021 20:42:35 -0400 Received: from mga06.intel.com ([134.134.136.31]:54352 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349760AbhJAAme (ORCPT ); Thu, 30 Sep 2021 20:42:34 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10123"; a="286343931" X-IronPort-AV: E=Sophos;i="5.85,336,1624345200"; d="scan'208";a="286343931" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2021 17:40:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,336,1624345200"; d="scan'208";a="564552041" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga002.fm.intel.com with ESMTP; 30 Sep 2021 17:40:30 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 30 Sep 2021 17:40:30 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 30 Sep 2021 17:40:30 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 30 Sep 2021 17:40:30 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 30 Sep 2021 17:40:29 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SV5jmUKZuHnSNzeYeIQTf1h7oNTdBhgYOzz0YcF3Ns77FcZhRNr2130vFvLDvZJsSeSt2yRpxavvlncAmmT7t4ZluaKHzEK/dtDsaANlkDrb+AGXHcoqbVk39Tz89JA4qWzb+jdsYKS/LKBuIfkKNnkoLNRvPDo7CsXs27//vVBRW2i2mMeDU0/ZBXJRy6mX7XKUyuFL4pWzy6f99qUQkY82fGhkHk3iSUB1JFzsNhkX3tdERq6uyTsEpq1MT7m+UlfOSiIsZ97dOLGPSdfUaHwr4acTh1ANqqbb7KIutBaPtl/Cm5tdRNsRKGQfIr/xdy9BpxyFjFcXPbcD1Ji/Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aqMOt9UR4Nu+hD7zvVuQmRP9Z4ORnMa3A5tWNXxUUmk=; b=OiJc+4O2M5q0jIP7DbOjpidlhlK3kxeXr5/TCcSHreGC6I0f8pnIFZZPivj991ocI+IFRdXbWwkCH/slC8BrgUsRMauzigPz9lzY2wyI9ypmJixLWtTqKcewhFK5gG5rGAqNcjJRR37SilAq8U6vSpUndBaZq4g1FbD+BQjZmxOQU4CAYkuOv3lTGTpETs2FjbV9OWcIIR5u+z/Pz8nmGXHwXOeEjANa/uDH1IQAXZQbYGs6zfiE1ftqnHdtmMh2f6UtQVEsXS51mcCr6ETCJa4clwydeNwUY3FxrIzKZe1ojSaj8Ya3jECjbX+TeIy2Dkb0ABp6ptWUe/r3Zt8Fxw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aqMOt9UR4Nu+hD7zvVuQmRP9Z4ORnMa3A5tWNXxUUmk=; b=Fz2jwYGs+f63X6bA6pC4z13RL4yWn25ZZ1zhHpG+SRM/eyX1Ql6E0vklcZEJdo/tg0/4Fx52+XI0BiphnO5Ev5yrQdkFSL/jE/iCiAd6wKi4ubgJ+gfgERDUp8IycnrrzZ0feVEVdFPW2Lhq2g5Xgh+y2AlxMh508WGFLIUWkcI= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=intel.com; Received: from BYAPR11MB3320.namprd11.prod.outlook.com (2603:10b6:a03:18::25) by BYAPR11MB2760.namprd11.prod.outlook.com (2603:10b6:a02:c0::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Fri, 1 Oct 2021 00:40:26 +0000 Received: from BYAPR11MB3320.namprd11.prod.outlook.com ([fe80::4167:f9ef:19b2:eaff]) by BYAPR11MB3320.namprd11.prod.outlook.com ([fe80::4167:f9ef:19b2:eaff%3]) with mapi id 15.20.4566.016; Fri, 1 Oct 2021 00:40:26 +0000 Subject: Re: [RFC PATCH 00/13] x86 User Interrupts support To: Stefan Hajnoczi CC: , Tony Luck , Dave Hansen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Andy Lutomirski , Jens Axboe , Christian Brauner , Peter Zijlstra , Shuah Khan , Arnd Bergmann , Jonathan Corbet , Ashok Raj , Jacob Pan , "Gayatri Kammela" , Zeng Guang , "Dan Williams" , Randy E Witt , Ravi V Shankar , Ramesh Thomas , , , , References: <20210913200132.3396598-1-sohil.mehta@intel.com> From: Sohil Mehta Message-ID: Date: Thu, 30 Sep 2021 17:40:24 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.14.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-ClientProxiedBy: SJ0PR03CA0272.namprd03.prod.outlook.com (2603:10b6:a03:39e::7) To BYAPR11MB3320.namprd11.prod.outlook.com (2603:10b6:a03:18::25) MIME-Version: 1.0 Received: from [192.168.86.37] (73.222.31.188) by SJ0PR03CA0272.namprd03.prod.outlook.com (2603:10b6:a03:39e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.13 via Frontend Transport; Fri, 1 Oct 2021 00:40:25 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5011ac40-95c7-48d9-d06b-08d984740f93 X-MS-TrafficTypeDiagnostic: BYAPR11MB2760: X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zazQW2HYzw9/ERTAOc8Gr4pxyTTRnA93WCMNgSSuGA3gialiXsAy6by0BFTI+03Wxt0K8nu7Bq1j8S5oXSPvmQiDYnMiCmHkY5zK3VZnxqita5WzXB84lV9Eu8nND74x29LbqRR4fPrebXZqfGFkQ7rXBQ4CrNW+afIYne7YEkne//K0vvM3WNYLp6ni8h6TgUD7u8DE/ORaaTasqGyA5ZJbk9C0uzVPcBqrLNOy4/dh8K7+FXrsIMKExAeqcHN1wmOcofH87J4FW7uvoiEUYlmYTJ2Ue86i2cG/xyMwOUSiwqE4GdvRqyC2xxfATZueqjchld5CBnahcTG0T+tx9DK0/oZ4T+MGTbJ2Q8cI7z0+ZKpiL1wo32S6FzH5zS9t9mhMHGm164NV0/anpAvKKoxSVAUFtBgekTWGeMB1nZwXsxoaxpN95u070M4WRcbqkd8JaGtlWcNhfN7Ie3hE5mVgtV+MWarr0ou8Ru/3Lee54LRbpCOilaXRBa5ZzPWmBLzhhi4h69MISA3mjDkr5plwKV8zk11FYgGxTT5ZY9FNUR4Rju+LVZtOrusKboZ65Aj6fqA7W7Qo6OogxtB1xtin22AzO+K2194p7+KgDXUvqCgUN8V9Xdyl3xh21wXRl482XW1o/F51HiV9T1uIHHejGrUOGBmogotz5fzXSpZovbX65fJZPRqH2j+y+dHvTGed55MhniID/T4/gsKJUVehEL//E0HE7zDSkN+PTHDdVUMZJWIrsutZutgLPgwMgIhY5kCuUvoVRfl8BtapmiElTDMJhaI8RJ010fOnS+tjrc3T/iIg3LR+P1pASUBt X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR11MB3320.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(7416002)(316002)(16576012)(36756003)(54906003)(86362001)(8676002)(508600001)(83380400001)(8936002)(31686004)(5660300002)(956004)(31696002)(186003)(2616005)(6486002)(966005)(26005)(38100700002)(2906002)(4326008)(6916009)(53546011)(66946007)(66476007)(66556008)(44832011)(45980500001)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?Windows-1252?Q?HI0rd6/EGpvb7asDPWAPwYaFkxRXRlpvMaRo1gSxY9RBDFXw5EmN7Uzs?= =?Windows-1252?Q?uP617BRfSCCaktcb0YA6x4OSHDARWOTX20hambzcfA95+h8zDXIzsF0v?= =?Windows-1252?Q?Zi3yteKDICcmvEb04hz1uVxtERcNVEn5IKbeyx1NmPb8PHa6FUEF3/C1?= =?Windows-1252?Q?yQaeUngIQ12krMcZh35p9L5A6wLvEDnDHVrqpWI5yWzZGziCPsNrvj2G?= =?Windows-1252?Q?oxo68cePPbSDReYNk3mEzkpfhLNOfzw2V2cnKgPNmDue6vNpTsTSOYBT?= =?Windows-1252?Q?JWG/uEnamjgLU6F9o2MpsLmQdz1Ou6UR96JniJlT8YKJAS16QKHGUkXd?= =?Windows-1252?Q?Tjf8s8X/vWvEJEj9vbMpHf/I52KDhlJoZr0rz2lIX2XBwVFDx1h2zKq0?= =?Windows-1252?Q?XCIMPPvnLfp5atj6igFg1oIkRQ3stjEJ666PUk4uDzb/EQSyqBxl6SzN?= =?Windows-1252?Q?BhCw8iqOU9qVOWia6+ZvPQ8tzYw/oG/XdR8UZnwH6HzZfrDgYH7r30iV?= =?Windows-1252?Q?QfjMKsy0GdJb2NkbrRe74zUNTO/JrCKHvIKRSery8Sge+ecxpihz4ubT?= =?Windows-1252?Q?Td5pieh0T2YabUEIyyuz0/fiSjBhb00Lok76dDculQCrVp+xSy8rj+R2?= =?Windows-1252?Q?2nuHLnGD0AJyAPzWv7PrQCLAhElzIrHCGojRGWMZl+A7zIu1YBPONvOF?= =?Windows-1252?Q?tmmoyU+D3tLk4pfjL77GMqofl/xtrNd9yhMZQRS9K996KYjyifZwp7I9?= =?Windows-1252?Q?RK+IWL1ftBABeQNJ/EZVy+AW3pbLg+Iye461iJNDOnXz7bupwRLJxxVU?= =?Windows-1252?Q?+yI3bS6xUpWRbuBTs9sIXMpJaSr6JUGWevPbSroOnNkIJsoWzt17EB2Q?= =?Windows-1252?Q?TMWyEiGaUe5iMswnxniqaSMBQZe9VOs+11DWeTcUQ59BUo0aSIzBPVmT?= =?Windows-1252?Q?TgWrzXncLFSdaJSwAlkUVFqC7R9M2pbkQGOvnZ+/SGZxwjLtF7GF8rIK?= =?Windows-1252?Q?u/xqdeQFcllyNYQScgTlhDhdE6jyVqHN8xlRDn0TZgK3zpNUro59VV05?= =?Windows-1252?Q?QiW4Cj5EntatLPIArk8ntk9gio97DqseeLU2BsMsJfpYr38I0HpWBuc0?= =?Windows-1252?Q?Jy3WeacPo7AwybHb3hdduqzBjc6YFUy6hlGTgjQkEGU4C/qJyyeZaQPq?= =?Windows-1252?Q?yeDsggapk21abCS5I7/24/X7VIrtm8b56zRveJOX2fphAZsu572ia9xF?= =?Windows-1252?Q?v5tGnYZVx2mY3GSEbsWRdN6mwCG/M5u+wyOhaN6wxj6ExM4M6tWCC1nf?= =?Windows-1252?Q?YykAzlFcuqUR941+w1L2jEzDTprfHPHaETz6xzh56A/QrqdrJ/XyQ3/2?= =?Windows-1252?Q?ghC8Qvis9orWMlAytxjH2Z7bDwkfQZ7OHYfQ0HXdUZY8BD+BAduJas5b?= X-MS-Exchange-CrossTenant-Network-Message-Id: 5011ac40-95c7-48d9-d06b-08d984740f93 X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3320.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Oct 2021 00:40:26.4902 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OnjXpLwYwp0fmiglsSVEgESwZkoQjQW6x7UTLHL+GljOw5+SaOkzzNycqImj9UxXpbyYpKiBGf5C6RZJxa7bAw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2760 X-OriginatorOrg: intel.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/30/2021 9:26 AM, Stefan Hajnoczi wrote: > On Mon, Sep 13, 2021 at 01:01:19PM -0700, Sohil Mehta wrote: >> +------------+-------------------------+ >> | IPC type | Relative Latency | >> | |(normalized to User IPI) | >> +------------+-------------------------+ >> | User IPI | 1.0 | >> | Signal | 14.8 | >> | Eventfd | 9.7 | > Is this the bi-directional eventfd benchmark? > https://github.com/intel/uintr-ipc-bench/blob/linux-rfc-v1/source/eventfd/eventfd-bi.c Yes. I have left it unmodified from the original source. But, I should have looked at it more closely. > Two things stand out: > > 1. The server and client threads are racing on the same eventfd. > Eventfds aren't bi-directional! The eventfd_wait() function has code > to write the value back, which is a waste of CPU cycles and hinders > progress. I've never seen eventfd used this way in real applications. > Can you use two separate eventfds? Sure. I can do that. > 2. The fd is in blocking mode and the task may be descheduled, so we're > measuring eventfd read/write latency plus scheduler/context-switch > latency. A fairer comparison against user interrupts would be to busy > wait on a non-blocking fd so the scheduler/context-switch latency is > mostly avoided. After all, the uintrfd-bi.c benchmark does this in > uintrfd_wait(): > > // Keep spinning until the interrupt is received > while (!uintr_received[token]); That makes sense. I'll give this a try and send out the updated results. Thanks, Sohil