Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2354619iob; Sat, 30 Apr 2022 06:27:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQMLIMadMGn6cjnMDtWNlboD2Ru3nqXQHatKFe6fk7XSOoZsmJCeLJeNy7CQj3CnCOHgmT X-Received: by 2002:a17:903:20d3:b0:15b:151c:cadb with SMTP id i19-20020a17090320d300b0015b151ccadbmr4013533plb.154.1651325247529; Sat, 30 Apr 2022 06:27:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651325247; cv=none; d=google.com; s=arc-20160816; b=Uhhx/VSZZ/pYYJXhMrnOgBg22a+rBKH09gwVGe6PlN3BPA4oSwGVIMccN+m8a8FLVC loTDQRcWtnABEAiXMwSoQHwsB1SgJszMP/7kcoH6tlPYOusYeIPkoxYkeyRxFlReKJCR RyycsHZjayy09OAbHf1VDu79XkB41GAgeSbM3JUipyO8ubZri/+MVV6mRpfFuteAuzJG ebFVb7cYRl2rqp/zXv35vUWg/7L2q3iJiWLFlRsQWsYiFIHbFKFXG8WpOU7c3TBz0B43 wyAlbyz91hkkCiGl20qxPD2UYykujPAdV9U2gR+LPUd8k+LvkcyKYKemWCHUu1+y6Uy5 Sapw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Dvj9G0/4wUIqSyOJTfvrlWtHyKpXimLlrMN8i333+hY=; b=BLup3LNMjk7z91+iGquhBF4Jb4obti6EQ//L4iu8Lj1asgZHj4jIpbVkpOgh7Db1Ef HPRF430J1+Z02NCgq8DD6WUzFtr+Ekrqy7qaURDB9qmt9j5RvjFjmsM+tWD38tPaSFXM +Pxh2NAo3moV1LbuaJ+jbp8uTuk+gAhA7ahaLEeBIbQkTgWBq7+o0gMRrGhqi1C7ROtl xcv5spsdczyMUaVGTAe4vCVHY+uZFtLfsR+uB2gsw9zQq2SRNvobRFzRsNjEKdc7/Wa3 ORIePm5PpTQl0YKTSKqot8HtoOlDQfde4C2Cxd5q+eCbQ8Kk5DhPsQx7JQ1nB49jL2xk hbXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RKG22wbD; 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 h19-20020a62b413000000b004faec051bd4si8688663pfn.242.2022.04.30.06.27.02; Sat, 30 Apr 2022 06:27:27 -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=RKG22wbD; 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 S1354126AbiD2CGH (ORCPT + 99 others); Thu, 28 Apr 2022 22:06:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231903AbiD2CGF (ORCPT ); Thu, 28 Apr 2022 22:06:05 -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 186B3BAB98 for ; Thu, 28 Apr 2022 19:02:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651197764; 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=Dvj9G0/4wUIqSyOJTfvrlWtHyKpXimLlrMN8i333+hY=; b=RKG22wbD7Y11yaRV1jckzFWf0gqUNde7zf/9kaQVHXJVqkbn1UMsvvtNFUlkLNFO9L7FWW PXlJax8SAAccDXE6Ef/b8pa+h1KtwdhqdjX9FZmnCitD5K6o+rskNVX6FXdm8YYwSelDCk BOPSh3GC7t1pOajMGInhWVuDMFhjLYA= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-7-fqYgiyJmO_2ZLYBgnH3-IA-1; Thu, 28 Apr 2022 22:02:22 -0400 X-MC-Unique: fqYgiyJmO_2ZLYBgnH3-IA-1 Received: by mail-lf1-f70.google.com with SMTP id bt27-20020a056512261b00b004720e026d4dso2703336lfb.16 for ; Thu, 28 Apr 2022 19:02:22 -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=Dvj9G0/4wUIqSyOJTfvrlWtHyKpXimLlrMN8i333+hY=; b=hRDtqSxiMjr0wg4Pt2NuAdNDXXpcIS73RrfZ5MM6DB5AYg63qdJOoNfhcbfyMQFmhy zrNyuHA0GpqG+E/FLOrK0/T/15ehcgbtEgP/WUsymwaaSrAeT7/lZOuVLw0t9YI8+YyO 3VDnLZc2WURAaSvghv6u45GRYaD+f3Csdb34kOp2WUIWFwwCu6gpP5UHXAMW2bGihTcJ R9wCoJbo/ngyhBKuX7Ky6fZNWZ0wRPjtIjZfkHMJs5gIVHfgQOpOgAb9veBlcEOHbLGF VeLzXlU7Al+73qAQSdfFHiUaaVSbTa8e3y8Okdtp2hDmLTvfi1ggIhJ5giNWLrnidaBn pdqA== X-Gm-Message-State: AOAM53076M0xXht/KFDW/v9vkfgZ42zd/Kon5ttHRBhG5oQGEaNMRBf7 CiVwjSx6TgbtaGG5VBtIxD5W2r5eRKanockP7ypfukRRLJ0xjk9HN71jEeDYpEKQO/lUQ9jrx7k Y8fFtxWihOd+KKLlVX2evrAr6m7A+5IsokzhLQvyn X-Received: by 2002:a05:6512:1526:b0:471:44fa:c367 with SMTP id bq38-20020a056512152600b0047144fac367mr25928157lfb.376.1651197741184; Thu, 28 Apr 2022 19:02:21 -0700 (PDT) X-Received: by 2002:a05:6512:1526:b0:471:44fa:c367 with SMTP id bq38-20020a056512152600b0047144fac367mr25928142lfb.376.1651197740985; Thu, 28 Apr 2022 19:02:20 -0700 (PDT) MIME-Version: 1.0 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> <20220428015318-mutt-send-email-mst@kernel.org> <87zgk5lkme.fsf@redhat.com> In-Reply-To: <87zgk5lkme.fsf@redhat.com> From: Jason Wang Date: Fri, 29 Apr 2022 10:02:09 +0800 Message-ID: Subject: Re: [PATCH V3 6/9] virtio-ccw: implement synchronize_cbs() To: Cornelia Huck Cc: "Michael S. Tsirkin" , Halil Pasic , linux-kernel , virtualization , Stefano Garzarella , eperezma , Cindy Lu , Thomas Gleixner , Peter Zijlstra , "Paul E. McKenney" , Marc Zyngier Content-Type: text/plain; charset="UTF-8" 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 3:42 PM Cornelia Huck wrote: > > On Thu, Apr 28 2022, 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. > > FWIW, that approach makes sense to me as well. > Good to know that. Let me post a new version. Thanks