Skip to contentSkip to conversation

dmaengine: xgene-dma: Disable memcpy operation due to performance drop

PATCH In review Rameshwar Prasad Sahu 2 participants 5 messages Oct 8, 2015 – Oct 14, 2015 dmaengine

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dmaengine: xgene-dma: Disable memcpy operation due to performance drop

The DMA engine supports memory copy, RAID5 XOR, RAID6 PQ, and other computations. But the bandwidth of the entire DMA engine is shared among all channels. This patch re-configures operations availability such that one can achieve maximum performance for XOR and PQ computation by removing the memory offload operations.

---
 drivers/dma/xgene-dma.c | 1 -
 1 file changed, 1 deletion(-)
drivers/dma/xgene-dma.c +0 -1
index 8d57b1b..cd38022 100644
@@ -1707,7 +1707,6 @@ static void xgene_dma_set_caps(struct xgene_dma_chan *chan,
 	dma_cap_zero(dma_dev->cap_mask);
 
 	/* Set DMA device capability */
-	dma_cap_set(DMA_MEMCPY, dma_dev->cap_mask);
 	dma_cap_set(DMA_SG, dma_dev->cap_mask);
 
 	/* Basically here, the X-Gene SoC DMA engine channel 0 supports XOR

--
1.8.2.1

#1 lore raw
Quoted 16 lines · Rameshwar Prasad Sahu

The DMA engine supports memory copy, RAID5 XOR, RAID6 PQ, and other computations. But the bandwidth of the entire DMA engine is shared among all channels. This patch re-configures operations availability such that one can achieve maximum performance for XOR and PQ computation by removing the memory offload operations.

---
 drivers/dma/xgene-dma.c | 1 -
 1 file changed, 1 deletion(-)
drivers/dma/xgene-dma.c +0 -0
index 8d57b1b..cd38022 100644

drivers/dma/xgene-dma.c static void xgene_dma_set_caps(struct xgene_dma_chan *chan, · line 1710

Quoted 5 lines
drivers/dma/xgene-dma.c +0 -1
@@ -1707,7 +1707,6 @@ static void xgene_dma_set_caps(struct xgene_dma_chan *chan,
 	dma_cap_zero(dma_dev->cap_mask);
 
 	/* Set DMA device capability */
-	dma_cap_set(DMA_MEMCPY, dma_dev->cap_mask);
 	dma_cap_set(DMA_SG, dma_dev->cap_mask);

This will not work. Still clients can invoke memcpy operation. You need to remove the callback

Signature · 1 line
~Vinod
#2 lore raw

Hi Vinod,

Quoted 19 lines · Vinod Koul
Quoted 18 lines · Rameshwar Prasad Sahu

The DMA engine supports memory copy, RAID5 XOR, RAID6 PQ, and other computations. But the bandwidth of the entire DMA engine is shared among all channels. This patch re-configures operations availability such that one can achieve maximum performance for XOR and PQ computation by removing the memory offload operations.

---
 drivers/dma/xgene-dma.c | 1 -
 1 file changed, 1 deletion(-)
drivers/dma/xgene-dma.c +0 -0
index 8d57b1b..cd38022 100644
@@ -1707,7 +1707,6 @@ static void xgene_dma_set_caps(struct xgene_dma_chan *chan,
      dma_cap_zero(dma_dev->cap_mask);
 
Quoted 6 lines

drivers/dma/xgene-dma.c static void xgene_dma_set_caps(struct xgene_dma_chan *chan, · line 1710

Quoted 3 lines
drivers/dma/xgene-dma.c +0 -1
      /* Set DMA device capability */
-     dma_cap_set(DMA_MEMCPY, dma_dev->cap_mask);
      dma_cap_set(DMA_SG, dma_dev->cap_mask);

This will not work. Still clients can invoke memcpy operation. You need to remove the callback

Got it, instead of removing the callback registration can we keep it inside the condition like..

if (dma_has_cap(DMA_MEMCPY, dma_dev->cap_mask))

            dma_dev->device_prep_dma_memcpy = xgene_dma_prep_memcpy;
Quoted 3 lines

--
~Vinod

#3 lore raw
Quoted 29 lines · Rameshwar Sahu

Hi Vinod,

Quoted 19 lines · Vinod Koul
Quoted 18 lines · Rameshwar Prasad Sahu

The DMA engine supports memory copy, RAID5 XOR, RAID6 PQ, and other computations. But the bandwidth of the entire DMA engine is shared among all channels. This patch re-configures operations availability such that one can achieve maximum performance for XOR and PQ computation by removing the memory offload operations.

---
 drivers/dma/xgene-dma.c | 1 -
 1 file changed, 1 deletion(-)
drivers/dma/xgene-dma.c +0 -0
index 8d57b1b..cd38022 100644
@@ -1707,7 +1707,6 @@ static void xgene_dma_set_caps(struct xgene_dma_chan *chan,
      dma_cap_zero(dma_dev->cap_mask);
 
Quoted 6 lines

drivers/dma/xgene-dma.c static void xgene_dma_set_caps(struct xgene_dma_chan *chan, · line 1710

Quoted 3 lines
drivers/dma/xgene-dma.c +0 -1
      /* Set DMA device capability */
-     dma_cap_set(DMA_MEMCPY, dma_dev->cap_mask);
      dma_cap_set(DMA_SG, dma_dev->cap_mask);

This will not work. Still clients can invoke memcpy operation. You need to remove the callback

Quoted 5 lines

Got it, instead of removing the callback registration can we keep it inside the condition like..

if (dma_has_cap(DMA_MEMCPY, dma_dev->cap_mask))

            dma_dev->device_prep_dma_memcpy = xgene_dma_prep_memcpy;

But the code is dead and will not be tested and hence not maintained. I do not see a reason to keep dead code in kernel

Signature · 1 line
~Vinod
#4 lore raw

Hi Vinod,

Quoted 30 lines · Vinod Koul
Quoted 29 lines · Rameshwar Sahu

Hi Vinod,

Quoted 25 lines · Vinod Koul
Quoted 16 lines · Rameshwar Prasad Sahu

The DMA engine supports memory copy, RAID5 XOR, RAID6 PQ, and other computations. But the bandwidth of the entire DMA engine is shared among all channels. This patch re-configures operations availability such that one can achieve maximum performance for XOR and PQ computation by removing the memory offload operations.

---
 drivers/dma/xgene-dma.c | 1 -
 1 file changed, 1 deletion(-)
drivers/dma/xgene-dma.c +0 -0
index 8d57b1b..cd38022 100644

drivers/dma/xgene-dma.c static void xgene_dma_set_caps(struct xgene_dma_chan *chan, · line 1710

Quoted 5 lines
drivers/dma/xgene-dma.c +0 -1
@@ -1707,7 +1707,6 @@ static void xgene_dma_set_caps(struct xgene_dma_chan *chan,
      dma_cap_zero(dma_dev->cap_mask);
 
      /* Set DMA device capability */
-     dma_cap_set(DMA_MEMCPY, dma_dev->cap_mask);
      dma_cap_set(DMA_SG, dma_dev->cap_mask);

This will not work. Still clients can invoke memcpy operation. You need to remove the callback

Quoted 8 lines
Quoted 5 lines

Got it, instead of removing the callback registration can we keep it inside the condition like..

if (dma_has_cap(DMA_MEMCPY, dma_dev->cap_mask))

            dma_dev->device_prep_dma_memcpy = xgene_dma_prep_memcpy;

But the code is dead and will not be tested and hence not maintained. I do not see a reason to keep dead code in kernel

Got it, I will remove the memcpy offload support and will send another patch for review.

Quoted 3 lines

--
~Vinod