From: Jakub Sitnicki via Virtualization <virtualization@lists.linux-foundation.org>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
kernel-team@cloudflare.com, linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org
Subject: Re: [PATCH v2] virtio_pci: Switch away from deprecated irq_set_affinity_hint
Date: Fri, 27 Oct 2023 12:03:17 +0200 [thread overview]
Message-ID: <87sf5w1ica.fsf@cloudflare.com> (raw)
In-Reply-To: <20231026131830-mutt-send-email-mst@kernel.org>
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 <jakub@cloudflare.com>
>> > ---
>> > 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.
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
WARNING: multiple messages have this Message-ID (diff)
From: Jakub Sitnicki <jakub@cloudflare.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: virtualization@lists.linux-foundation.org,
Jason Wang <jasowang@redhat.com>,
Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
linux-kernel@vger.kernel.org, kernel-team@cloudflare.com
Subject: Re: [PATCH v2] virtio_pci: Switch away from deprecated irq_set_affinity_hint
Date: Fri, 27 Oct 2023 12:03:17 +0200 [thread overview]
Message-ID: <87sf5w1ica.fsf@cloudflare.com> (raw)
In-Reply-To: <20231026131830-mutt-send-email-mst@kernel.org>
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 <jakub@cloudflare.com>
>> > ---
>> > 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.
next prev parent reply other threads:[~2023-10-27 10:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-25 14:53 [PATCH v2] virtio_pci: Switch away from deprecated irq_set_affinity_hint Jakub Sitnicki via Virtualization
2023-10-25 14:53 ` Jakub Sitnicki
2023-10-26 3:36 ` Xuan Zhuo
2023-10-26 3:36 ` Xuan Zhuo
2023-10-26 16:25 ` Jakub Sitnicki via Virtualization
2023-10-26 16:25 ` Jakub Sitnicki
2023-10-26 17:20 ` Michael S. Tsirkin
2023-10-26 17:20 ` Michael S. Tsirkin
2023-10-27 10:03 ` Jakub Sitnicki via Virtualization [this message]
2023-10-27 10:03 ` Jakub Sitnicki
2023-10-28 1:45 ` Xuan Zhuo
2023-10-28 1:45 ` Xuan Zhuo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sf5w1ica.fsf@cloudflare.com \
--to=virtualization@lists.linux-foundation.org \
--cc=jakub@cloudflare.com \
--cc=kernel-team@cloudflare.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=xuanzhuo@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.