All of lore.kernel.org
 help / color / mirror / Atom feed
From: vinod.koul@intel.com (Vinod Koul)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] dmaengine: xgene-dma: Disable memcpy operation due to performance drop
Date: Mon, 12 Oct 2015 19:53:36 +0530	[thread overview]
Message-ID: <20151012142336.GA27370@localhost> (raw)
In-Reply-To: <CAFd313w3010=LN7rfrxwohM=h-9xWzK6UNtcWxn+eXtx-pNv4Q@mail.gmail.com>

On Fri, Oct 09, 2015 at 10:08:32PM +0530, Rameshwar Sahu wrote:
> Hi Vinod,
> 
> On Fri, Oct 9, 2015 at 9:42 PM, Vinod Koul <vinod.koul@intel.com> wrote:
> > On Thu, Oct 08, 2015 at 02:36:57PM +0530, Rameshwar Prasad Sahu wrote:
> >> 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.
> >>
> >> Signed-off-by: Rameshwar Prasad Sahu <rsahu@apm.com>
> >> ---
> >>  drivers/dma/xgene-dma.c | 1 -
> >>  1 file changed, 1 deletion(-)
> >>
> >> diff --git a/drivers/dma/xgene-dma.c b/drivers/dma/xgene-dma.c
> >> index 8d57b1b..cd38022 100644
> >> --- a/drivers/dma/xgene-dma.c
> >> +++ b/drivers/dma/xgene-dma.c
> >> @@ -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
> 
> 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

-- 
~Vinod

WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vinod.koul@intel.com>
To: Rameshwar Sahu <rsahu@apm.com>
Cc: dan.j.williams@intel.com, dmaengine@vger.kernel.org,
	Arnd Bergmann <arnd@arndb.de>,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, jcm@redhat.com,
	patches@apm.com
Subject: Re: [PATCH v2] dmaengine: xgene-dma: Disable memcpy operation due to performance drop
Date: Mon, 12 Oct 2015 19:53:36 +0530	[thread overview]
Message-ID: <20151012142336.GA27370@localhost> (raw)
In-Reply-To: <CAFd313w3010=LN7rfrxwohM=h-9xWzK6UNtcWxn+eXtx-pNv4Q@mail.gmail.com>

On Fri, Oct 09, 2015 at 10:08:32PM +0530, Rameshwar Sahu wrote:
> Hi Vinod,
> 
> On Fri, Oct 9, 2015 at 9:42 PM, Vinod Koul <vinod.koul@intel.com> wrote:
> > On Thu, Oct 08, 2015 at 02:36:57PM +0530, Rameshwar Prasad Sahu wrote:
> >> 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.
> >>
> >> Signed-off-by: Rameshwar Prasad Sahu <rsahu@apm.com>
> >> ---
> >>  drivers/dma/xgene-dma.c | 1 -
> >>  1 file changed, 1 deletion(-)
> >>
> >> diff --git a/drivers/dma/xgene-dma.c b/drivers/dma/xgene-dma.c
> >> index 8d57b1b..cd38022 100644
> >> --- a/drivers/dma/xgene-dma.c
> >> +++ b/drivers/dma/xgene-dma.c
> >> @@ -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
> 
> 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

-- 
~Vinod

  reply	other threads:[~2015-10-12 14:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08  9:06 [PATCH v2] dmaengine: xgene-dma: Disable memcpy operation due to performance drop Rameshwar Prasad Sahu
2015-10-08  9:06 ` Rameshwar Prasad Sahu
2015-10-08  9:06 ` Rameshwar Prasad Sahu
2015-10-09 16:12 ` Vinod Koul
2015-10-09 16:12   ` Vinod Koul
2015-10-09 16:38   ` Rameshwar Sahu
2015-10-09 16:38     ` Rameshwar Sahu
2015-10-09 16:38     ` Rameshwar Sahu
2015-10-12 14:23     ` Vinod Koul [this message]
2015-10-12 14:23       ` Vinod Koul
2015-10-14 10:20       ` Rameshwar Sahu
2015-10-14 10:20         ` Rameshwar Sahu
2015-10-14 10:20         ` Rameshwar Sahu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151012142336.GA27370@localhost \
    --to=vinod.koul@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.