From: <b29237@freescale.com>
To: <iws@ovro.caltech.edu>, <vinod.koul@intel.com>,
<dan.j.williams@intel.com>, <linuxppc-dev@lists.ozlabs.org>,
<linux-kernel@vger.kernel.org>
Cc: Forrest shi <b29237@freescale.com>
Subject: [PATCH] fsldma: fix performance degradation by optimizing spinlock use.
Date: Mon, 26 Dec 2011 14:01:03 +0800 [thread overview]
Message-ID: <1324879263-11845-1-git-send-email-b29237@freescale.com> (raw)
From: Forrest shi <b29237@freescale.com>
dma status check function fsl_tx_status is heavily called in
a tight loop and the desc lock in fsl_tx_status contended by
the dma status update function. this caused the dma performance
degrades much.
this patch releases the lock in the fsl_tx_status function, and
introduce the smp_mb() to avoid possible memory inconsistency.
Signed-off-by: Forrest Shi <xuelin.shi@freescale.com>
---
drivers/dma/fsldma.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index 8a78154..008fb5e 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -986,15 +986,11 @@ static enum dma_status fsl_tx_status(struct dma_chan *dchan,
struct fsldma_chan *chan = to_fsl_chan(dchan);
dma_cookie_t last_complete;
dma_cookie_t last_used;
- unsigned long flags;
-
- spin_lock_irqsave(&chan->desc_lock, flags);
last_complete = chan->completed_cookie;
+ smp_mb();
last_used = dchan->cookie;
- spin_unlock_irqrestore(&chan->desc_lock, flags);
-
dma_set_tx_state(txstate, last_complete, last_used, 0);
return dma_async_is_complete(cookie, last_complete, last_used);
}
--
1.7.0.4
next reply other threads:[~2011-12-26 6:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-26 6:01 b29237 [this message]
2012-01-11 7:54 ` Shi Xuelin-B29237
2012-01-11 16:13 ` Ira W. Snyder
2012-04-26 2:03 ` Shi Xuelin-B29237
2012-04-26 2:59 ` Li Yang-R58472
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=1324879263-11845-1-git-send-email-b29237@freescale.com \
--to=b29237@freescale.com \
--cc=dan.j.williams@intel.com \
--cc=iws@ovro.caltech.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=vinod.koul@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®