* idxd: shared workqueues and dmaengine
@ 2025-03-27 0:05 Kevin Krakauer
2025-03-27 0:15 ` Dave Jiang
0 siblings, 1 reply; 4+ messages in thread
From: Kevin Krakauer @ 2025-03-27 0:05 UTC (permalink / raw)
To: fenghua.yu, dave.jiang; +Cc: dmaengine
Hey, I'm trying to use idxd inside the kernel via dmaengine. I'm
attempting to get shared work queues (SWQs) via dma_find_channel(),
which stubbornly returns NULL.
After a lot of printk-ing, I finally ran across DMA_PRIVATE. I also
found [1] and saw that DMA_PRIVATE is also set in the idxd driver since
c06e424be5f51844 ("dmaengine: idxd: set DMA channel to be private").
It seems like this forces use of dma_request_channel(). But I believe
the idea behind SWQs is that they don't have to be exclusively owned.
Is there a way to use SWQs via dma_find_channel()? dma_request_channel()
seems like overkill, as the point of SWQs is to not be exclusive. Also a
good chance I'm missing something basic here :)
Thanks!
Kevin
1 - https://lore.kernel.org/dmaengine/9714cb6c-8b37-4fc6-bb09-a1fb4a5bb1b8@intel.com/#R
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: idxd: shared workqueues and dmaengine
2025-03-27 0:05 idxd: shared workqueues and dmaengine Kevin Krakauer
@ 2025-03-27 0:15 ` Dave Jiang
2025-03-27 18:56 ` Kevin Krakauer
0 siblings, 1 reply; 4+ messages in thread
From: Dave Jiang @ 2025-03-27 0:15 UTC (permalink / raw)
To: Kevin Krakauer, Vinicius Costa Gomes; +Cc: dmaengine
On 3/26/25 5:05 PM, Kevin Krakauer wrote:
> Hey, I'm trying to use idxd inside the kernel via dmaengine. I'm
> attempting to get shared work queues (SWQs) via dma_find_channel(),
> which stubbornly returns NULL.
>
> After a lot of printk-ing, I finally ran across DMA_PRIVATE. I also
> found [1] and saw that DMA_PRIVATE is also set in the idxd driver since
> c06e424be5f51844 ("dmaengine: idxd: set DMA channel to be private").
>
> It seems like this forces use of dma_request_channel(). But I believe
> the idea behind SWQs is that they don't have to be exclusively owned.
>
> Is there a way to use SWQs via dma_find_channel()? dma_request_channel()
> seems like overkill, as the point of SWQs is to not be exclusive. Also a
> good chance I'm missing something basic here :)
+Vinicius, current maintainer of the driver.
So I think maybe a new sysfs attribute can be added to wq to allow the user to choose whether to make the channel DMA_PRIVATE or not. By default it can be set to DMA_PRIVATE to keep legacy behavior. I think that should solve the issue you are encountering?
>
> Thanks!
> Kevin
>
> 1 - https://lore.kernel.org/dmaengine/9714cb6c-8b37-4fc6-bb09-a1fb4a5bb1b8@intel.com/#R
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: idxd: shared workqueues and dmaengine
2025-03-27 0:15 ` Dave Jiang
@ 2025-03-27 18:56 ` Kevin Krakauer
2025-03-27 20:22 ` Dave Jiang
0 siblings, 1 reply; 4+ messages in thread
From: Kevin Krakauer @ 2025-03-27 18:56 UTC (permalink / raw)
To: Dave Jiang; +Cc: Vinicius Costa Gomes, dmaengine
On Wed, Mar 26, 2025 at 05:15:37PM -0700, Dave Jiang wrote:
> So I think maybe a new sysfs attribute can be added to wq to allow the user to choose whether to make the channel DMA_PRIVATE or not. By default it can be set to DMA_PRIVATE to keep legacy behavior. I think that should solve the issue you are encountering?
Yep, that would do it. Thanks for helping me understand -- I was
wondering whether I was missing something.
Easy for me to workaround for now, or maybe I'll just add the sysfs
attribute and send it to the list. Thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: idxd: shared workqueues and dmaengine
2025-03-27 18:56 ` Kevin Krakauer
@ 2025-03-27 20:22 ` Dave Jiang
0 siblings, 0 replies; 4+ messages in thread
From: Dave Jiang @ 2025-03-27 20:22 UTC (permalink / raw)
To: Kevin Krakauer; +Cc: Vinicius Costa Gomes, dmaengine
On 3/27/25 11:56 AM, Kevin Krakauer wrote:
> On Wed, Mar 26, 2025 at 05:15:37PM -0700, Dave Jiang wrote:
>> So I think maybe a new sysfs attribute can be added to wq to allow the user to choose whether to make the channel DMA_PRIVATE or not. By default it can be set to DMA_PRIVATE to keep legacy behavior. I think that should solve the issue you are encountering?
>
> Yep, that would do it. Thanks for helping me understand -- I was
> wondering whether I was missing something.
>
> Easy for me to workaround for now, or maybe I'll just add the sysfs
> attribute and send it to the list. Thanks!
Patches are always welcome. I'm sure Vinicius would appreciate it.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-03-27 20:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-27 0:05 idxd: shared workqueues and dmaengine Kevin Krakauer
2025-03-27 0:15 ` Dave Jiang
2025-03-27 18:56 ` Kevin Krakauer
2025-03-27 20:22 ` Dave Jiang
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.