RE: [RFC 0/7] Introduce swiotlb throttling

2024-08-29 Thread Michael Kelley
From: Robin Murphy Sent: Wednesday, August 28, 2024 12:50 PM > > On 2024-08-28 2:03 pm, Petr Tesařík wrote: > > On Wed, 28 Aug 2024 13:02:31 +0100 > > Robin Murphy wrote: > > > >> On 2024-08-22 7:37 pm, mhkelle...@gmail.com wrote: > >>> From: Michael Kelley > >>> > >>> Background > >>> ===

Re: [RFC 0/7] Introduce swiotlb throttling

2024-08-28 Thread Robin Murphy
On 2024-08-28 2:03 pm, Petr Tesařík wrote: On Wed, 28 Aug 2024 13:02:31 +0100 Robin Murphy wrote: On 2024-08-22 7:37 pm, mhkelle...@gmail.com wrote: From: Michael Kelley Background == Linux device drivers may make DMA map/unmap calls in contexts that cannot block, such as in an inte

Re: [RFC 0/7] Introduce swiotlb throttling

2024-08-28 Thread Petr Tesařík
On Wed, 28 Aug 2024 16:30:04 + Michael Kelley wrote: > From: Petr Tesařík Sent: Wednesday, August 28, 2024 6:04 AM > > > > On Wed, 28 Aug 2024 13:02:31 +0100 > > Robin Murphy wrote: > > > > > On 2024-08-22 7:37 pm, mhkelle...@gmail.com wrote: > > > > From: Michael Kelley > > > > > >

RE: [RFC 0/7] Introduce swiotlb throttling

2024-08-28 Thread Michael Kelley
From: Petr Tesařík Sent: Wednesday, August 28, 2024 6:04 AM > > On Wed, 28 Aug 2024 13:02:31 +0100 > Robin Murphy wrote: > > > On 2024-08-22 7:37 pm, mhkelle...@gmail.com wrote: > > > From: Michael Kelley > > > > > > Background > > > == > > > Linux device drivers may make DMA map/unmap

Re: [RFC 0/7] Introduce swiotlb throttling

2024-08-28 Thread Petr Tesařík
On Wed, 28 Aug 2024 13:02:31 +0100 Robin Murphy wrote: > On 2024-08-22 7:37 pm, mhkelle...@gmail.com wrote: > > From: Michael Kelley > > > > Background > > == > > Linux device drivers may make DMA map/unmap calls in contexts that > > cannot block, such as in an interrupt handler. Conseq

Re: [RFC 0/7] Introduce swiotlb throttling

2024-08-28 Thread Robin Murphy
On 2024-08-22 7:37 pm, mhkelle...@gmail.com wrote: From: Michael Kelley Background == Linux device drivers may make DMA map/unmap calls in contexts that cannot block, such as in an interrupt handler. Consequently, when a DMA map call must use a bounce buffer, the allocation of swiotlb m

Re: [RFC 0/7] Introduce swiotlb throttling

2024-08-27 Thread Petr Tesařík
On Tue, 27 Aug 2024 00:26:36 + Michael Kelley wrote: > From: Petr Tesařík Sent: Monday, August 26, 2024 12:28 PM > > > > On Mon, 26 Aug 2024 16:24:53 + > > Michael Kelley wrote: > > > > > From: Petr Tesařík Sent: Saturday, August 24, 2024 > > > 1:06 PM > > > > > > > > On Fri, 23

Re: [RFC 0/7] Introduce swiotlb throttling

2024-08-27 Thread Christoph Hellwig
On Mon, Aug 26, 2024 at 03:27:30PM +, Michael Kelley wrote: > OK, this makes sense to me. The DMA_ATTR_* symbols are currently > defined as just values that are not part of an enum or any other higher > level abstraction, and the "attrs" parameter to the dma_* functions is > just "unsigned long

RE: [RFC 0/7] Introduce swiotlb throttling

2024-08-26 Thread Michael Kelley
From: Petr Tesařík Sent: Monday, August 26, 2024 12:28 PM > > On Mon, 26 Aug 2024 16:24:53 + > Michael Kelley wrote: > > > From: Petr Tesařík Sent: Saturday, August 24, 2024 1:06 > > PM > > > > > > On Fri, 23 Aug 2024 20:40:16 + > > > Michael Kelley wrote: > > > > > > > From: Petr Te

Re: [RFC 0/7] Introduce swiotlb throttling

