Re: [PATCH v2 RESEND 7/7] swiotlb: per-device flag if there are dynamically allocated buffers

2023-05-17 Thread Catalin Marinas
On Tue, May 16, 2023 at 09:55:12AM +0200, Petr Tesařík wrote: > On Mon, 15 May 2023 17:28:38 +0100 > Catalin Marinas wrote: > > There is another scenario to take into account on the list_del() side. > > Let's assume that there are other elements on the list, so > > list_empty() == false: > > > >

Re: [PATCH v2 RESEND 7/7] swiotlb: per-device flag if there are dynamically allocated buffers

2023-05-16 Thread Petr Tesařík
On Mon, 15 May 2023 17:28:38 +0100 Catalin Marinas wrote: > (some of you replies may have been filtered to various of my mailboxes, > depending on which lists you cc'ed; replying here) > > On Mon, May 15, 2023 at 12:00:54PM +0200, Petr Tesařík wrote: > > On Mon, 15 May 2023 10:48:47 +0200 > >

Re: [PATCH v2 RESEND 7/7] swiotlb: per-device flag if there are dynamically allocated buffers

2023-05-16 Thread Petr Tesařík
(restoring the Cc list that I accidentally removed in my previous reply.) On Mon, 15 May 2023 10:39:11 +0100 Catalin Marinas wrote: > Hi Petr, > > On Mon, May 15, 2023 at 10:47:37AM +0200, Petr Tesařík wrote: > > On Sun, 14 May 2023 19:54:27 +0100 > > Catalin Marinas wrote: > > > On Tue,

Re: [PATCH v2 RESEND 7/7] swiotlb: per-device flag if there are dynamically allocated buffers

2023-05-16 Thread Catalin Marinas
(some of you replies may have been filtered to various of my mailboxes, depending on which lists you cc'ed; replying here) On Mon, May 15, 2023 at 12:00:54PM +0200, Petr Tesařík wrote: > On Mon, 15 May 2023 10:48:47 +0200 > Petr Tesařík wrote: > > On Sun, 14 May 2023 19:54:27 +0100 > > Catalin

Re: [PATCH v2 RESEND 7/7] swiotlb: per-device flag if there are dynamically allocated buffers

2023-05-15 Thread Petr Tesařík
On Mon, 15 May 2023 10:48:47 +0200 Petr Tesařík wrote: > Hi Catalin, > > On Sun, 14 May 2023 19:54:27 +0100 > Catalin Marinas wrote: >[...] > > Now, thinking about the list_head access and the flag ordering, since it > > doesn't matter, you might as well not bother with the flag at all and > >

Re: [PATCH v2 RESEND 7/7] swiotlb: per-device flag if there are dynamically allocated buffers

2023-05-15 Thread Petr Tesařík
Hi Catalin, On Sun, 14 May 2023 19:54:27 +0100 Catalin Marinas wrote: > On Tue, May 09, 2023 at 11:18:19AM +0200, Petr Tesarik wrote: > > diff --git a/include/linux/device.h b/include/linux/device.h > > index d1d2b8557b30..e340e0f06dce 100644 > > --- a/include/linux/device.h > > +++

Re: [PATCH v2 RESEND 7/7] swiotlb: per-device flag if there are dynamically allocated buffers

2023-05-15 Thread Catalin Marinas
On Tue, May 09, 2023 at 11:18:19AM +0200, Petr Tesarik wrote: > diff --git a/include/linux/device.h b/include/linux/device.h > index d1d2b8557b30..e340e0f06dce 100644 > --- a/include/linux/device.h > +++ b/include/linux/device.h > @@ -516,6 +516,9 @@ struct device_physical_location { > *

[PATCH v2 RESEND 7/7] swiotlb: per-device flag if there are dynamically allocated buffers

2023-05-09 Thread Petr Tesarik
From: Petr Tesarik Do not walk the list of dynamically allocated bounce buffers if the list is empty. This avoids taking dma_io_tlb_dyn_lock for devices which do not use any dynamically allocated bounce buffers. When unmapping the last dynamically allocated bounce buffer, the flag is set to