Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp458997iob; Thu, 28 Apr 2022 06:17:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjizDkGwrNQeqqoVkrNBwtqm88uk2v1fqyTb9Sir/xU8kDtSvGqxDG1mYSdho6Qa6ntKe9 X-Received: by 2002:a17:906:c145:b0:6f3:9ea7:1d41 with SMTP id dp5-20020a170906c14500b006f39ea71d41mr17575636ejc.269.1651151848196; Thu, 28 Apr 2022 06:17:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651151848; cv=none; d=google.com; s=arc-20160816; b=RzmCOy7frWd7LcpNovaYMSJuXVSJcgAAfNl7WHwG3KkGMxODmXY93goA3JyQPtoI+f viEP0pPj3b7GbPPMenKtQ6RHlabRL/rFSfZ4s47XuluWmzJZNZEz/o4fAUGozcLXr81y QpuGvVB5VNg8J1Nm90KFgdH7CApgh8jsC9fg7wEt+9t9j5NEjzVcKvMMLjBZU5pRmg22 fmheOK++nKoTQrqgtasLW+lrAuy26UzUKJydtDN4nNYXisWkurc4pM+yY1rnA/cqv7PI 53dsB9KvgK+V+zr8h3uI5xDd9ShXgFqGuA0SggPJQfXx9kMaH8EZf6Huxt3g9JHdcrr1 s4+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qQhGtA47NR84b2kaV85amh4Sebyf9NryuvTIfdPeXpA=; b=o3M0IcDa3X9puqLkCbDNguBP94ccriq3yJjhwBfjLvLelfVMSFdXCYHMVGj9+dwl6T 1q9RHl+l0yp0CBvREUiF0jPfr4MFjXqq+yJUtgOYElYqI1f7IUTyQttkWjYUQmwk9dW+ sOopbIOUJ7FJiksMDuUA6ApxSCAYZo6EEnty4OEElLWwjoFQjVP246NXcYpUFsPSIcwp Oj5w7kzu9aCCezDWJaAXNmaFfbnt79fHwmQ/jToQgVmgv6uGFsUjWkflwP8VHlAC+rv+ O19Fqd0s2gc4O28UAUUmeLQTQh/iHS4nd0cu0WxTY33rmeIJaQMNDKeDl+FsS2QfbXVd skVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=K5bDmTSn; 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 a13-20020a1709062b0d00b006e877f0ba78si3853167ejg.705.2022.04.28.06.17.03; Thu, 28 Apr 2022 06:17:28 -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=K5bDmTSn; 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 S243614AbiD1GUr (ORCPT + 99 others); Thu, 28 Apr 2022 02:20:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243605AbiD1GUp (ORCPT ); Thu, 28 Apr 2022 02:20:45 -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 06345532F6 for ; Wed, 27 Apr 2022 23:17:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651126648; 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=qQhGtA47NR84b2kaV85amh4Sebyf9NryuvTIfdPeXpA=; b=K5bDmTSnZ2E7/XoLjkYPUmvrHp26LDs6R9AhgQLl0RtKnWBF//b8TvJL1CH3tGjIk0AVZD Rms3e2W+f2nbyz3lVCHlreXSVaK1nqxDfmdwPk93XrFq2CD2JU5uvvoVVSNgT60M17MlQa tmFJlTjqHN7Godo9EYWpQLmg2mu6XyM= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-93-XkX60JfoPbq7ZWGKLkHP3w-1; Thu, 28 Apr 2022 02:17:26 -0400 X-MC-Unique: XkX60JfoPbq7ZWGKLkHP3w-1 Received: by mail-wm1-f71.google.com with SMTP id h65-20020a1c2144000000b0038e9ce3b29cso3912528wmh.2 for ; Wed, 27 Apr 2022 23:17:26 -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=qQhGtA47NR84b2kaV85amh4Sebyf9NryuvTIfdPeXpA=; b=Et1B4BrukHVXi8TRl+ACbjNxx9k4PO+ihT6Ps/cd+E15qL+ccSR1ONRNi9EWV6daQx 3IuCAThS6AyJ3CTyirqDZxTOm+LdLM3nfcjNgPki4egHOE8MpFPjdxVIvtnN4aVYUf7M 14duMB7fUNph1KhLgqCUZuSrnshP6wn4zQwSlxXmaHSF9nESoLvsHy312aApuPt0kCV/ l1iq71nUNtRilaXVCALndSJjkfnxqAZpZeHH4ZY8LCMAqt5By45ib2QvdGGxtOaojdMb VmqEVclIQ+SVuLDjWn1LonHtWnMmOwsON3cYNad6qwtgbTdzBxUUnd1bT99Kj7XQWjZN rylg== X-Gm-Message-State: AOAM5333NErQm/wcZ0iJXAc+BDX74MG6CVEyaVTzi1xzOyO+NZJGs4G9 6Mu30PdKewxhUcEkh1RQn2uKGRnBDBhA0lEo+0n2v3yagpLDmocA9lx4Sj40QWL75E7P+KeKeFy MGEnKH9u2b+eEFqhEH89IjLsO X-Received: by 2002:a05:600c:1d9b:b0:393:ffc8:a09b with SMTP id p27-20020a05600c1d9b00b00393ffc8a09bmr6976969wms.40.1651126645654; Wed, 27 Apr 2022 23:17:25 -0700 (PDT) X-Received: by 2002:a05:600c:1d9b:b0:393:ffc8:a09b with SMTP id p27-20020a05600c1d9b00b00393ffc8a09bmr6976935wms.40.1651126645390; Wed, 27 Apr 2022 23:17:25 -0700 (PDT) Received: from redhat.com ([2.53.18.16]) by smtp.gmail.com with ESMTPSA id o2-20020a5d6482000000b0020a96536fcdsm16391780wri.57.2022.04.27.23.17.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 23:17:24 -0700 (PDT) Date: Thu, 28 Apr 2022 02:17:19 -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: <20220428021658-mutt-send-email-mst@kernel.org> References: <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> <20220428015318-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE 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 Thu, Apr 28, 2022 at 02:02:16PM +0800, Jason Wang wrote: > On Thu, Apr 28, 2022 at 1:55 PM Michael S. Tsirkin wrote: > > > > 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? > > I think what you meant is using a dedicated rwlock instead of trying > to reuse one of the airq_info locks. > > If this is true, it should be fine. > > Thanks yes > > > > > > > > > > -- > > > > MST > > > > > >