2024-08-26 Thread Petr Tesařík
On Mon, 26 Aug 2024 16:24:53 + Michael Kelley wrote: > From: Petr Tesařík Sent: Saturday, August 24, 2024 1:06 PM > > > > On Fri, 23 Aug 2024 20:40:16 + > > Michael Kelley wrote: > > > > > From: Petr Tesařík Sent: Thursday, August 22, 2024 > > > 11:45 PM > > >[...] > > > > > Dis

RE: [RFC 0/7] Introduce swiotlb throttling

2024-08-26 Thread Michael Kelley
From: Petr Tesařík Sent: Saturday, August 24, 2024 1:06 PM > > On Fri, 23 Aug 2024 20:40:16 + > Michael Kelley wrote: > > > From: Petr Tesařík Sent: Thursday, August 22, 2024 11:45 > > PM > >[...] > > > > Discussion > > > > == > > > > * Since swiotlb isn't visible to device driver

RE: [RFC 0/7] Introduce swiotlb throttling

2024-08-26 Thread Michael Kelley
From: Christoph Hellwig Sent: Saturday, August 24, 2024 1:16 AM > > On Thu, Aug 22, 2024 at 11:37:11AM -0700, mhkelle...@gmail.com wrote: > > Because it's not possible to detect at runtime whether a DMA map call > > is made in a context that can block, the calls in key device drivers > > must be

Re: [RFC 0/7] Introduce swiotlb throttling

2024-08-24 Thread Petr Tesařík
On Fri, 23 Aug 2024 20:40:16 + Michael Kelley wrote: > From: Petr Tesařík Sent: Thursday, August 22, 2024 11:45 PM >[...] > > > Discussion > > > == > > > * Since swiotlb isn't visible to device drivers, I've specifically > > > named the DMA attribute as MAY_BLOCK instead of MAY_THROT

Re: [RFC 0/7] Introduce swiotlb throttling

2024-08-24 Thread Christoph Hellwig
On Thu, Aug 22, 2024 at 11:37:11AM -0700, mhkelle...@gmail.com wrote: > Because it's not possible to detect at runtime whether a DMA map call > is made in a context that can block, the calls in key device drivers > must be updated with a MAY_BLOCK attribute, if appropriate. When this > attribute is

Re: [RFC 0/7] Introduce swiotlb throttling

2024-08-24 Thread h...@lst.de
On Fri, Aug 23, 2024 at 02:20:41AM +, Michael Kelley wrote: > Christoph Hellwig, or anyone else who knows the history and current > reality better than I do, please jump in. :-) It's not just interrupt context, but any context that does not allow blocking. There is plenty of that as seen by t

RE: [RFC 0/7] Introduce swiotlb throttling

2024-08-23 Thread Michael Kelley
From: Petr Tesařík Sent: Thursday, August 22, 2024 11:45 PM > > Hi all, > > upfront, I've had more time to consider this idea, because Michael > kindly shared it with me back in February. > > On Thu, 22 Aug 2024 11:37:11 -0700 > mhkelle...@gmail.com wrote: > > > From: Michael Kelley > > > > B

Re: [RFC 0/7] Introduce swiotlb throttling

2024-08-22 Thread Petr Tesařík
Hi all, upfront, I've had more time to consider this idea, because Michael kindly shared it with me back in February. On Thu, 22 Aug 2024 11:37:11 -0700 mhkelle...@gmail.com wrote: > From: Michael Kelley > > Background > == > Linux device drivers may make DMA map/unmap calls in context

Re: [RFC 0/7] Introduce swiotlb throttling

2024-08-22 Thread Petr Tesařík
On Fri, 23 Aug 2024 02:20:41 + Michael Kelley wrote: > From: Bart Van Assche Sent: Thursday, August 22, 2024 > 12:29 PM > > > > On 8/22/24 11:37 AM, mhkelle...@gmail.com wrote: > > > Linux device drivers may make DMA map/unmap calls in contexts that > > > cannot block, such as in an inte

RE: [RFC 0/7] Introduce swiotlb throttling

2024-08-22 Thread Michael Kelley
From: Bart Van Assche Sent: Thursday, August 22, 2024 12:29 PM > > On 8/22/24 11:37 AM, mhkelle...@gmail.com wrote: > > Linux device drivers may make DMA map/unmap calls in contexts that > > cannot block, such as in an interrupt handler. > > Although I really appreciate your work, what alternat

Re: [RFC 0/7] Introduce swiotlb throttling

2024-08-22 Thread Bart Van Assche
On 8/22/24 11:37 AM, mhkelle...@gmail.com wrote: Linux device drivers may make DMA map/unmap calls in contexts that cannot block, such as in an interrupt handler. Although I really appreciate your work, what alternatives have been considered? How many drivers perform DMA mapping from atomic con