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 B73FBC433EF for ; Thu, 28 Apr 2022 05:52:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243242AbiD1Fzg (ORCPT ); Thu, 28 Apr 2022 01:55:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233097AbiD1Fza (ORCPT ); Thu, 28 Apr 2022 01:55:30 -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 ESMTP id 0BD1D7C278 for ; Wed, 27 Apr 2022 22:52:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651125134; 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=VG8xe0Lj4eTE8PBjFl2duBm+bHnWsA2hI9mqEPY5x1M=; b=hbROdJuK/dex2novTUjm+kgshKmg/9kOoJmD/rQRVX3nFdNDxS1sMt0hMC16xd+IWfhQSG 3GLz57tsR/iN5YmsrtqhksftUXVCAD2Q7mRiDPHV734Gza/CldW/kpOmEHzRq9lnJdMwo2 UU8HaNpYqXeT6aIB6MMy0JuayR29EVs= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-49-SylRQrP1OMe7M02ymwz1wQ-1; Thu, 28 Apr 2022 01:52:12 -0400 X-MC-Unique: SylRQrP1OMe7M02ymwz1wQ-1 Received: by mail-lj1-f200.google.com with SMTP id v1-20020a2e2f01000000b0024da499933dso1432833ljv.19 for ; Wed, 27 Apr 2022 22:52:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VG8xe0Lj4eTE8PBjFl2duBm+bHnWsA2hI9mqEPY5x1M=; b=oQcvmN0Ru7qNgq206qi05OcL0bIxH6CGwnyaoLC3Qwh9/slMiLMAaGH/quneOhJKoy pwuDy8OWdMRhXUDUKg5CPQOcYST1KoEiu8ltcyKVM5rA3ic/uN89L9ulXkwgitU6r6h9 wk4wULFuc7vAbQ2aDnLjokSr+KKuNfnI2AMTxnmOvT4tH5iNOJGrpQRV8zte+tVCI5lo 5zkJNcndRYXgj7ZobT5GGjRo37re8tLzJ25VfZwOGrpGVXH6pkfR4hfyMjocEBIHKCXK 2h79PJqb4sWBSmEy00XcuTCSq6Z5VVS79FTd2U+Bnj1X5I9jHPGJKC4dPBz4q9/NQ0Fn +4wA== X-Gm-Message-State: AOAM532n/ksgjnG3nf7BYbHFMlDN+Emmfv6kf6Wa3CjhBDUbHzFzRY1S JFd/oWZIuAGXYHq+aiKVKFETWb/gALLLWZLgBVFvCq9QL0/DlM8udgDRJMGy75Hkd//B6g1ghsG cfcv7Obtn5fK8dGy1J0R5hCygGXe04ukXuA9tSTgl X-Received: by 2002:a05:6512:b81:b0:448:b342:513c with SMTP id b1-20020a0565120b8100b00448b342513cmr22834531lfv.257.1651125130907; Wed, 27 Apr 2022 22:52:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQ1RzrfWfSkhGClXkO34qKBaipySKvQusBGIxeNu+GZHGD2TZarCmX1ullRo8BzpxyDgwoENa2ajgmtrv0F3g= X-Received: by 2002:a05:6512:b81:b0:448:b342:513c with SMTP id b1-20020a0565120b8100b00448b342513cmr22834515lfv.257.1651125130719; Wed, 27 Apr 2022 22:52:10 -0700 (PDT) MIME-Version: 1.0 References: <20220425233434-mutt-send-email-mst@kernel.org> <20220425233604-mutt-send-email-mst@kernel.org> <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> In-Reply-To: <20220428012156-mutt-send-email-mst@kernel.org> From: Jason Wang Date: Thu, 28 Apr 2022 13:51:59 +0800 Message-ID: Subject: Re: [PATCH V3 6/9] virtio-ccw: implement synchronize_cbs() To: "Michael S. Tsirkin" Cc: Halil Pasic , Cornelia Huck , linux-kernel , virtualization , Stefano Garzarella , eperezma , Cindy Lu , Thomas Gleixner , Peter Zijlstra , "Paul E. McKenney" , Marc Zyngier Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > -- > MST > 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 smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 9287DC433EF for ; Thu, 28 Apr 2022 05:52:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 46570812E0; Thu, 28 Apr 2022 05:52:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ohEh_oqOyhS0; Thu, 28 Apr 2022 05:52:19 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 00D08812DB; Thu, 28 Apr 2022 05:52:18 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 98B3BC0032; Thu, 28 Apr 2022 05:52:18 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1DE32C002D for ; Thu, 28 Apr 2022 05:52:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 048E74026E for ; Thu, 28 Apr 2022 05:52:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id z16Vz-cjY7d3 for ; Thu, 28 Apr 2022 05:52:15 +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 smtp4.osuosl.org (Postfix) with ESMTPS id A86644025B for ; Thu, 28 Apr 2022 05:52:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651125134; 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=VG8xe0Lj4eTE8PBjFl2duBm+bHnWsA2hI9mqEPY5x1M=; b=hbROdJuK/dex2novTUjm+kgshKmg/9kOoJmD/rQRVX3nFdNDxS1sMt0hMC16xd+IWfhQSG 3GLz57tsR/iN5YmsrtqhksftUXVCAD2Q7mRiDPHV734Gza/CldW/kpOmEHzRq9lnJdMwo2 UU8HaNpYqXeT6aIB6MMy0JuayR29EVs= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-396-lpDxbzetOjSoHOBwn3YKxQ-1; Thu, 28 Apr 2022 01:52:12 -0400 X-MC-Unique: lpDxbzetOjSoHOBwn3YKxQ-1 Received: by mail-lf1-f69.google.com with SMTP id bp36-20020a05651215a400b004722f090903so1367679lfb.22 for ; Wed, 27 Apr 2022 22:52:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VG8xe0Lj4eTE8PBjFl2duBm+bHnWsA2hI9mqEPY5x1M=; b=l85hcEG5SAN4Ti43p6kppK3HVjILYLkeumtSuIW+6Pq2DvaxdOGqJmuu2Pw1tTc3dR E/T3bHlfhSbdxpY/n8IkV0sHmanO1LxsXvwVaTHvxET+9uuEeIDVIGU9BrJIuZ/93slo 544XQe+w4k3biC6R6hVMGmQqnA8RGUWMqhaJU+wVr0oPaIuuusByplL3rc1D5cTOF55I 34ZR+BluFmiAG7SpQCXCDBUZDY45hX3n24STcOqu5XEARc16BNze3P+XP14x4k5V8qkX 6M1PGk1y6RvBetRN4Q8CI2KiwenEWDPQJbIiTFVq3SliuekdWRLzeuczwSOo3MQ87dRu KeDw== X-Gm-Message-State: AOAM5315LQOGsbybbxDrquc2Oa36HwOz8DnlfD5dtLN/Mz6GdV7epiFa JaSqyIwlHB584E/hTgUltLnPToHfRGTQeqrdCfZCLxa+fD7feEVU9ZhYhKgsTqRHIhBOZ5Seyfl DS6A1U6t/MZPNxnvCY7Og2+epj7gLgTsRmembaA815HTJ85MiI5ezov0lXg== X-Received: by 2002:a05:6512:b81:b0:448:b342:513c with SMTP id b1-20020a0565120b8100b00448b342513cmr22834529lfv.257.1651125130907; Wed, 27 Apr 2022 22:52:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQ1RzrfWfSkhGClXkO34qKBaipySKvQusBGIxeNu+GZHGD2TZarCmX1ullRo8BzpxyDgwoENa2ajgmtrv0F3g= X-Received: by 2002:a05:6512:b81:b0:448:b342:513c with SMTP id b1-20020a0565120b8100b00448b342513cmr22834515lfv.257.1651125130719; Wed, 27 Apr 2022 22:52:10 -0700 (PDT) MIME-Version: 1.0 References: <20220425233434-mutt-send-email-mst@kernel.org> <20220425233604-mutt-send-email-mst@kernel.org> <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> In-Reply-To: <20220428012156-mutt-send-email-mst@kernel.org> From: Jason Wang Date: Thu, 28 Apr 2022 13:51:59 +0800 Message-ID: Subject: Re: [PATCH V3 6/9] virtio-ccw: implement synchronize_cbs() To: "Michael S. Tsirkin" Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jasowang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 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 > > -- > MST > _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization