Re: [PATCH 1/2] swiotlb: Split up single swiotlb lock

From
Christoph Hellwig <hch@infradead.org>
Date
2022-06-29 14:09:37
Also in
linux-hyperv, linux-iommu, linux-pm, lkml
Reply to
Tianyu Lan, 2022-06-27
On Mon, Jun 27, 2022 at 11:31:49AM -0400, Tianyu Lan wrote:
quoted hunk ↗ jump to hunk
+/**
+ * struct io_tlb_area - IO TLB memory area descriptor
+ *
+ * This is a single area with a single lock.
+ *
+ * @used:	The number of used IO TLB block.
+ * @index:	The slot index to start searching in this area for next round.
+ * @lock:	The lock to protect the above data structures in the map and
+ *		unmap calls.
+ */
+struct io_tlb_area {
+	unsigned long used;
+	unsigned int index;
+	spinlock_t lock;
+};
As already mentioned last time, please move this into swiotlb.c,
swiotlb.h only uses a pointer to this structure.
quoted hunk ↗ jump to hunk
 static void swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start,
-		unsigned long nslabs, unsigned int flags, bool late_alloc)
+				    unsigned long nslabs, unsigned int flags,
+				    bool late_alloc, unsigned int nareas)
Nit: the two tab indentation for prototype continuations is a lot easier
to maintain, so don't graciously switch away from it.
+			alloc_size - (offset + ((i - slot_index) << IO_TLB_SHIFT));
Overly long line here.
Thread (10 messages) 10 messages, 2 authors, last reply 2022-07-06
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help