Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp333104rdb; Thu, 19 Oct 2023 06:04:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFiCXYSrIEfsmFE9/M0mYRu/xi4uKAYsdx0tswwPAmNB73W6tZn2XPGbArVui0BZoDTZhoN X-Received: by 2002:a17:902:9a4b:b0:1c9:bca1:d70c with SMTP id x11-20020a1709029a4b00b001c9bca1d70cmr2141861plv.30.1697720653534; Thu, 19 Oct 2023 06:04:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697720653; cv=none; d=google.com; s=arc-20160816; b=evl/2VH2IRkzW8jNqjr7l9JS/Re75L2LSf47HrsLg7nXhfD5jU8oiT7tD8tC5mgJc2 +ZqSMpeoNsqMHUyS42DVPge6pN6c3U1YSc0/I0RPIBe1CsUiVfwREOZCgYA9g3zwSujB pnaGRtMtM+C1Z+bHMbdRLkNWCPDS0CTNSwlX2k7aaZofgtNqeIW/OxdyE4oQ+qVKdUrN lq2hyD6NRVIUg+d2tgoV1x6g3fxP08GfOffGT9dPddP2qUE76nP5EJnsmGihkf+XqQa5 8yDIjmdVtnLWzmE/BsixrbTIFu+K0Y3HvDUsm4oPCi3c1ju7lKABoqNqJ+Jk4yjDbgwI PEHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:cc:to:from:date:subject :message-id; bh=Xrn7FaUCid4Pn6be7493thJbdyO7Io/cgCEQvS+/ipU=; fh=BXMGSVlN6OlngdBx06lETCkN0bY0XpuphERSe8Z8350=; b=qHn3BBuaUJbsWgnBDpk5MgIInNRjgswTOqtw5iIxwT8Y3wmT0kNwzS7clh7RT4aEtk AB1+f17U9KP+OPF+NB4/Xkag041PWsN6/TSfpvGcJHyKjifeWZmG0NA9MS4INJqv8T1+ Eibpjg3UYuAjbJLKF8Nwfp0jz0eX73YQ9WlJsf0sZZpzeuztMgBAOYH7xZwGvOU/ZfsG vbUGQ1QSrulfRtB1CvC7HvXR0DD60LoVrjTt6QGvCdmDtUp8Hfg9xNph82pqWhLQAees kySnfvFm2d0ED/5gspY7zU9UpG16HmegRBiIfhLOrc+fOgxrH04YxgRzpRIocoymiAku R+dA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id b7-20020a170902d50700b001c5b9ef1d34si2287660plg.340.2023.10.19.06.04.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 06:04:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id D4063806B715; Thu, 19 Oct 2023 06:04:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345782AbjJSNC0 (ORCPT + 99 others); Thu, 19 Oct 2023 09:02:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235479AbjJSNCR (ORCPT ); Thu, 19 Oct 2023 09:02:17 -0400 Received: from out199-16.us.a.mail.aliyun.com (out199-16.us.a.mail.aliyun.com [47.90.199.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92F9449F7 for ; Thu, 19 Oct 2023 05:59:34 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=xuanzhuo@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0VuU3cJJ_1697720225; Received: from localhost(mailfrom:xuanzhuo@linux.alibaba.com fp:SMTPD_---0VuU3cJJ_1697720225) by smtp.aliyun-inc.com; Thu, 19 Oct 2023 20:57:06 +0800 Message-ID: <1697720122.49851-2-xuanzhuo@linux.alibaba.com> Subject: Re: [PATCH 1/2] virtio_pci: Don't make an extra copy of cpu affinity mask Date: Thu, 19 Oct 2023 20:55:22 +0800 From: Xuan Zhuo To: Jakub Sitnicki Cc: "Michael S. Tsirkin" , Jason Wang , linux-kernel@vger.kernel.org, kernel-team@cloudflare.com, Caleb Raitto , virtualization@lists.linux-foundation.org References: <20231019101625.412936-1-jakub@cloudflare.com> In-Reply-To: <20231019101625.412936-1-jakub@cloudflare.com> X-Spam-Status: No, score=-0.7 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 19 Oct 2023 06:04:02 -0700 (PDT) On Thu, 19 Oct 2023 12:16:24 +0200, Jakub Sitnicki wrote: > Since commit 19e226e8cc5d ("virtio: Make vp_set_vq_affinity() take a > mask.") it is actually not needed to have a local copy of the cpu mask. Could you give more info to prove this? If you are right, I think you should delete all code about msix_affinity_masks? Thanks. > > Pass the cpu mask we got as argument to set the irq affinity hint. > > Cc: Caleb Raitto > Signed-off-by: Jakub Sitnicki > --- > drivers/virtio/virtio_pci_common.c | 9 +-------- > 1 file changed, 1 insertion(+), 8 deletions(-) > > diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c > index c2524a7207cf..8927bc338f06 100644 > --- a/drivers/virtio/virtio_pci_common.c > +++ b/drivers/virtio/virtio_pci_common.c > @@ -433,21 +433,14 @@ int vp_set_vq_affinity(struct virtqueue *vq, const struct cpumask *cpu_mask) > struct virtio_device *vdev = vq->vdev; > struct virtio_pci_device *vp_dev = to_vp_device(vdev); > struct virtio_pci_vq_info *info = vp_dev->vqs[vq->index]; > - struct cpumask *mask; > unsigned int irq; > > if (!vq->callback) > return -EINVAL; > > if (vp_dev->msix_enabled) { > - mask = vp_dev->msix_affinity_masks[info->msix_vector]; > irq = pci_irq_vector(vp_dev->pci_dev, info->msix_vector); > - if (!cpu_mask) > - irq_set_affinity_hint(irq, NULL); > - else { > - cpumask_copy(mask, cpu_mask); > - irq_set_affinity_hint(irq, mask); > - } > + irq_set_affinity_hint(irq, cpu_mask); > } > return 0; > } > -- > 2.41.0 >