Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1531714rdh; Fri, 27 Oct 2023 18:47:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFbe/ixxgKqrHH68cbTYSuKzQP93s1SErUT5rmkKD7hcACPGx59hHMig2AYIatSTXBeW0Wg X-Received: by 2002:a05:6830:4387:b0:6cd:914f:2e20 with SMTP id s7-20020a056830438700b006cd914f2e20mr5303161otv.5.1698457654436; Fri, 27 Oct 2023 18:47:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698457654; cv=none; d=google.com; s=arc-20160816; b=LwkUHez8rOIgZyQKW3y8pvBqUtGFWXE5djGR8kEwg6FhrJjKry45hyvmx2oCe7jMmw 0yPed4c7fq13UpgSf26VragFRJ2ZICL+pmytTKjT0gjLrCc7mMoKRdNO0gYUj2MKyYaN uVUk+bDhp5uqPzuarQ6HmCqoVLeiv9sdxTES848VM7OzFIg5hePdVJoFlSmQkxCf1P+Q tyq/SdjOBemIgR/CoBlwXntj10huSXl6orpTuU8Z67E5OC0BEkhWgG4/eRqrrALXnBAo PG+EOu4AKx0adJ9/62fosENCoXOGYY/3XYUgP8b0CP4+sJLri3fK9TVVtscSflJ3Ttgl Y3Bw== 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=JL9YQFVxCBRsdfQwYkeS3dZm5ZhrNG4yLTMtYPBzFKU=; fh=Zs7/f6ymZN5onC1CLbS/wYVG9f9RKG66whAoYilZ3YU=; b=uVHb/HHYo7Y8UqFCKRBiRyWljePy7JzBdzp4vrRlMiRnvJCAtc56xDZe6RPbAuI4Wv Q6eHripcltpfObrPnrLCgSrqF0vFUdXb7o7QyOxp2z9mbTYnQDMovHc5siFevEglLWpg zx+iJq+xXTKlVM4kRs08jUDF6uei4Ai40jgE7htBZENl4x8jjII7K4TB00EW7yC+gZqx c2n1KZWjPHFlr/9lndmNphpZNIEesP5Jl2VmzUaxXiYqTShqZrnd4tbeGIjGseQnDn8n TYxQRQ5qB+eBsowWB2w1NqBgZW10VF0Zwvc2SioDS9YS4mjNXOXntSCkh2sjZD1JJOfv HR8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id e4-20020a656884000000b005b11e5a69fdsi1798506pgt.508.2023.10.27.18.47.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 18:47:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 7D41C82D7C54; Fri, 27 Oct 2023 18:47:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232936AbjJ1Brd (ORCPT + 99 others); Fri, 27 Oct 2023 21:47:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229471AbjJ1Brc (ORCPT ); Fri, 27 Oct 2023 21:47:32 -0400 Received: from out30-110.freemail.mail.aliyun.com (out30-110.freemail.mail.aliyun.com [115.124.30.110]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EF12C4 for ; Fri, 27 Oct 2023 18:47:29 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R641e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046059;MF=xuanzhuo@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0Vv05X6g_1698457645; Received: from localhost(mailfrom:xuanzhuo@linux.alibaba.com fp:SMTPD_---0Vv05X6g_1698457645) by smtp.aliyun-inc.com; Sat, 28 Oct 2023 09:47:26 +0800 Message-ID: <1698457540.127802-1-xuanzhuo@linux.alibaba.com> Subject: Re: [PATCH v2] virtio_pci: Switch away from deprecated irq_set_affinity_hint Date: Sat, 28 Oct 2023 09:45:40 +0800 From: Xuan Zhuo To: Jakub Sitnicki Cc: virtualization@lists.linux-foundation.org, Jason Wang , linux-kernel@vger.kernel.org, kernel-team@cloudflare.com, "Michael S. Tsirkin" References: <20231025145319.380775-1-jakub@cloudflare.com> <87wmv91h3p.fsf@cloudflare.com> <20231026131830-mutt-send-email-mst@kernel.org> <87sf5w1ica.fsf@cloudflare.com> In-Reply-To: <87sf5w1ica.fsf@cloudflare.com> X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 27 Oct 2023 18:47:33 -0700 (PDT) On Fri, 27 Oct 2023 12:03:17 +0200, Jakub Sitnicki wrote: > On Thu, Oct 26, 2023 at 01:20 PM -04, Michael S. Tsirkin wrote: > > On Thu, Oct 26, 2023 at 06:25:08PM +0200, Jakub Sitnicki wrote: > >> On Wed, Oct 25, 2023 at 04:53 PM +02, Jakub Sitnicki wrote: > >> > Since commit 65c7cdedeb30 ("genirq: Provide new interfaces for affinity > >> > hints") irq_set_affinity_hint is being phased out. > >> > > >> > Switch to new interfaces for setting and applying irq affinity hints. > >> > > >> > Signed-off-by: Jakub Sitnicki > >> > --- > >> > v2: > >> > - Leave cpumask_copy as is. We can't pass pointer to stack memory as hint. > >> > Proposed a change to IRQ affinity interface to address this limitation: > >> > https://lore.kernel.org/r/20231025141517.375378-1-jakub@cloudflare.com > >> > >> Just a note to the ^ - if we wanted to get rid of msix_affinity_masks, > >> we could call irq_set_affinity directly, instead of calling it through > >> irq_set_affinity[_and]_hint. > >> > >> The hint wouldn't be available any more in /proc/irq/N/affinity_hint, > >> but the same information can be gathered from /proc/irq/N/smp_affinity. > >> > >> [...] > > > > > > So we are potentially breaking some userspace - what's the value we > > gain? Is there some way we can make disable_irq/enable_irq work? > > That would have a lot of value. > > There is an actual need for that in virtio for coco but we can't use > > these APIs with affinity managed IRQs. > > Sorry, that is beyond my ken today. > > I saw the comment in vp_modern_disable_vq_and_reset: > > /* For the case where vq has an exclusive irq, call synchronize_irq() to > * wait for completion. > * > * note: We can't use disable_irq() since it conflicts with the affinity > * managed IRQ that is used by some drivers. > */ > > ... but I fail to follow how the two conflict. > > Perhaps Xuah could shed some light here. I forgot which device that manages the irq by it self. If we disable the irq, then the device will lost the irq, so we must not call disable_irq(). Thanks.