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 smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 55A19C433F5 for ; Thu, 28 Apr 2022 05:55:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id D64E160AA3; Thu, 28 Apr 2022 05:55:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DbTSlpbFA36E; Thu, 28 Apr 2022 05:55:26 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id 74F5F605E8; Thu, 28 Apr 2022 05:55:25 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3A1EDC0032; Thu, 28 Apr 2022 05:55:25 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6A601C002D for ; Thu, 28 Apr 2022 05:55:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 510EE60A6C for ; Thu, 28 Apr 2022 05:55:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LoPsnYMf0CHF for ; Thu, 28 Apr 2022 05:55:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id 415DD605E8 for ; Thu, 28 Apr 2022 05:55:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651125319; 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=zgRDxje8lznBc9+MD1tXV7m51++4qJtjj5+PFYkzgUw=; b=e1rm8HVAEEqUmgpdRC8pVcQ0Y7X3u4bvvgKVCIZ+AX++1TsqT4PlVUESRqEbelwbjk23hn 2kLL1fN8zYEnZjD1f7BiT5JkbwTCh4u5HPV3AzikNI9WWZQ6bijlcnO349bOiSCvTrQIk+ gJbW/MqPI+BBfur2cUM+Bpql9GrIqcs= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-478-dR-ngkCeMcmNgy21QZWvJA-1; Thu, 28 Apr 2022 01:55:18 -0400 X-MC-Unique: dR-ngkCeMcmNgy21QZWvJA-1 Received: by mail-wm1-f70.google.com with SMTP id d13-20020a05600c3acd00b0038ff865c043so3887847wms.3 for ; Wed, 27 Apr 2022 22:55:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=zgRDxje8lznBc9+MD1tXV7m51++4qJtjj5+PFYkzgUw=; b=dmTd45BAKJvGx2QNdkWyTFq1oplDR8aOmOzlnv/L6JbJ4KMTWqoNN32E06qJn8+z0v 3YRAp3VMM/wekVQ2c0ObOePt/zrzD8X081BO7EhX6Kt3S9yKL4Otz/+C7P6zn2rbooSV OwaHXnflGcs4i+v0gIwGXAKcFT71TzuV/HAU2F2BDGLQUmGSYX4kxpexbX3fVTiTBZaz Ib2xE+CCeIVXe+mhpnj0S5aycpOlZ4gyftTB40PqlfjE6+gvTdRXMpa6qWDi5MwU9XNr kRVMICV8ewcuH03hntpCQj2sdtGSUuQUP/VSjK6rwEsAZW+sMPVs0uEn2ALV3euLUkf3 izAA== X-Gm-Message-State: AOAM530MNFSCwoddBbid6cMsswhzqyY1L6IXsFvICAlx8YNl2vw3J5cN 4mJtyT4gt9catkT2j51u0qsUvi4RCRDMrcUhe2jJcs4tzUp1awI4zC7vLzB83615m1q0UXE8ms8 +VExTYKRGPSMH1yNCKle5EuG24BoiY+JosC0Gvp5QUQ== X-Received: by 2002:a7b:c5d0:0:b0:389:fe85:3d79 with SMTP id n16-20020a7bc5d0000000b00389fe853d79mr38726724wmk.77.1651125317366; Wed, 27 Apr 2022 22:55:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQWgQ7NzqEU9cQw2Mx4ZanfKZ/GYh96JpvrJZ3jPrVl9wOjeb9azjXMZoITgzaDPdWoxaVSA== X-Received: by 2002:a7b:c5d0:0:b0:389:fe85:3d79 with SMTP id n16-20020a7bc5d0000000b00389fe853d79mr38726696wmk.77.1651125317023; Wed, 27 Apr 2022 22:55:17 -0700 (PDT) Received: from redhat.com ([2.53.18.16]) by smtp.gmail.com with ESMTPSA id f1-20020a1c6a01000000b0038c9f6a3634sm2997790wmc.7.2022.04.27.22.55.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 22:55:16 -0700 (PDT) Date: Thu, 28 Apr 2022 01:55:12 -0400 From: "Michael S. Tsirkin" To: Jason Wang Subject: Re: [PATCH V3 6/9] virtio-ccw: implement synchronize_cbs() Message-ID: <20220428015318-mutt-send-email-mst@kernel.org> References: <20220425235134-mutt-send-email-mst@kernel.org> <20220425235415-mutt-send-email-mst@kernel.org> <87o80n7soq.fsf@redhat.com> <20220426124243-mutt-send-email-mst@kernel.org> <87ilqu7u6w.fsf@redhat.com> <20220428044315.3945e660.pasic@linux.ibm.com> <20220428012156-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Cc: "Paul E. McKenney" , Cindy Lu , Peter Zijlstra , Marc Zyngier , Cornelia Huck , linux-kernel , virtualization , Halil Pasic , eperezma , Thomas Gleixner X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" On Thu, Apr 28, 2022 at 01:51:59PM +0800, Jason Wang wrote: > On Thu, Apr 28, 2022 at 1:24 PM Michael S. Tsirkin wrote: > > > > On Thu, Apr 28, 2022 at 11:04:41AM +0800, Jason Wang wrote: > > > > But my guess is that rwlock + some testing for the legacy indicator case > > > > just to double check if there is a heavy regression despite of our > > > > expectations to see none should do the trick. > > > > > > I suggest this, rwlock (for not airq) seems better than spinlock, but > > > at worst case it will cause cache line bouncing. But I wonder if it's > > > noticeable (anyhow it has been used for airq). > > > > > > Thanks > > > > Which existing rwlock does airq use right now? Can we take it to sync? > > It's the rwlock in airq_info, it has already been used in this patch. > > write_lock(&info->lock); > write_unlock(&info->lock); > > But the problem is, it looks to me there could be a case that airq is > not used, (virtio_ccw_int_hander()). That's why the patch use a > spinlock, it could be optimized with using a rwlock as well. > > Thanks Ah, right. So let's take that on the legacy path too and Halil promises to test to make sure performance isn't impacted too badly? > > > > -- > > MST > > _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 508B8C433EF for ; Thu, 28 Apr 2022 05:56:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243431AbiD1F7L (ORCPT ); Thu, 28 Apr 2022 01:59:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243393AbiD1F6h (ORCPT ); Thu, 28 Apr 2022 01:58:37 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4C5527C798 for ; Wed, 27 Apr 2022 22:55:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651125320; 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=zgRDxje8lznBc9+MD1tXV7m51++4qJtjj5+PFYkzgUw=; b=ZKeTWDSuUlG3rRl2WcGUhk1VBZeJ2xMvob0JVOdnsWIseZmlCtHWcAPgM4Xdzbw5cJPFV+ 08Q/Xb4JEORKV3FgMTw3tiXCljABre5eXpwNdAPYoUsLI90xnxy1N8v9zfdaXSF2VVeykn dZN81kLUJt1InpbYQfzlDrXhhCWDTqI= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-478-ZBpi3B9yMfuPHWHELz4yeg-1; Thu, 28 Apr 2022 01:55:18 -0400 X-MC-Unique: ZBpi3B9yMfuPHWHELz4yeg-1 Received: by mail-wr1-f72.google.com with SMTP id j21-20020adfa555000000b0020adb9ac14fso1511699wrb.13 for ; Wed, 27 Apr 2022 22:55:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=zgRDxje8lznBc9+MD1tXV7m51++4qJtjj5+PFYkzgUw=; b=DZqHo/XCDeZ49vpuOS4w4XtdLwYoxIrEJMkuhYHWEjl2Xo1MmftpojaLCygKnmcObj TTpvVnrl5E3G7JpeL64w2rjt1nAvQYo7FaTW16tgiofyFA+Pw89/Q65bkpxdcoaBGbJR mCWodzkLbp2ih1v8ZVpBwawjEz4930ue3gbGq87BniZqcEdGlga7N/BMfOs/lGAcMSYF Q6vd5PEprhZPpIR0VZisgJat7rQV/D9ULk+pq1UMpSi9PQ3joWkYmr42Yy3Bh6POCtfa TWa5otTJF4KRNCXYJXwLypS7vrz8NaBpjwENt/TdtA+39QOAeLSVnIs1r8/aK4cyGzOS nRTQ== X-Gm-Message-State: AOAM5329qFv37ERKK6k9HvqelBD2gqku1xexAi7MikTsqJ4WvUYrW86x o9TACC7ZclY6Ee5pjrkM/ndVKLA5K5/hUfXORrY424MGp3UrpBzdxUpQBZwkFf6Dupsj6BTXLH1 WEpRrN5ywL0MiAxWWNlTFZWAA X-Received: by 2002:a7b:c5d0:0:b0:389:fe85:3d79 with SMTP id n16-20020a7bc5d0000000b00389fe853d79mr38726723wmk.77.1651125317366; Wed, 27 Apr 2022 22:55:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQWgQ7NzqEU9cQw2Mx4ZanfKZ/GYh96JpvrJZ3jPrVl9wOjeb9azjXMZoITgzaDPdWoxaVSA== X-Received: by 2002:a7b:c5d0:0:b0:389:fe85:3d79 with SMTP id n16-20020a7bc5d0000000b00389fe853d79mr38726696wmk.77.1651125317023; Wed, 27 Apr 2022 22:55:17 -0700 (PDT) Received: from redhat.com ([2.53.18.16]) by smtp.gmail.com with ESMTPSA id f1-20020a1c6a01000000b0038c9f6a3634sm2997790wmc.7.2022.04.27.22.55.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 22:55:16 -0700 (PDT) Date: Thu, 28 Apr 2022 01:55:12 -0400 From: "Michael S. Tsirkin" To: Jason Wang Cc: Halil Pasic , Cornelia Huck , linux-kernel , virtualization , Stefano Garzarella , eperezma , Cindy Lu , Thomas Gleixner , Peter Zijlstra , "Paul E. McKenney" , Marc Zyngier Subject: Re: [PATCH V3 6/9] virtio-ccw: implement synchronize_cbs() Message-ID: <20220428015318-mutt-send-email-mst@kernel.org> References: <20220425235134-mutt-send-email-mst@kernel.org> <20220425235415-mutt-send-email-mst@kernel.org> <87o80n7soq.fsf@redhat.com> <20220426124243-mutt-send-email-mst@kernel.org> <87ilqu7u6w.fsf@redhat.com> <20220428044315.3945e660.pasic@linux.ibm.com> <20220428012156-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 28, 2022 at 01:51:59PM +0800, Jason Wang wrote: > On Thu, Apr 28, 2022 at 1:24 PM Michael S. Tsirkin wrote: > > > > On Thu, Apr 28, 2022 at 11:04:41AM +0800, Jason Wang wrote: > > > > But my guess is that rwlock + some testing for the legacy indicator case > > > > just to double check if there is a heavy regression despite of our > > > > expectations to see none should do the trick. > > > > > > I suggest this, rwlock (for not airq) seems better than spinlock, but > > > at worst case it will cause cache line bouncing. But I wonder if it's > > > noticeable (anyhow it has been used for airq). > > > > > > Thanks > > > > Which existing rwlock does airq use right now? Can we take it to sync? > > It's the rwlock in airq_info, it has already been used in this patch. > > write_lock(&info->lock); > write_unlock(&info->lock); > > But the problem is, it looks to me there could be a case that airq is > not used, (virtio_ccw_int_hander()). That's why the patch use a > spinlock, it could be optimized with using a rwlock as well. > > Thanks Ah, right. So let's take that on the legacy path too and Halil promises to test to make sure performance isn't impacted too badly? > > > > -- > > MST > >