From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6B78C4332F for ; Fri, 1 Oct 2021 16:36:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9CBBD619F9 for ; Fri, 1 Oct 2021 16:36:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355087AbhJAQhx (ORCPT ); Fri, 1 Oct 2021 12:37:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:35084 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355046AbhJAQhw (ORCPT ); Fri, 1 Oct 2021 12:37:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633106167; 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: in-reply-to:in-reply-to:references:references; bh=pu/Lo/8PIcVP2w18pMUuKpKdni82TYWbWCVM3bXJdyE=; b=E50guQegsNAcTypCsesfZ4T8nHgAKg6ZFE6OvmmsdD9OpFCmWCGt5Pr4pF5JggfesTx1Ow JHFp2O6I7cJdgBbTpHotbcajt04dH5Ch/4fGEQVnmnU4x+1pkS8E/+bOIcqfcUi2MYJ/0H T2cip+u+dyu9NfX9daiVrYM2eHmy0jo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-382-Gq9idoBgPeePeb96LPjoWQ-1; Fri, 01 Oct 2021 12:36:05 -0400 X-MC-Unique: Gq9idoBgPeePeb96LPjoWQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 639F119200D3; Fri, 1 Oct 2021 16:36:01 +0000 (UTC) Received: from localhost (unknown [10.39.192.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id B5B51608BA; Fri, 1 Oct 2021 16:36:00 +0000 (UTC) Date: Fri, 1 Oct 2021 17:35:58 +0100 From: Stefan Hajnoczi To: Sohil Mehta , Peter Maydell , Alex =?iso-8859-1?Q?Benn=E9e?= , Richard Henderson Cc: Andy Lutomirski , the arch/x86 maintainers , Tony Luck , Dave Hansen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Jens Axboe , Christian Brauner , "Peter Zijlstra (Intel)" , Shuah Khan , Arnd Bergmann , Jonathan Corbet , Raj Ashok , Jacob Pan , Gayatri Kammela , Zeng Guang , "Williams, Dan J" , Randy E Witt , "Shankar, Ravi V" , Ramesh Thomas , Linux API , linux-arch@vger.kernel.org, Linux Kernel Mailing List , linux-kselftest@vger.kernel.org, qemu-devel@nongnu.org Subject: Re: [RFC PATCH 00/13] x86 User Interrupts support Message-ID: References: <20210913200132.3396598-1-sohil.mehta@intel.com> <456bf9cf-87b8-4c3d-ac0c-7e392bcf26de@www.fastmail.com> <778d40fe-ad8e-fd7c-4caa-499910bb0925@intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9EVyQ6g1a8JZP43O" Content-Disposition: inline In-Reply-To: <778d40fe-ad8e-fd7c-4caa-499910bb0925@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --9EVyQ6g1a8JZP43O Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 30, 2021 at 10:24:24AM -0700, Sohil Mehta wrote: >=20 > On 9/30/2021 9:30 AM, Stefan Hajnoczi wrote: > > On Tue, Sep 28, 2021 at 09:31:34PM -0700, Andy Lutomirski wrote: > > >=20 > > > I spent some time reviewing the docs (ISE) and contemplating how this= all fits together, and I have a high level question: > > >=20 > > > Can someone give an example of a realistic workload that would benefi= t from SENDUIPI and precisely how it would use SENDUIPI? Or an example of = a realistic workload that would benefit from hypothetical device-initiated = user interrupts and how it would use them? I'm having trouble imagining so= mething that wouldn't work as well or better by simply polling, at least on= DMA-coherent architectures like x86. > > I was wondering the same thing. One thing came to mind: > >=20 > > An application that wants to be *interrupted* from what it's doing > > rather than waiting until the next polling point. For example, > > applications that are CPU-intensive and have green threads. I can't name > > a real application like this though :P. >=20 > Thank you Stefan and Andy for giving this some thought. >=20 > We are consolidating the information internally on where and how exactly = we > expect to see benefits with real workloads for the various sources of User > Interrupts. It will take a few days to get back on this one. One possible use case came to mind in QEMU's TCG just-in-time compiler: QEMU's TCG threads execute translated code. There are events that require interrupting these threads. Today a check is performed at the start of every translated block. Most of the time the check is false and it's a waste of CPU. User interrupts can eliminate the need for checks by interrupting TCG threads when events occur. I don't know whether this will improve performance or how feasible it is to implement, but I've added people who might have ideas. (For a summary of user interrupts, see https://lwn.net/SubscriberLink/871113/60652640e11fc5df/.) Stefan --9EVyQ6g1a8JZP43O Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmFXOO4ACgkQnKSrs4Gr c8j1LQf/SZwCRlCZlWue5FvVhDmWF//uX4PGQQMaisI7h989XbCnOAuKgojBX/CZ juXKMDJAuLrBR85BOl/7mEz/bM4m1b7pkMq4GR73ER/5/aupQv/yldA+MPklTyzQ 8DXcmTsApJk7CQvCOheb6CWKwtCZ0pkZu12vnk8w+IiL601ZYzyWr/wPUFCjxWXa GjqeLxGzpHjczrw4f9zjTsheGhZaX7TVLh6ULQ2dsLxIRXw+23tQPmCd19mAh0Oc Zgg/Mk4la+cNm5RXfdSTbunqafjGQLeNYBRLMA4DzigKxeU2wCULezW9ZLN8LJ6u MNGacFSLGXxsd2Waa5fBTjGyji5qwg== =GlvG -----END PGP SIGNATURE----- --9EVyQ6g1a8JZP43O-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09344C433F5 for ; Fri, 1 Oct 2021 16:39:40 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9114261A38 for ; Fri, 1 Oct 2021 16:39:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9114261A38 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:47832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWLZS-0008DD-Iy for qemu-devel@archiver.kernel.org; Fri, 01 Oct 2021 12:39:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46438) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWLX7-0005rX-W1 for qemu-devel@nongnu.org; Fri, 01 Oct 2021 12:37:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:58590) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWLX3-0008Gw-MB for qemu-devel@nongnu.org; Fri, 01 Oct 2021 12:37:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633106170; 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: in-reply-to:in-reply-to:references:references; bh=pu/Lo/8PIcVP2w18pMUuKpKdni82TYWbWCVM3bXJdyE=; b=OxsiESFzo1oWMh0vZ+mPneAvPcTZzBa+YDPL/7NqFyVgyG+7FORhUteWx+ysK9kDopm/7+ an8RHhnn8liiXnmYcF3vj9rDWRMnGNZ8Nws17M/0JWXYM+i2eHXVspGdBpnvpttmAnbY2e 0FBV9JNCbdEsZ+irNxBy9jEJ1HH+AXU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-382-Gq9idoBgPeePeb96LPjoWQ-1; Fri, 01 Oct 2021 12:36:05 -0400 X-MC-Unique: Gq9idoBgPeePeb96LPjoWQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 639F119200D3; Fri, 1 Oct 2021 16:36:01 +0000 (UTC) Received: from localhost (unknown [10.39.192.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id B5B51608BA; Fri, 1 Oct 2021 16:36:00 +0000 (UTC) Date: Fri, 1 Oct 2021 17:35:58 +0100 From: Stefan Hajnoczi To: Sohil Mehta , Peter Maydell , Alex =?iso-8859-1?Q?Benn=E9e?= , Richard Henderson Subject: Re: [RFC PATCH 00/13] x86 User Interrupts support Message-ID: References: <20210913200132.3396598-1-sohil.mehta@intel.com> <456bf9cf-87b8-4c3d-ac0c-7e392bcf26de@www.fastmail.com> <778d40fe-ad8e-fd7c-4caa-499910bb0925@intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9EVyQ6g1a8JZP43O" Content-Disposition: inline In-Reply-To: <778d40fe-ad8e-fd7c-4caa-499910bb0925@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Received-SPF: pass client-ip=170.10.133.124; envelope-from=stefanha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Peter Zijlstra \(Intel\)" , qemu-devel@nongnu.org, Dave Hansen , linux-kselftest@vger.kernel.org, "H. Peter Anvin" , Shuah Khan , Thomas Gleixner , linux-arch@vger.kernel.org, Raj Ashok , Jonathan Corbet , the arch/x86 maintainers , Ingo Molnar , Zeng Guang , Gayatri Kammela , "Shankar, Ravi V" , Jacob Pan , Arnd Bergmann , Ramesh Thomas , Borislav Petkov , Andy Lutomirski , "Williams, Dan J" , Christian Brauner , Jens Axboe , Tony Luck , Linux API , Randy E Witt , Linux Kernel Mailing List Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --9EVyQ6g1a8JZP43O Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 30, 2021 at 10:24:24AM -0700, Sohil Mehta wrote: >=20 > On 9/30/2021 9:30 AM, Stefan Hajnoczi wrote: > > On Tue, Sep 28, 2021 at 09:31:34PM -0700, Andy Lutomirski wrote: > > >=20 > > > I spent some time reviewing the docs (ISE) and contemplating how this= all fits together, and I have a high level question: > > >=20 > > > Can someone give an example of a realistic workload that would benefi= t from SENDUIPI and precisely how it would use SENDUIPI? Or an example of = a realistic workload that would benefit from hypothetical device-initiated = user interrupts and how it would use them? I'm having trouble imagining so= mething that wouldn't work as well or better by simply polling, at least on= DMA-coherent architectures like x86. > > I was wondering the same thing. One thing came to mind: > >=20 > > An application that wants to be *interrupted* from what it's doing > > rather than waiting until the next polling point. For example, > > applications that are CPU-intensive and have green threads. I can't name > > a real application like this though :P. >=20 > Thank you Stefan and Andy for giving this some thought. >=20 > We are consolidating the information internally on where and how exactly = we > expect to see benefits with real workloads for the various sources of User > Interrupts. It will take a few days to get back on this one. One possible use case came to mind in QEMU's TCG just-in-time compiler: QEMU's TCG threads execute translated code. There are events that require interrupting these threads. Today a check is performed at the start of every translated block. Most of the time the check is false and it's a waste of CPU. User interrupts can eliminate the need for checks by interrupting TCG threads when events occur. I don't know whether this will improve performance or how feasible it is to implement, but I've added people who might have ideas. (For a summary of user interrupts, see https://lwn.net/SubscriberLink/871113/60652640e11fc5df/.) Stefan --9EVyQ6g1a8JZP43O Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmFXOO4ACgkQnKSrs4Gr c8j1LQf/SZwCRlCZlWue5FvVhDmWF//uX4PGQQMaisI7h989XbCnOAuKgojBX/CZ juXKMDJAuLrBR85BOl/7mEz/bM4m1b7pkMq4GR73ER/5/aupQv/yldA+MPklTyzQ 8DXcmTsApJk7CQvCOheb6CWKwtCZ0pkZu12vnk8w+IiL601ZYzyWr/wPUFCjxWXa GjqeLxGzpHjczrw4f9zjTsheGhZaX7TVLh6ULQ2dsLxIRXw+23tQPmCd19mAh0Oc Zgg/Mk4la+cNm5RXfdSTbunqafjGQLeNYBRLMA4DzigKxeU2wCULezW9ZLN8LJ6u MNGacFSLGXxsd2Waa5fBTjGyji5qwg== =GlvG -----END PGP SIGNATURE----- --9EVyQ6g1a8JZP43O--