From: Yury Norov <yury.norov@gmail.com>
To: arnd@arndb.de, benh@kernel.crashing.org, paulus@samba.org
Cc: linuxppc-dev@lists.ozlabs.org, cbe-oss-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org, klimov.linux@gmail.com,
Yury Norov <yury.norov@gmail.com>
Subject: [PATCH] powerpc: remove unneeded check in spu_gang_remove_ctx
Date: Mon, 22 Jun 2015 21:49:11 +0300 [thread overview]
Message-ID: <1434998951-26285-1-git-send-email-yury.norov@gmail.com> (raw)
In discussion to patch "selinux: reduce locking overhead in
inode_free_security()" it was figured out that list_del_init()
is safe to be called multiple times on the same entry. In that
case, it was useful to move a check out of spinlock to decrease
lock contention. Here we can remove '!list_empty()' check completely
and decrease 'spu_gang_remove_ctx()' function size, and (sometimes)
avoid branch predictor misses.
Signed-off-by: Yury Norov <yury.norov@gmail.com>
---
arch/powerpc/platforms/cell/spufs/gang.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/platforms/cell/spufs/gang.c b/arch/powerpc/platforms/cell/spufs/gang.c
index 71a4432..67e3fc3 100644
--- a/arch/powerpc/platforms/cell/spufs/gang.c
+++ b/arch/powerpc/platforms/cell/spufs/gang.c
@@ -75,10 +75,10 @@ void spu_gang_remove_ctx(struct spu_gang *gang, struct spu_context *ctx)
{
mutex_lock(&gang->mutex);
WARN_ON(ctx->gang != gang);
- if (!list_empty(&ctx->aff_list)) {
- list_del_init(&ctx->aff_list);
- gang->aff_flags &= ~AFF_OFFSETS_SET;
- }
+
+ list_del_init(&ctx->aff_list);
+ gang->aff_flags &= ~AFF_OFFSETS_SET;
+
list_del_init(&ctx->gang_list);
gang->contexts--;
mutex_unlock(&gang->mutex);
--
2.1.4
reply other threads:[~2015-06-22 18:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1434998951-26285-1-git-send-email-yury.norov@gmail.com \
--to=yury.norov@gmail.com \
--cc=arnd@arndb.de \
--cc=benh@kernel.crashing.org \
--cc=cbe-oss-dev@lists.ozlabs.org \
--cc=klimov.linux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).